2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:02:47 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-01-02 14:52:27 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
#ifndef BASCTL_LOCALIZATIONMGR_HXX
|
|
|
|
#define BASCTL_LOCALIZATIONMGR_HXX
|
2007-01-02 14:52:27 +00:00
|
|
|
|
2007-03-15 15:02:52 +00:00
|
|
|
#include "scriptdocument.hxx"
|
|
|
|
|
2011-11-06 21:21:30 -05:00
|
|
|
#include <com/sun/star/resource/XStringResourceManager.hpp>
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
|
|
|
class Shell;
|
2007-01-02 14:52:27 +00:00
|
|
|
class DlgEditor;
|
|
|
|
|
|
|
|
class LocalizationMgr
|
|
|
|
{
|
|
|
|
::com::sun::star::uno::Reference
|
|
|
|
< ::com::sun::star::resource::XStringResourceManager > m_xStringResourceManager;
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Shell* m_pShell;
|
2007-01-02 14:52:27 +00:00
|
|
|
|
2007-03-15 15:02:52 +00:00
|
|
|
ScriptDocument m_aDocument;
|
2012-10-26 23:35:24 -02:00
|
|
|
OUString m_aLibName;
|
2007-01-02 14:52:27 +00:00
|
|
|
|
|
|
|
::com::sun::star::lang::Locale m_aLocaleBeforeBasicStart;
|
|
|
|
|
|
|
|
enum HandleResourceMode
|
|
|
|
{
|
|
|
|
SET_IDS,
|
|
|
|
RESET_IDS,
|
2007-01-29 15:53:04 +00:00
|
|
|
RENAME_DIALOG_IDS,
|
|
|
|
RENAME_CONTROL_IDS,
|
|
|
|
REMOVE_IDS_FROM_RESOURCE,
|
2007-06-26 15:53:22 +00:00
|
|
|
MOVE_RESOURCES,
|
|
|
|
COPY_RESOURCES
|
2007-01-02 14:52:27 +00:00
|
|
|
};
|
|
|
|
static sal_Int32 implHandleControlResourceProperties( ::com::sun::star::uno::Any aControlAny,
|
2012-10-26 23:35:24 -02:00
|
|
|
const OUString& aDialogName, const OUString& aCtrlName,
|
2007-01-02 14:52:27 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager >
|
2007-01-29 15:53:04 +00:00
|
|
|
xStringResourceManager, ::com::sun::star::uno::Reference< ::com::sun::star::resource::
|
|
|
|
XStringResourceResolver > xSourceStringResolver, HandleResourceMode eMode );
|
2007-01-02 14:52:27 +00:00
|
|
|
|
2007-01-18 13:18:59 +00:00
|
|
|
void enableResourceForAllLibraryDialogs( void )
|
2007-01-02 14:52:27 +00:00
|
|
|
{
|
|
|
|
implEnableDisableResourceForAllLibraryDialogs( SET_IDS );
|
|
|
|
}
|
2007-01-18 13:18:59 +00:00
|
|
|
void disableResourceForAllLibraryDialogs( void )
|
2007-01-02 14:52:27 +00:00
|
|
|
{
|
|
|
|
implEnableDisableResourceForAllLibraryDialogs( RESET_IDS );
|
|
|
|
}
|
|
|
|
void implEnableDisableResourceForAllLibraryDialogs( HandleResourceMode eMode );
|
|
|
|
|
|
|
|
public:
|
2012-10-26 23:35:24 -02:00
|
|
|
LocalizationMgr(Shell*, ScriptDocument const&, OUString const& aLibName,
|
2007-01-02 14:52:27 +00:00
|
|
|
const ::com::sun::star::uno::Reference
|
|
|
|
< ::com::sun::star::resource::XStringResourceManager >& xStringResourceManager );
|
|
|
|
::com::sun::star::uno::Reference
|
|
|
|
< ::com::sun::star::resource::XStringResourceManager >getStringResourceManager( void )
|
|
|
|
{
|
|
|
|
return m_xStringResourceManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isLibraryLocalized( void );
|
|
|
|
|
|
|
|
void handleTranslationbar( void );
|
|
|
|
|
|
|
|
void handleAddLocales( ::com::sun::star::uno::Sequence
|
|
|
|
< ::com::sun::star::lang::Locale > aLocaleSeq );
|
|
|
|
|
|
|
|
void handleRemoveLocales( ::com::sun::star::uno::Sequence
|
|
|
|
< ::com::sun::star::lang::Locale > aLocaleSeq );
|
|
|
|
|
|
|
|
void handleSetDefaultLocale( ::com::sun::star::lang::Locale aLocale );
|
|
|
|
|
|
|
|
void handleSetCurrentLocale( ::com::sun::star::lang::Locale aLocale );
|
|
|
|
|
|
|
|
void handleBasicStarted( void );
|
|
|
|
|
|
|
|
void handleBasicStopped( void );
|
|
|
|
|
|
|
|
static void setControlResourceIDsForNewEditorObject( DlgEditor* pEditor,
|
2012-10-26 23:35:24 -02:00
|
|
|
::com::sun::star::uno::Any aControlAny, const OUString& aCtrlName );
|
2007-01-02 14:52:27 +00:00
|
|
|
|
2007-01-29 15:53:04 +00:00
|
|
|
static void renameControlResourceIDsForEditorObject( DlgEditor* pEditor,
|
2012-10-26 23:35:24 -02:00
|
|
|
::com::sun::star::uno::Any aControlAny, const OUString& aNewCtrlName );
|
2007-01-29 15:53:04 +00:00
|
|
|
|
2007-01-02 14:52:27 +00:00
|
|
|
static void deleteControlResourceIDsForDeletedEditorObject( DlgEditor* pEditor,
|
2012-10-26 23:35:24 -02:00
|
|
|
::com::sun::star::uno::Any aControlAny, const OUString& aCtrlName );
|
2007-01-02 14:52:27 +00:00
|
|
|
|
2012-10-26 23:35:24 -02:00
|
|
|
static void setStringResourceAtDialog( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
|
2007-01-02 14:52:27 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xDialogModel );
|
|
|
|
|
2012-10-26 23:35:24 -02:00
|
|
|
static void renameStringResourceIDs( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
|
2007-01-29 15:53:04 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xDialogModel );
|
|
|
|
|
2012-10-26 23:35:24 -02:00
|
|
|
static void removeResourceForDialog( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
|
2007-01-02 14:52:27 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xDialogModel );
|
|
|
|
|
|
|
|
static ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager >
|
|
|
|
getStringResourceFromDialogLibrary( ::com::sun::star::uno::Reference
|
|
|
|
< ::com::sun::star::container::XNameContainer > xDialogLib );
|
2007-01-29 15:53:04 +00:00
|
|
|
|
2007-08-03 09:00:15 +00:00
|
|
|
// Clipboard / Drag & Drop
|
2007-02-01 07:25:03 +00:00
|
|
|
static void resetResourceForDialog(
|
2007-01-29 15:53:04 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xDialogModel,
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > xStringResourceManager );
|
|
|
|
|
2007-08-03 09:00:15 +00:00
|
|
|
static void setResourceIDsForDialog(
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xDialogModel,
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > xStringResourceManager );
|
|
|
|
|
|
|
|
static void copyResourcesForPastedEditorObject( DlgEditor* pEditor,
|
2012-10-26 23:35:24 -02:00
|
|
|
::com::sun::star::uno::Any aControlAny, const OUString& aCtrlName,
|
2007-01-29 15:53:04 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::
|
|
|
|
XStringResourceResolver > xSourceStringResolver );
|
2007-06-26 15:53:22 +00:00
|
|
|
|
2007-08-03 09:00:15 +00:00
|
|
|
static void copyResourceForDroppedDialog(
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xDialogModel,
|
2012-10-26 23:35:24 -02:00
|
|
|
const OUString& aDialogName,
|
2007-08-03 09:00:15 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > xStringResourceManager,
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > xSourceStringResolver );
|
|
|
|
|
2007-06-26 15:53:22 +00:00
|
|
|
static void copyResourceForDialog(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xDialogModel,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::resource::
|
|
|
|
XStringResourceResolver >& xSourceStringResolver,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::resource::
|
|
|
|
XStringResourceManager >& xTargetStringResourceManager );
|
2007-01-02 14:52:27 +00:00
|
|
|
};
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
} // namespace basctl
|
|
|
|
|
|
|
|
#endif // BASCTL_LOCALIZATIONMGR_HXX
|
2010-10-27 12:45:03 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|