lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / framework / addonsoptions.hxx
blob1f4c728d16566e7c7090b7eb531478df55cb50d9
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 <sal/types.h>
23 #include <vcl/image.hxx>
24 #include <com/sun/star/beans/PropertyValue.hpp>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <framework/fwedllapi.h>
27 #include <memory>
29 namespace osl { class Mutex; }
31 /*-************************************************************************************************************
32 @descr The method GetAddonsMenu() returns a list of property values.
33 Use follow defines to separate values by names.
34 *//*-*************************************************************************************************************/
35 #define ADDONSMENUITEM_STRING_URL "URL"
36 #define ADDONSMENUITEM_STRING_TITLE "Title"
37 #define ADDONSMENUITEM_STRING_TARGET "Target"
38 #define ADDONSMENUITEM_STRING_IMAGEIDENTIFIER "ImageIdentifier"
39 #define ADDONSMENUITEM_STRING_CONTEXT "Context"
40 #define ADDONSMENUITEM_STRING_SUBMENU "Submenu"
42 #define ADDONSPOPUPMENU_URL_PREFIX_STR "private:menu/Addon"
44 namespace framework
47 struct FWE_DLLPUBLIC MergeMenuInstruction
49 OUString aMergePoint;
50 OUString aMergeCommand;
51 OUString aMergeCommandParameter;
52 OUString aMergeFallback;
53 OUString aMergeContext;
54 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeMenu;
56 typedef ::std::vector< MergeMenuInstruction > MergeMenuInstructionContainer;
58 struct FWE_DLLPUBLIC MergeToolbarInstruction
60 OUString aMergeToolbar;
61 OUString aMergePoint;
62 OUString aMergeCommand;
63 OUString aMergeCommandParameter;
64 OUString aMergeFallback;
65 OUString aMergeContext;
66 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeToolbarItems;
69 typedef ::std::vector< MergeToolbarInstruction > MergeToolbarInstructionContainer;
71 struct FWE_DLLPUBLIC MergeNotebookBarInstruction
73 OUString aMergeNotebookBar;
74 OUString aMergePoint;
75 OUString aMergeCommand;
76 OUString aMergeCommandParameter;
77 OUString aMergeFallback;
78 OUString aMergeContext;
79 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeNotebookBarItems;
82 typedef ::std::vector< MergeNotebookBarInstruction > MergeNotebookBarInstructionContainer;
84 struct FWE_DLLPUBLIC MergeStatusbarInstruction
86 OUString aMergePoint;
87 OUString aMergeCommand;
88 OUString aMergeCommandParameter;
89 OUString aMergeContext;
90 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aMergeStatusbarItems;
93 typedef ::std::vector< MergeStatusbarInstruction > MergeStatusbarInstructionContainer;
95 /*-************************************************************************************************************
96 @short forward declaration to our private date container implementation
97 @descr We use these class as internal member to support small memory requirements.
98 You can create the container if it is necessary. The class which use these mechanism
99 is faster and smaller then a complete implementation!
100 *//*-*************************************************************************************************************/
102 class AddonsOptions_Impl;
104 /*-************************************************************************************************************
105 @short collect information about menu features
106 @devstatus ready to use
107 *//*-*************************************************************************************************************/
109 class FWE_DLLPUBLIC AddonsOptions
111 public:
112 AddonsOptions();
113 ~AddonsOptions();
115 /*-****************************************************************************************************
116 @short returns if an addons menu is available
117 @descr Call to retrieve if an addons menu is available
119 @return true if there is a menu otherwise false
120 *//*-*****************************************************************************************************/
122 bool HasAddonsMenu() const;
124 /*-****************************************************************************************************
125 @short returns number of addons toolbars
126 @descr Call to retrieve the number of addons toolbars
128 @return number of addons toolbars
129 *//*-*****************************************************************************************************/
130 sal_Int32 GetAddonsToolBarCount() const ;
132 /*-****************************************************************************************************
133 @short returns number of addons notebookbar
134 @descr Call to retrieve the number of addons notebookbar
136 @return number of addons notebookar
137 *//*-*****************************************************************************************************/
138 sal_Int32 GetAddonsNotebookBarCount() const ;
140 /*-****************************************************************************************************
141 @short returns the complete addons menu
142 @descr Call it to get all entries of the addon menu.
143 We return a list of all nodes with its names and properties.
144 @return A list of menu items is returned.
146 @onerror We return an empty list.
147 *//*-*****************************************************************************************************/
149 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsMenu() const;
151 /*-****************************************************************************************************
152 @short Gets the menu bar part of all addon components registered
153 @return A complete
155 @onerror We return sal_False
156 *//*-*****************************************************************************************************/
158 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsMenuBarPart() const;
160 /*-****************************************************************************************************
161 @short Gets a toolbar part of a single addon
162 @return A complete
164 @onerror We return sal_False
165 *//*-*****************************************************************************************************/
167 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsToolBarPart( sal_uInt32 nIndex ) const;
169 /*-****************************************************************************************************
170 @short Gets a unique toolbar resource name of a single addon
171 @return A complete
173 @onerror We return sal_False
174 *//*-*****************************************************************************************************/
176 OUString GetAddonsToolbarResourceName( sal_uInt32 nIndex ) const;
178 /*-****************************************************************************************************
179 @short Gets a NotebookBar part of a single addon
180 @return A complete
182 @onerror We return sal_False
183 *//*-*****************************************************************************************************/
185 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsNotebookBarPart( sal_uInt32 nIndex ) const;
187 /*-****************************************************************************************************
188 @short Gets a unique NotebookBar resource name of a single addon
189 @return A complete
191 @onerror We return sal_False
192 *//*-*****************************************************************************************************/
194 OUString GetAddonsNotebookBarResourceName( sal_uInt32 ) const;
196 /*-****************************************************************************************************
197 @short Retrieves all available merge instructions for the Office menu bar
198 @return The filled MergeMenuDefinitionContaier
200 @onerror We return sal_False
201 *//*-*****************************************************************************************************/
203 const MergeMenuInstructionContainer& GetMergeMenuInstructions() const;
205 /*-****************************************************************************************************
206 @short Retrieves all available merge instructions for a single toolbar
207 @return The filled
209 @onerror We return sal_False
210 *//*-*****************************************************************************************************/
211 bool GetMergeToolbarInstructions( const OUString& rToolbarName, MergeToolbarInstructionContainer& rToolbar ) const;
213 /*-****************************************************************************************************
214 @short Retrieves all available merge instructions for Notebookbar
215 @return The filled
217 @onerror We return sal_False
218 *//*-*****************************************************************************************************/
219 bool GetMergeNotebookBarInstructions( const OUString& rNotebookBarName, MergeNotebookBarInstructionContainer& rNotebookBar ) const;
221 /*-****************************************************************************************************
222 @short Gets the Add-On help menu part of all addon components registered
223 @return A complete
225 @onerror We return sal_False
226 *//*-*****************************************************************************************************/
227 const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& GetAddonsHelpMenu() const;
229 const MergeStatusbarInstructionContainer& GetMergeStatusbarInstructions() const;
231 /*-****************************************************************************************************
232 @short Retrieve an image for a command URL which is defined inside the addon menu configuration
233 @descr Call it to retrieve an image for a command URL which is defined inside the addon menu configuration
234 @return An image which was defined in the configuration for the menu item. The image can be empty
235 no bitmap was defined for the request image properties.
237 @onerror An empty image
238 *//*-*****************************************************************************************************/
240 Image GetImageFromURL( const OUString& aURL, bool bBig, bool bNoScale ) const;
241 Image GetImageFromURL( const OUString& aURL, bool bBig ) const;
243 // private methods
245 /*-****************************************************************************************************
246 @short return a reference to a static mutex
247 @descr These class is partially threadsafe (for de-/initialization only).
248 All access methods aren't safe!
249 We create a static mutex only for one ime and use at different times.
250 @return A reference to a static mutex member.
251 *//*-*****************************************************************************************************/
253 static ::osl::Mutex& GetOwnStaticMutex();
255 private:
256 std::shared_ptr<AddonsOptions_Impl> m_pImpl;
261 #endif // INCLUDED_FRAMEWORK_ADDONSOPTIONS_HXX
263 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */