diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-07 15:48:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-08 07:41:31 +0100 |
commit | 0d43023ed4bc14207b9ba15367b123f2af739d1b (patch) | |
tree | 8f0e98a84a90557bd19b3fa9feef531192daa62d /framework | |
parent | c16969b9bc73fdd77e763299d6aea7b614e203e2 (diff) |
move some headers inside framework
Change-Id: Ia005938c6a3a954eba910981dde5010a1f977fca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88201
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/addonmenu.hxx | 83 | ||||
-rw-r--r-- | framework/inc/menuconfiguration.hxx | 107 | ||||
-rw-r--r-- | framework/inc/statusbarconfiguration.hxx | 49 | ||||
-rw-r--r-- | framework/inc/toolboxconfiguration.hxx | 49 | ||||
-rw-r--r-- | framework/inc/xml/statusbardocumenthandler.hxx | 2 | ||||
-rw-r--r-- | framework/inc/xml/toolboxdocumenthandler.hxx | 2 | ||||
-rw-r--r-- | framework/source/fwe/classes/addonmenu.cxx | 4 | ||||
-rw-r--r-- | framework/source/fwe/helper/configimporter.cxx | 2 | ||||
-rw-r--r-- | framework/source/fwe/xml/menuconfiguration.cxx | 4 | ||||
-rw-r--r-- | framework/source/fwe/xml/statusbarconfiguration.cxx | 2 | ||||
-rw-r--r-- | framework/source/fwe/xml/toolboxconfiguration.cxx | 2 | ||||
-rw-r--r-- | framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 6 | ||||
-rw-r--r-- | framework/source/uiconfiguration/uiconfigurationmanager.cxx | 6 | ||||
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 4 | ||||
-rw-r--r-- | framework/source/uielement/newmenucontroller.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/popuptoolbarcontroller.cxx | 2 |
16 files changed, 307 insertions, 19 deletions
diff --git a/framework/inc/addonmenu.hxx b/framework/inc/addonmenu.hxx new file mode 100644 index 000000000000..45d8d0948c89 --- /dev/null +++ b/framework/inc/addonmenu.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#pragma once + +#include <rtl/ustring.hxx> +#include <vcl/vclptr.hxx> + +#include <framework/fwedllapi.h> + +namespace com::sun::star::beans { struct PropertyValue; } +namespace com::sun::star::frame { class XFrame; } +namespace com::sun::star::uno { template <class E> class Sequence; } +namespace com::sun::star::uno { template <typename > class Reference; } + +class MenuBar; +class PopupMenu; + +#define ADDONMENU_ITEMID_START 2000 +#define ADDONMENU_ITEMID_END 3000 + +namespace framework +{ + +class FWE_DLLPUBLIC AddonMenuManager +{ + public: + static bool HasAddonMenuElements(); + + // Check if the context string matches the provided xModel context + static bool IsCorrectContext(const OUString& rModuleIdentifier, const OUString& rContext); + + // Create the Add-Ons menu + static VclPtr<PopupMenu> CreateAddonMenu( const css::uno::Reference< css::frame::XFrame >& rFrame ); + + // Merge the Add-Ons help menu items into the given menu bar at a defined pos + static void MergeAddonHelpMenu( const css::uno::Reference< css::frame::XFrame >& rFrame, + MenuBar const * pMergeMenuBar ); + + // Merge the addon popup menus into the given menu bar at the provided pos. + static void MergeAddonPopupMenus( const css::uno::Reference< css::frame::XFrame >& rFrame, + sal_uInt16 nMergeAtPos, + MenuBar* pMergeMenuBar ); + + // Returns the next position to insert a menu item/sub menu + static sal_uInt16 GetNextPos( sal_uInt16 nPos ); + + // Build up the menu item and sub menu into the provided pCurrentMenu. The sub menus should be of type nSubMenuType. + static void BuildMenu( PopupMenu* pCurrentMenu, + sal_uInt16 nInsPos, + sal_uInt16& nUniqueMenuId, + const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& aAddonMenuDefinition, + const css::uno::Reference< css::frame::XFrame >& rFrame, + const OUString& rModuleIdentifier ); + + // Retrieve the menu entry property values from a sequence + static void GetMenuEntry( const css::uno::Sequence< css::beans::PropertyValue >& rAddonMenuEntry, + OUString& rTitle, + OUString& rURL, + OUString& rTarget, + OUString& rImageId, + OUString& rContext, + css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rAddonSubMenu ); +}; + +} // namespace framework + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/menuconfiguration.hxx b/framework/inc/menuconfiguration.hxx new file mode 100644 index 000000000000..312608a7ecc9 --- /dev/null +++ b/framework/inc/menuconfiguration.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <framework/fwedllapi.h> + +#include <cppuhelper/weakref.hxx> + +namespace com::sun::star::container { class XIndexAccess; } +namespace com::sun::star::frame { class XDispatchProvider; } +namespace com::sun::star::io { class XInputStream; } +namespace com::sun::star::io { class XOutputStream; } +namespace com::sun::star::uno { class XComponentContext; } + +const sal_uInt16 START_ITEMID_WINDOWLIST = 4600; +const sal_uInt16 END_ITEMID_WINDOWLIST = 4699; +const sal_uInt16 ITEMID_ADDONLIST = 6678; // used to be a SID in sfx2, now just a unique id... + +namespace framework +{ + +struct FWE_DLLPUBLIC MenuAttributes +{ +private: + oslInterlockedCount refCount; + + MenuAttributes(const OUString& rFrame, const OUString& rImageIdStr) + : refCount(0) + , aTargetFrame(rFrame) + , aImageId(rImageIdStr) + { + } + + MenuAttributes(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider) + : refCount(0) + , xDispatchProvider(rDispatchProvider) + { + } + + MenuAttributes(const MenuAttributes&) = delete; + +public: + OUString aTargetFrame; + OUString aImageId; + css::uno::WeakReference<css::frame::XDispatchProvider> xDispatchProvider; + + static void* CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr); + static void* CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider); + static void ReleaseAttribute(void* nAttributePtr); + + void acquire() + { + osl_atomic_increment(&refCount); + } + + void release() + { + if (!osl_atomic_decrement(&refCount)) + delete this; + } +}; + +class FWE_DLLPUBLIC MenuConfiguration final +{ +public: + MenuConfiguration( + // use const when giving a UNO reference by reference + const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + + ~MenuConfiguration(); + + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + css::uno::Reference< css::container::XIndexAccess > CreateMenuBarConfigurationFromXML( + css::uno::Reference< css::io::XInputStream > const & rInputStream ); + + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + void StoreMenuBarConfigurationToXML( + css::uno::Reference< css::container::XIndexAccess > const & rMenuBarConfiguration, + css::uno::Reference< css::io::XOutputStream > const & rOutputStream, + bool bIsMenuBar ); + +private: + css::uno::Reference< css::uno::XComponentContext> m_xContext; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/statusbarconfiguration.hxx b/framework/inc/statusbarconfiguration.hxx new file mode 100644 index 000000000000..b4d8ceecfc4c --- /dev/null +++ b/framework/inc/statusbarconfiguration.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#pragma once + +#include <framework/fwedllapi.h> + +namespace com::sun::star::container { class XIndexAccess; } +namespace com::sun::star::container { class XIndexContainer; } +namespace com::sun::star::io { class XInputStream; } +namespace com::sun::star::io { class XOutputStream; } +namespace com::sun::star::uno { class XComponentContext; } +namespace com::sun::star::uno { template <typename > class Reference; } + +namespace framework +{ + +class FWE_DLLPUBLIC StatusBarConfiguration +{ + public: + static bool LoadStatusBar( + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::io::XInputStream >& xInputStream, + const css::uno::Reference< css::container::XIndexContainer >& rStatusbarConfiguration ); + + static bool StoreStatusBar( + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::io::XOutputStream >& xOutputStream, + const css::uno::Reference< css::container::XIndexAccess >& rStatusbarConfiguration ); +}; + +} // namespace framework + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/toolboxconfiguration.hxx b/framework/inc/toolboxconfiguration.hxx new file mode 100644 index 000000000000..a0a04ccaceba --- /dev/null +++ b/framework/inc/toolboxconfiguration.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#pragma once + +#include <framework/fwedllapi.h> + +namespace com::sun::star::container { class XIndexAccess; } +namespace com::sun::star::container { class XIndexContainer; } +namespace com::sun::star::io { class XInputStream; } +namespace com::sun::star::io { class XOutputStream; } +namespace com::sun::star::uno { class XComponentContext; } +namespace com::sun::star::uno { template <typename > class Reference; } + +namespace framework +{ + +class FWE_DLLPUBLIC ToolBoxConfiguration +{ + public: + static bool LoadToolBox( + const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::io::XInputStream >& rInputStream, + const css::uno::Reference< css::container::XIndexContainer >& rToolbarConfiguration ); + + static bool StoreToolBox( + const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::io::XOutputStream >& rOutputStream, + const css::uno::Reference< css::container::XIndexAccess >& rToolbarConfiguration ); +}; + +} // namespace framework + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/xml/statusbardocumenthandler.hxx b/framework/inc/xml/statusbardocumenthandler.hxx index a5cd90c68c0f..9dea5b1452fc 100644 --- a/framework/inc/xml/statusbardocumenthandler.hxx +++ b/framework/inc/xml/statusbardocumenthandler.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_FRAMEWORK_INC_XML_STATUSBARDOCUMENTHANDLER_HXX #define INCLUDED_FRAMEWORK_INC_XML_STATUSBARDOCUMENTHANDLER_HXX -#include <framework/statusbarconfiguration.hxx> +#include <statusbarconfiguration.hxx> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx index dccdac7bce47..db9184605a38 100644 --- a/framework/inc/xml/toolboxdocumenthandler.hxx +++ b/framework/inc/xml/toolboxdocumenthandler.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_FRAMEWORK_INC_XML_TOOLBOXDOCUMENTHANDLER_HXX #define INCLUDED_FRAMEWORK_INC_XML_TOOLBOXDOCUMENTHANDLER_HXX -#include <framework/toolboxconfiguration.hxx> +#include <toolboxconfiguration.hxx> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx index 859fac65efc9..6c7f5bcd627a 100644 --- a/framework/source/fwe/classes/addonmenu.cxx +++ b/framework/source/fwe/classes/addonmenu.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <framework/addonmenu.hxx> +#include <addonmenu.hxx> #include <framework/addonsoptions.hxx> -#include <framework/menuconfiguration.hxx> +#include <menuconfiguration.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Sequence.hxx> diff --git a/framework/source/fwe/helper/configimporter.cxx b/framework/source/fwe/helper/configimporter.cxx index f50d0d7eb765..bc92d180b9ac 100644 --- a/framework/source/fwe/helper/configimporter.cxx +++ b/framework/source/fwe/helper/configimporter.cxx @@ -18,7 +18,7 @@ */ #include <framework/configimporter.hxx> -#include <framework/toolboxconfiguration.hxx> +#include <toolboxconfiguration.hxx> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/ui/XUIConfigurationManager2.hpp> diff --git a/framework/source/fwe/xml/menuconfiguration.cxx b/framework/source/fwe/xml/menuconfiguration.cxx index 5cbd3fc06b68..e5a548640a58 100644 --- a/framework/source/fwe/xml/menuconfiguration.cxx +++ b/framework/source/fwe/xml/menuconfiguration.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <framework/menuconfiguration.hxx> +#include <menuconfiguration.hxx> -#include <framework/addonmenu.hxx> +#include <addonmenu.hxx> #include <xml/menudocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> diff --git a/framework/source/fwe/xml/statusbarconfiguration.cxx b/framework/source/fwe/xml/statusbarconfiguration.cxx index 27db9ea27a2e..ce974237b286 100644 --- a/framework/source/fwe/xml/statusbarconfiguration.cxx +++ b/framework/source/fwe/xml/statusbarconfiguration.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <framework/statusbarconfiguration.hxx> +#include <statusbarconfiguration.hxx> #include <xml/statusbardocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> diff --git a/framework/source/fwe/xml/toolboxconfiguration.cxx b/framework/source/fwe/xml/toolboxconfiguration.cxx index bc04e9c4a23b..7eb068357ddc 100644 --- a/framework/source/fwe/xml/toolboxconfiguration.cxx +++ b/framework/source/fwe/xml/toolboxconfiguration.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <framework/toolboxconfiguration.hxx> +#include <toolboxconfiguration.hxx> #include <xml/toolboxdocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 22fce3235fd1..b166fc79a47e 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -22,10 +22,10 @@ #include <uielement/constitemcontainer.hxx> #include <uielement/rootitemcontainer.hxx> #include <uielement/uielementtypenames.hxx> -#include <framework/menuconfiguration.hxx> -#include <framework/toolboxconfiguration.hxx> +#include <menuconfiguration.hxx> +#include <toolboxconfiguration.hxx> -#include <framework/statusbarconfiguration.hxx> +#include <statusbarconfiguration.hxx> #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/ui/ConfigurationEvent.hpp> diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index 0b809363316a..cf5def97aa4a 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -21,9 +21,9 @@ #include <uielement/rootitemcontainer.hxx> #include <uielement/constitemcontainer.hxx> #include <uielement/uielementtypenames.hxx> -#include <framework/menuconfiguration.hxx> -#include <framework/statusbarconfiguration.hxx> -#include <framework/toolboxconfiguration.hxx> +#include <menuconfiguration.hxx> +#include <statusbarconfiguration.hxx> +#include <toolboxconfiguration.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/ElementExistException.hpp> diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index b1cc795ad112..e0fbfe16c4e3 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -19,8 +19,8 @@ #include <uielement/menubarmanager.hxx> #include <uielement/styletoolbarcontroller.hxx> -#include <framework/menuconfiguration.hxx> -#include <framework/addonmenu.hxx> +#include <menuconfiguration.hxx> +#include <addonmenu.hxx> #include <framework/addonsoptions.hxx> #include <classes/fwkresid.hxx> #include <strings.hrc> diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index 5387568e1304..5bb88b23842b 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -18,7 +18,7 @@ */ #include <uielement/newmenucontroller.hxx> -#include <framework/menuconfiguration.hxx> +#include <menuconfiguration.hxx> #include <services.h> diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index f5b6d5f31695..9520ae8fc5d7 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -22,7 +22,7 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/propertyvalue.hxx> -#include <framework/menuconfiguration.hxx> +#include <menuconfiguration.hxx> #include <svtools/imagemgr.hxx> #include <svtools/miscopt.hxx> #include <svtools/toolboxcontroller.hxx> |