1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include "scriptdocument.hxx"
24 #include <com/sun/star/resource/XStringResourceManager.hpp>
34 css::uno::Reference
< css::resource::XStringResourceManager
> m_xStringResourceManager
;
38 ScriptDocument m_aDocument
;
41 css::lang::Locale m_aLocaleBeforeBasicStart
;
43 enum HandleResourceMode
49 REMOVE_IDS_FROM_RESOURCE
,
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
);
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: */