summaryrefslogtreecommitdiff
path: root/framework/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-07 15:48:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-08 07:41:31 +0100
commit0d43023ed4bc14207b9ba15367b123f2af739d1b (patch)
tree8f0e98a84a90557bd19b3fa9feef531192daa62d /framework/inc
parentc16969b9bc73fdd77e763299d6aea7b614e203e2 (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/inc')
-rw-r--r--framework/inc/addonmenu.hxx83
-rw-r--r--framework/inc/menuconfiguration.hxx107
-rw-r--r--framework/inc/statusbarconfiguration.hxx49
-rw-r--r--framework/inc/toolboxconfiguration.hxx49
-rw-r--r--framework/inc/xml/statusbardocumenthandler.hxx2
-rw-r--r--framework/inc/xml/toolboxdocumenthandler.hxx2
6 files changed, 290 insertions, 2 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>