LibreOffice Module basctl (master) 1
localizationmgr.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sal/config.h>
23
24#include <string_view>
25
26#include "scriptdocument.hxx"
27
28#include <com/sun/star/resource/XStringResourceManager.hpp>
29
30namespace basctl
31{
32
33class Shell;
34class DlgEditor;
35
37{
38 css::uno::Reference< css::resource::XStringResourceManager > m_xStringResourceManager;
39
41
43 OUString m_aLibName;
44
45 css::lang::Locale m_aLocaleBeforeBasicStart;
46
48 {
56 };
57 static sal_Int32 implHandleControlResourceProperties(const css::uno::Any& rControlAny,
58 std::u16string_view aDialogName,
59 std::u16string_view aCtrlName,
60 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager,
61 const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver,
62 HandleResourceMode eMode );
63
65 {
67 }
69 {
71 }
73
74public:
75 LocalizationMgr(Shell*, ScriptDocument , OUString aLibName,
76 const css::uno::Reference < css::resource::XStringResourceManager >& xStringResourceManager );
77
78 const css::uno::Reference< css::resource::XStringResourceManager >& getStringResourceManager() const
79 {
81 }
82
83 bool isLibraryLocalized();
84
86
87 void handleAddLocales( const css::uno::Sequence
88 < css::lang::Locale >& aLocaleSeq );
89
90 void handleRemoveLocales( const css::uno::Sequence
91 < css::lang::Locale >& aLocaleSeq );
92
93 void handleSetDefaultLocale(const css::lang::Locale& rLocale);
94
95 void handleSetCurrentLocale(const css::lang::Locale& rLocale);
96
97 void handleBasicStarted();
98
99 void handleBasicStopped();
100
101 static void setControlResourceIDsForNewEditorObject(DlgEditor const * pEditor,
102 const css::uno::Any& rControlAny, std::u16string_view aCtrlName);
103
104 static void renameControlResourceIDsForEditorObject(DlgEditor const * pEditor,
105 const css::uno::Any& rControlAny, std::u16string_view aNewCtrlName);
106
108 const css::uno::Any& rControlAny, std::u16string_view aCtrlName);
109
110 static void setStringResourceAtDialog( const ScriptDocument& rDocument, const OUString& aLibName, std::u16string_view aDlgName,
111 const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
112
113 static void renameStringResourceIDs( const ScriptDocument& rDocument, const OUString& aLibName, std::u16string_view aDlgName,
114 const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
115
116 static void removeResourceForDialog( const ScriptDocument& rDocument, const OUString& aLibName, std::u16string_view aDlgName,
117 const css::uno::Reference< css::container::XNameContainer >& xDialogModel );
118
119 static css::uno::Reference< css::resource::XStringResourceManager >
120 getStringResourceFromDialogLibrary( const css::uno::Reference< css::container::XNameContainer >& xDialogLib );
121
122 // Clipboard / Drag & Drop
123 static void resetResourceForDialog(
124 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
125 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager );
126
127 static void setResourceIDsForDialog(
128 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
129 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager );
130
131 static void copyResourcesForPastedEditorObject( DlgEditor const * pEditor,
132 const css::uno::Any& rControlAny, std::u16string_view aCtrlName,
133 const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver );
134
136 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
137 std::u16string_view aDialogName,
138 const css::uno::Reference< css::resource::XStringResourceManager >& xStringResourceManager,
139 const css::uno::Reference< css::resource::XStringResourceResolver >& xSourceStringResolver );
140
141 static void copyResourceForDialog(
142 const css::uno::Reference< css::container::XNameContainer >& xDialogModel,
143 const css::uno::Reference< css::resource::
144 XStringResourceResolver >& xSourceStringResolver,
145 const css::uno::Reference< css::resource::
146 XStringResourceManager >& xTargetStringResourceManager );
147};
148
149} // namespace basctl
150
151/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::lang::Locale m_aLocaleBeforeBasicStart
static css::uno::Reference< css::resource::XStringResourceManager > getStringResourceFromDialogLibrary(const css::uno::Reference< css::container::XNameContainer > &xDialogLib)
static void resetResourceForDialog(const css::uno::Reference< css::container::XNameContainer > &xDialogModel, const css::uno::Reference< css::resource::XStringResourceManager > &xStringResourceManager)
void handleSetCurrentLocale(const css::lang::Locale &rLocale)
static void setControlResourceIDsForNewEditorObject(DlgEditor const *pEditor, const css::uno::Any &rControlAny, std::u16string_view aCtrlName)
const css::uno::Reference< css::resource::XStringResourceManager > & getStringResourceManager() const
void handleRemoveLocales(const css::uno::Sequence< css::lang::Locale > &aLocaleSeq)
static sal_Int32 implHandleControlResourceProperties(const css::uno::Any &rControlAny, std::u16string_view aDialogName, std::u16string_view aCtrlName, const css::uno::Reference< css::resource::XStringResourceManager > &xStringResourceManager, const css::uno::Reference< css::resource::XStringResourceResolver > &xSourceStringResolver, HandleResourceMode eMode)
void handleAddLocales(const css::uno::Sequence< css::lang::Locale > &aLocaleSeq)
void implEnableDisableResourceForAllLibraryDialogs(HandleResourceMode eMode)
static void removeResourceForDialog(const ScriptDocument &rDocument, const OUString &aLibName, std::u16string_view aDlgName, const css::uno::Reference< css::container::XNameContainer > &xDialogModel)
css::uno::Reference< css::resource::XStringResourceManager > m_xStringResourceManager
static void deleteControlResourceIDsForDeletedEditorObject(DlgEditor const *pEditor, const css::uno::Any &rControlAny, std::u16string_view aCtrlName)
static void copyResourcesForPastedEditorObject(DlgEditor const *pEditor, const css::uno::Any &rControlAny, std::u16string_view aCtrlName, const css::uno::Reference< css::resource::XStringResourceResolver > &xSourceStringResolver)
static void renameControlResourceIDsForEditorObject(DlgEditor const *pEditor, const css::uno::Any &rControlAny, std::u16string_view aNewCtrlName)
static void setResourceIDsForDialog(const css::uno::Reference< css::container::XNameContainer > &xDialogModel, const css::uno::Reference< css::resource::XStringResourceManager > &xStringResourceManager)
static void copyResourceForDroppedDialog(const css::uno::Reference< css::container::XNameContainer > &xDialogModel, std::u16string_view aDialogName, const css::uno::Reference< css::resource::XStringResourceManager > &xStringResourceManager, const css::uno::Reference< css::resource::XStringResourceResolver > &xSourceStringResolver)
LocalizationMgr(Shell *, ScriptDocument, OUString aLibName, const css::uno::Reference< css::resource::XStringResourceManager > &xStringResourceManager)
static void setStringResourceAtDialog(const ScriptDocument &rDocument, const OUString &aLibName, std::u16string_view aDlgName, const css::uno::Reference< css::container::XNameContainer > &xDialogModel)
void handleSetDefaultLocale(const css::lang::Locale &rLocale)
static void copyResourceForDialog(const css::uno::Reference< css::container::XNameContainer > &xDialogModel, const css::uno::Reference< css::resource::XStringResourceResolver > &xSourceStringResolver, const css::uno::Reference< css::resource::XStringResourceManager > &xTargetStringResourceManager)
static void renameStringResourceIDs(const ScriptDocument &rDocument, const OUString &aLibName, std::u16string_view aDlgName, const css::uno::Reference< css::container::XNameContainer > &xDialogModel)
encapsulates a document which contains Basic scripts and dialogs
Shell