nss: upgrade to release 3.73
[LibreOffice.git] / basctl / source / inc / localizationmgr.hxx
blob4b72a7d8e58d1899dc66c3c70b3e73f810cfb281
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include "scriptdocument.hxx"
24 #include <com/sun/star/resource/XStringResourceManager.hpp>
26 namespace basctl
29 class Shell;
30 class DlgEditor;
32 class LocalizationMgr
34 css::uno::Reference< css::resource::XStringResourceManager > m_xStringResourceManager;
36 Shell* m_pShell;
38 ScriptDocument m_aDocument;
39 OUString m_aLibName;
41 css::lang::Locale m_aLocaleBeforeBasicStart;
43 enum HandleResourceMode
45 SET_IDS,
46 RESET_IDS,
47 RENAME_DIALOG_IDS,
48 RENAME_CONTROL_IDS,
49 REMOVE_IDS_FROM_RESOURCE,
50 MOVE_RESOURCES,
51 COPY_RESOURCES
53 static sal_Int32 implHandleControlResourceProperties(const css::uno::Any& rControlAny,
54 const OUString& aDialogName,
55 const OUString& aCtrlName,
56 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager,
57 const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver,
58 HandleResourceMode eMode );
60 void enableResourceForAllLibraryDialogs()
62 implEnableDisableResourceForAllLibraryDialogs( SET_IDS );
64 void disableResourceForAllLibraryDialogs()
66 implEnableDisableResourceForAllLibraryDialogs( RESET_IDS );
68 void implEnableDisableResourceForAllLibraryDialogs( HandleResourceMode eMode );
70 public:
71 LocalizationMgr(Shell*, ScriptDocument const&, OUString const& aLibName,
72 const css::uno::Reference < css::resource::XStringResourceManager >& xStringResourceManager );
74 const css::uno::Reference< css::resource::XStringResourceManager >& getStringResourceManager() const
76 return m_xStringResourceManager;
79 bool isLibraryLocalized();
81 void handleTranslationbar();
83 void handleAddLocales( const css::uno::Sequence
84 < css::lang::Locale >& aLocaleSeq );
86 void handleRemoveLocales( const css::uno::Sequence
87 < css::lang::Locale >& aLocaleSeq );
89 void handleSetDefaultLocale(const css::lang::Locale& rLocale);
91 void handleSetCurrentLocale(const css::lang::Locale& rLocale);
93 void handleBasicStarted();
95 void handleBasicStopped();
97 static void setControlResourceIDsForNewEditorObject(DlgEditor const * pEditor,
98 const css::uno::Any& rControlAny, const OUString& aCtrlName);
100 static void renameControlResourceIDsForEditorObject(DlgEditor const * pEditor,
101 const css::uno::Any& rControlAny, const OUString& aNewCtrlName);
103 static void deleteControlResourceIDsForDeletedEditorObject(DlgEditor const * pEditor,
104 const css::uno::Any& rControlAny, const OUString& aCtrlName);
106 static void setStringResourceAtDialog( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
107 const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
109 static void renameStringResourceIDs( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
110 const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
112 static void removeResourceForDialog( const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aDlgName,
113 const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
115 static css::uno::Reference< css::resource::XStringResourceManager >
116 getStringResourceFromDialogLibrary( const css::uno::Reference< css::container::XNameContainer >& xDialogLib );
118 // Clipboard / Drag & Drop
119 static void resetResourceForDialog(
120 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
121 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager );
123 static void setResourceIDsForDialog(
124 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
125 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager );
127 static void copyResourcesForPastedEditorObject( DlgEditor const * pEditor,
128 const css::uno::Any& rControlAny, const OUString& aCtrlName,
129 const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver );
131 static void copyResourceForDroppedDialog(
132 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
133 const OUString& aDialogName,
134 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager,
135 const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver );
137 static void copyResourceForDialog(
138 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
139 const css::uno::Reference< css::resource::
140 XStringResourceResolver >& xSourceStringResolver,
141 const css::uno::Reference< css::resource::
142 XStringResourceManager >& xTargetStringResourceManager );
145 } // namespace basctl
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */