svx: maLocalListner -> maLocalListener
[LibreOffice.git] / include / framework / addonsoptions.hxx
blobf421da6d43e80458d0befd5ec4e591c90e6b4796
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 .
19 #ifndef INCLUDED_FRAMEWORK_ADDONSOPTIONS_HXX
20 #define INCLUDED_FRAMEWORK_ADDONSOPTIONS_HXX
22 #include <config_options.h>
23 #include <sal/types.h>
24 #include <vcl/bitmapex.hxx>
25 #include <com/sun/star/beans/PropertyValue.hpp>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <framework/fwkdllapi.h>
28 #include <memory>
30 namespace osl { class Mutex; }
32 /*-************************************************************************************************************
33 @descr The method GetAddonsMenu() returns a list of property values.
34 Use follow defines to separate values by names.
35 *//*-*************************************************************************************************************/
36 inline constexpr OUString ADDONSMENUITEM_STRING_URL = u"URL"_ustr;
37 inline constexpr OUString ADDONSMENUITEM_STRING_TITLE = u"Title"_ustr;
38 inline constexpr OUString ADDONSMENUITEM_STRING_TARGET = u"Target"_ustr;
39 inline constexpr OUString ADDONSMENUITEM_STRING_IMAGEIDENTIFIER = u"ImageIdentifier"_ustr;
40 inline constexpr OUString ADDONSMENUITEM_STRING_CONTEXT = u"Context"_ustr;
41 inline constexpr OUString ADDONSMENUITEM_STRING_SUBMENU = u"Submenu"_ustr;
43 inline constexpr OUString ADDONSPOPUPMENU_URL_PREFIX_STR = u"private:menu/Addon"_ustr;
45 namespace framework
48 struct FWK_DLLPUBLIC MergeMenuInstruction
50 OUString aMergePoint;
51 OUString aMergeCommand;
52 OUString aMergeCommandParameter;
53 OUString aMergeFallback;
54 OUString aMergeContext;
55 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeMenu;
57 typedef ::std::vector< MergeMenuInstruction > MergeMenuInstructionContainer;
59 struct FWK_DLLPUBLIC MergeToolbarInstruction
61 OUString aMergeToolbar;
62 OUString aMergePoint;
63 OUString aMergeCommand;
64 OUString aMergeCommandParameter;
65 OUString aMergeFallback;
66 OUString aMergeContext;
67 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeToolbarItems;
70 typedef ::std::vector< MergeToolbarInstruction > MergeToolbarInstructionContainer;
72 struct FWK_DLLPUBLIC MergeNotebookBarInstruction
74 OUString aMergeNotebookBar;
75 OUString aMergePoint;
76 OUString aMergeCommand;
77 OUString aMergeCommandParameter;
78 OUString aMergeFallback;
79 OUString aMergeContext;
80 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeNotebookBarItems;
83 typedef ::std::vector< MergeNotebookBarInstruction > MergeNotebookBarInstructionContainer;
85 struct FWK_DLLPUBLIC MergeStatusbarInstruction
87 OUString aMergePoint;
88 OUString aMergeCommand;
89 OUString aMergeCommandParameter;
90 OUString aMergeContext;
91 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeStatusbarItems;
94 typedef ::std::vector< MergeStatusbarInstruction > MergeStatusbarInstructionContainer;
96 /*-************************************************************************************************************
97 @short forward declaration to our private date container implementation
98 @descr We use these class as internal member to support small memory requirements.
99 You can create the container if it is necessary. The class which use these mechanism
100 is faster and smaller then a complete implementation!
101 *//*-*************************************************************************************************************/
103 class AddonsOptions_Impl;
105 /*-************************************************************************************************************
106 @short collect information about menu features
107 @devstatus ready to use
108 *//*-*************************************************************************************************************/
110 class UNLESS_MERGELIBS(FWK_DLLPUBLIC) AddonsOptions
112 public:
113 AddonsOptions();
114 ~AddonsOptions();
116 /*-****************************************************************************************************
117 @short returns if an addons menu is available
118 @descr Call to retrieve if an addons menu is available
120 @return true if there is a menu otherwise false
121 *//*-*****************************************************************************************************/
123 bool HasAddonsMenu() const;
125 /*-****************************************************************************************************
126 @short returns number of addons toolbars
127 @descr Call to retrieve the number of addons toolbars
129 @return number of addons toolbars
130 *//*-*****************************************************************************************************/
131 sal_Int32 GetAddonsToolBarCount() const ;
133 /*-****************************************************************************************************
134 @short returns number of addons notebookbar
135 @descr Call to retrieve the number of addons notebookbar
137 @return number of addons notebookar
138 *//*-*****************************************************************************************************/
139 sal_Int32 GetAddonsNotebookBarCount() const ;
141 /*-****************************************************************************************************
142 @short returns the complete addons menu
143 @descr Call it to get all entries of the addon menu.
144 We return a list of all nodes with its names and properties.
145 @return A list of menu items is returned.
147 @onerror We return an empty list.
148 *//*-*****************************************************************************************************/
150 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsMenu() const;
152 /*-****************************************************************************************************
153 @short Gets the menu bar part of all addon components registered
154 @return A complete
156 @onerror We return sal_False
157 *//*-*****************************************************************************************************/
159 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsMenuBarPart() const;
161 /*-****************************************************************************************************
162 @short Gets a toolbar part of a single addon
163 @return A complete
165 @onerror We return sal_False
166 *//*-*****************************************************************************************************/
168 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsToolBarPart( sal_uInt32 nIndex ) const;
170 /*-****************************************************************************************************
171 @short Gets a unique toolbar resource name of a single addon
172 @return A complete
174 @onerror We return sal_False
175 *//*-*****************************************************************************************************/
177 OUString GetAddonsToolbarResourceName( sal_uInt32 nIndex ) const;
179 /*-****************************************************************************************************
180 @short Gets a NotebookBar part of a single addon
181 @return A complete
183 @onerror We return sal_False
184 *//*-*****************************************************************************************************/
186 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsNotebookBarPart( sal_uInt32 nIndex ) const;
188 /*-****************************************************************************************************
189 @short Gets a unique NotebookBar resource name of a single addon
190 @return A complete
192 @onerror We return sal_False
193 *//*-*****************************************************************************************************/
195 OUString GetAddonsNotebookBarResourceName( sal_uInt32 ) const;
197 /*-****************************************************************************************************
198 @short Retrieves all available merge instructions for the Office menu bar
199 @return The filled MergeMenuDefinitionContainer
201 @onerror We return sal_False
202 *//*-*****************************************************************************************************/
204 const MergeMenuInstructionContainer& GetMergeMenuInstructions() const;
206 /*-****************************************************************************************************
207 @short Retrieves all available merge instructions for a single toolbar
208 @return The filled
210 @onerror We return sal_False
211 *//*-*****************************************************************************************************/
212 bool GetMergeToolbarInstructions( const OUString& rToolbarName, MergeToolbarInstructionContainer& rToolbar ) const;
214 /*-****************************************************************************************************
215 @short Retrieves all available merge instructions for Notebookbar
216 @return The filled
218 @onerror We return sal_False
219 *//*-*****************************************************************************************************/
220 bool GetMergeNotebookBarInstructions( const OUString& rNotebookBarName, MergeNotebookBarInstructionContainer& rNotebookBar ) const;
222 /*-****************************************************************************************************
223 @short Gets the Add-On help menu part of all addon components registered
224 @return A complete
226 @onerror We return sal_False
227 *//*-*****************************************************************************************************/
228 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsHelpMenu() const;
230 const MergeStatusbarInstructionContainer& GetMergeStatusbarInstructions() const;
232 /*-****************************************************************************************************
233 @short Retrieve an image for a command URL which is defined inside the addon menu configuration
234 @descr Call it to retrieve an image for a command URL which is defined inside the addon menu configuration
235 @return An image which was defined in the configuration for the menu item. The image can be empty
236 no bitmap was defined for the request image properties.
238 @onerror An empty image
239 *//*-*****************************************************************************************************/
241 BitmapEx GetImageFromURL( const OUString& aURL, bool bBig, bool bNoScale ) const;
242 BitmapEx GetImageFromURL( const OUString& aURL, bool bBig ) const;
244 // private methods
246 /*-****************************************************************************************************
247 @short return a reference to a static mutex
248 @descr These class is partially threadsafe (for de-/initialization only).
249 All access methods aren't safe!
250 We create a static mutex only for one ime and use at different times.
251 @return A reference to a static mutex member.
252 *//*-*****************************************************************************************************/
254 static ::osl::Mutex& GetOwnStaticMutex();
256 private:
257 std::shared_ptr<AddonsOptions_Impl> m_pImpl;
262 #endif // INCLUDED_FRAMEWORK_ADDONSOPTIONS_HXX
264 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */