/source/mni/forms/

long.cn/lo/core' title='lo/core Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Godard <lgodard.libre@laposte.net>2015-04-30 16:56:14 +0200
committerTomaž Vajngerl <quikee@gmail.com>2015-06-22 04:59:07 +0000
commita64999511ae654131d997eec9a3d78478cfc1c75 (patch)
treee2a06cde98747c7f8b1eb409f9c7b1918582c897
parentd16e154c627ecc0cb21aaf4b28f7f5ae48ebbde1 (diff)
new uno sidebar api tdf#91806
the entry point is SfxBaseController::getSidebar() the Decks and panels are now per SidebarController and not global anymore ' macro example Sub testSidebarApi controller = thisComponent.currentcontroller frameIni = thisComponent.currentcontroller.frame sidebar = thisComponent.currentcontroller.getSidebar() sidebar.setVisible(true) frame = sidebar.getFrame() decks = sidebar.getdecks() c = decks.count h = decks.hasElements() e = decks.getElementNames() a = decks.hasByName("MyDeck") deck = decks.getByName("MyDeck") deck.activate(true) t = deck.getTitle() deck.setTitle("new deck title") deck.moveFirst() deck.moveLast() deck.moveUp() deck.moveDown() index = deck.getOrderIndex() panels = deck.getPanels() ep = panels.getElementnames() ap = panels.hasByName("aPanelName") panel = panels.getByName("aPanelName") panel.setTitle("new panel title") panel.collapse() panel.expand(true) ' expand and collapse other index = panel.getOrderIndex() panel.moveLast() panel.moveFirst() panel.moveDown() panel.moveUp() End Sub Change-Id: I7a4b953f2277dea483bb296ba6ead35de7205ace Reviewed-on: https://gerrit.libreoffice.org/15856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx10
-rw-r--r--include/dbaccess/genericcontroller.hxx5
-rw-r--r--include/sfx2/sfxbasecontroller.hxx4
-rw-r--r--include/sfx2/sidebar/Accessible.hxx (renamed from sfx2/source/sidebar/Accessible.hxx)0
-rw-r--r--include/sfx2/sidebar/AccessibleTitleBar.hxx (renamed from sfx2/source/sidebar/AccessibleTitleBar.hxx)0
-rw-r--r--include/sfx2/sidebar/AsynchronousCall.hxx (renamed from sfx2/source/sidebar/AsynchronousCall.hxx)0
-rw-r--r--include/sfx2/sidebar/Context.hxx (renamed from sfx2/source/sidebar/Context.hxx)0
-rw-r--r--include/sfx2/sidebar/ContextList.hxx (renamed from sfx2/source/sidebar/ContextList.hxx)4
-rw-r--r--include/sfx2/sidebar/Deck.hxx (renamed from sfx2/source/sidebar/Deck.hxx)16
-rw-r--r--include/sfx2/sidebar/DeckDescriptor.hxx (renamed from sfx2/source/sidebar/DeckDescriptor.hxx)4
-rw-r--r--include/sfx2/sidebar/DeckLayouter.hxx (renamed from sfx2/source/sidebar/DeckLayouter.hxx)2
-rw-r--r--include/sfx2/sidebar/DeckTitleBar.hxx (renamed from sfx2/source/sidebar/DeckTitleBar.hxx)2
-rw-r--r--include/sfx2/sidebar/DrawHelper.hxx (renamed from sfx2/source/sidebar/DrawHelper.hxx)0
-rw-r--r--include/sfx2/sidebar/FocusManager.hxx (renamed from sfx2/source/sidebar/FocusManager.hxx)0
-rw-r--r--include/sfx2/sidebar/MenuButton.hxx (renamed from sfx2/source/sidebar/MenuButton.hxx)0
-rw-r--r--include/sfx2/sidebar/Paint.hxx (renamed from sfx2/source/sidebar/Paint.hxx)0
-rw-r--r--include/sfx2/sidebar/Panel.hxx (renamed from sfx2/source/sidebar/Panel.hxx)11
-rw-r--r--include/sfx2/sidebar/PanelDescriptor.hxx (renamed from sfx2/source/sidebar/PanelDescriptor.hxx)2
-rw-r--r--include/sfx2/sidebar/PanelTitleBar.hxx (renamed from sfx2/source/sidebar/PanelTitleBar.hxx)2
-rw-r--r--include/sfx2/sidebar/ResourceManager.hxx (renamed from sfx2/source/sidebar/ResourceManager.hxx)16
-rw-r--r--include/sfx2/sidebar/Sidebar.hrc (renamed from sfx2/source/sidebar/Sidebar.hrc)0
-rw-r--r--include/sfx2/sidebar/SidebarController.hxx (renamed from sfx2/source/sidebar/SidebarController.hxx)38
-rw-r--r--include/sfx2/sidebar/SidebarDockingWindow.hxx (renamed from sfx2/source/sidebar/SidebarDockingWindow.hxx)0
-rw-r--r--include/sfx2/sidebar/SidebarResource.hxx (renamed from sfx2/source/sidebar/SidebarResource.hxx)2
-rw-r--r--include/sfx2/sidebar/TabBar.hxx (renamed from sfx2/source/sidebar/TabBar.hxx)10
-rw-r--r--include/sfx2/sidebar/TabItem.hxx (renamed from sfx2/source/sidebar/TabItem.hxx)2
-rw-r--r--include/sfx2/sidebar/TitleBar.hxx (renamed from sfx2/source/sidebar/TitleBar.hxx)6
-rw-r--r--include/sfx2/sidebar/ToolBox.hxx (renamed from sfx2/source/sidebar/ToolBox.hxx)0
-rw-r--r--include/sfx2/sidebar/UnoDeck.hxx79
-rw-r--r--include/sfx2/sidebar/UnoDecks.hxx75
-rw-r--r--include/sfx2/sidebar/UnoPanel.hxx86
-rw-r--r--include/sfx2/sidebar/UnoPanels.hxx78
-rw-r--r--include/sfx2/sidebar/UnoSidebar.hxx63
-rw-r--r--offapi/UnoApi_offapi.mk5
-rw-r--r--offapi/com/sun/star/frame/XController2.idl5
-rw-r--r--offapi/com/sun/star/ui/XDeck.idl90
-rw-r--r--offapi/com/sun/star/ui/XDecks.idl32
-rw-r--r--offapi/com/sun/star/ui/XPanel.idl92
-rw-r--r--offapi/com/sun/star/ui/XPanels.idl34
-rw-r--r--offapi/com/sun/star/ui/XSidebarProvider.idl61
-rw-r--r--sfx2/Library_sfx.mk5
-rw-r--r--sfx2/source/sidebar/Accessible.cxx2
-rw-r--r--sfx2/source/sidebar/AccessibleTitleBar.cxx6
-rw-r--r--sfx2/source/sidebar/AsynchronousCall.cxx3
-rw-r--r--sfx2/source/sidebar/Context.cxx3
-rw-r--r--sfx2/source/sidebar/ContextList.cxx9
-rw-r--r--sfx2/source/sidebar/ControlFactory.cxx4
-rw-r--r--sfx2/source/sidebar/Deck.cxx29
-rw-r--r--sfx2/source/sidebar/DeckDescriptor.cxx8
-rw-r--r--sfx2/source/sidebar/DeckLayouter.cxx8
-rw-r--r--sfx2/source/sidebar/DeckTitleBar.cxx5
-rw-r--r--sfx2/source/sidebar/DrawHelper.cxx4
-rw-r--r--sfx2/source/sidebar/FocusManager.cxx10
-rw-r--r--sfx2/source/sidebar/MenuButton.cxx6
-rw-r--r--sfx2/source/sidebar/Paint.cxx2
-rw-r--r--sfx2/source/sidebar/Panel.cxx24
-rw-r--r--sfx2/source/sidebar/PanelDescriptor.cxx2
-rw-r--r--sfx2/source/sidebar/PanelTitleBar.cxx9
-rw-r--r--sfx2/source/sidebar/ResourceManager.cxx48
-rw-r--r--sfx2/source/sidebar/Sidebar.cxx8
-rw-r--r--sfx2/source/sidebar/Sidebar.src2
-rw-r--r--sfx2/source/sidebar/SidebarChildWindow.cxx4
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx155
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx4
-rw-r--r--sfx2/source/sidebar/TabBar.cxx31
-rw-r--r--sfx2/source/sidebar/TabItem.cxx6
-rw-r--r--sfx2/source/sidebar/Theme.cxx4
-rw-r--r--sfx2/source/sidebar/TitleBar.cxx8
-rw-r--r--sfx2/source/sidebar/UnoDeck.cxx262
-rw-r--r--sfx2/source/sidebar/UnoDecks.cxx168
-rw-r--r--sfx2/source/sidebar/UnoPanel.cxx271
-rw-r--r--sfx2/source/sidebar/UnoPanels.cxx180
-rw-r--r--sfx2/source/sidebar/UnoSidebar.cxx102
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx15
-rw-r--r--vcl/source/window/window.cxx1
75 files changed, 2087 insertions, 157 deletions
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 405bb91d2864..42bd37ffe5aa 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -45,6 +45,10 @@
#include "UITools.hxx"
#include "commontypes.hxx"
+#include <com/sun/star/ui/XSidebarProvider.hpp>
+#include <sfx2/sidebar/UnoSidebar.hxx>
+
+
#include <vcl/waitobj.hxx>
#include <svl/urihelper.hxx>
#include "datasourceconnector.hxx"
@@ -72,6 +76,7 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::ui;
using namespace ::dbtools;
using namespace ::comphelper;
@@ -367,6 +372,11 @@ Reference< XWindow > SAL_CALL OGenericUnoController::getComponentWindow() throw
return VCLUnoHelper::GetInterface( getView() );
}
+Reference<XSidebarProvider> SAL_CALL OGenericUnoController::getSidebar() throw (RuntimeException, std::exception)
+{
+ return NULL;
+}
+
OUString SAL_CALL OGenericUnoController::getViewControllerName() throw (::com::sun::star::uno::RuntimeException, std::exception)
{
return OUString( "Default" );
diff --git a/include/dbaccess/genericcontroller.hxx b/include/dbaccess/genericcontroller.hxx
index 07a9decc97ca..f1953218ef15 100644
--- a/include/dbaccess/genericcontroller.hxx
+++ b/include/dbaccess/genericcontroller.hxx
@@ -61,6 +61,8 @@
#include <sfx2/userinputinterception.hxx>
#include <vcl/vclptr.hxx>
+#include <com/sun/star/ui/XSidebarProvider.hpp>
+
namespace dbtools
{
class SQLExceptionInfo;
@@ -465,6 +467,9 @@ namespace dbaui
virtual OUString SAL_CALL getViewControllerName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCreationArguments() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XSidebarProvider > SAL_CALL getSidebar() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+
// ::com::sun::star::frame::XController
virtual void SAL_CALL attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual sal_Bool SAL_CALL attachModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
diff --git a/include/sfx2/sfxbasecontroller.hxx b/include/sfx2/sfxbasecontroller.hxx
index 0f77a44f0833..d387d80485ed 100644
--- a/include/sfx2/sfxbasecontroller.hxx
+++ b/include/sfx2/sfxbasecontroller.hxx
@@ -48,6 +48,8 @@
#include <tools/link.hxx>
#include <vcl/button.hxx>
+#include <com/sun/star/ui/XSidebarProvider.hpp>
+
#include <sfx2/viewsh.hxx>
#include <sfx2/sfxuno.hxx>
@@ -101,6 +103,8 @@ public:
virtual OUString SAL_CALL getViewControllerName() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCreationArguments() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual css::uno::Reference< css::ui::XSidebarProvider > SAL_CALL getSidebar() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
// XController
diff --git a/sfx2/source/sidebar/Accessible.hxx b/include/sfx2/sidebar/Accessible.hxx
index 6f786f00663a..6f786f00663a 100644
--- a/sfx2/source/sidebar/Accessible.hxx
+++ b/include/sfx2/sidebar/Accessible.hxx
diff --git a/sfx2/source/sidebar/AccessibleTitleBar.hxx b/include/sfx2/sidebar/AccessibleTitleBar.hxx
index 49e68e74265a..49e68e74265a 100644
--- a/sfx2/source/sidebar/AccessibleTitleBar.hxx
+++ b/include/sfx2/sidebar/AccessibleTitleBar.hxx
diff --git a/sfx2/source/sidebar/AsynchronousCall.hxx b/include/sfx2/sidebar/AsynchronousCall.hxx
index 338505c83e4b..338505c83e4b 100644
--- a/sfx2/source/sidebar/AsynchronousCall.hxx
+++ b/include/sfx2/sidebar/AsynchronousCall.hxx
diff --git a/sfx2/source/sidebar/Context.hxx b/include/sfx2/sidebar/Context.hxx
index b9430baedfb3..b9430baedfb3 100644
--- a/sfx2/source/sidebar/Context.hxx
+++ b/include/sfx2/sidebar/Context.hxx
diff --git a/sfx2/source/sidebar/ContextList.hxx b/include/sfx2/sidebar/ContextList.hxx
index 98860078de93..5171072fa942 100644
--- a/sfx2/source/sidebar/ContextList.hxx
+++ b/include/sfx2/sidebar/ContextList.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_CONTEXTLIST_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_CONTEXTLIST_HXX
-#include "Context.hxx"
+#include <sfx2/sidebar/Context.hxx>
#include <sal/types.h>
#include <rtl/ustring.hxx>
@@ -55,6 +55,8 @@ public:
const bool bIsInitiallyVisible,
const ::rtl::OUString& rsMenuCommand);
+ sal_Int32 GetCount();
+
private:
::std::vector<Entry> maEntries;
diff --git a/sfx2/source/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 9efaadc94fed..edd735c3cc0e 100644
--- a/sfx2/source/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_DECK_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_DECK_HXX
-#include "Panel.hxx"
+#include <sfx2/sidebar/Panel.hxx>
#include <vcl/window.hxx>
#include <vcl/image.hxx>
@@ -44,17 +44,15 @@ public:
virtual ~Deck();
virtual void dispose() SAL_OVERRIDE;
- const OUString& GetId() const
- {
- return msId;
- }
+ const OUString& GetId() const { return msId; }
+
DeckTitleBar* GetTitleBar() const;
Rectangle GetContentArea() const;
void ResetPanels (const SharedPanelContainer& rPanels);
- const SharedPanelContainer& GetPanels() const
- {
- return maPanels;
- }
+ const SharedPanelContainer& GetPanels() const { return maPanels; }
+
+ Panel* GetPanel(OUString panelId);
+
void RequestLayout();
vcl::Window* GetPanelParentWindow();
diff --git a/sfx2/source/sidebar/DeckDescriptor.hxx b/include/sfx2/sidebar/DeckDescriptor.hxx
index 77f811e77bf7..a0980c6bde78 100644
--- a/sfx2/source/sidebar/DeckDescriptor.hxx
+++ b/include/sfx2/sidebar/DeckDescriptor.hxx
@@ -23,6 +23,8 @@
#include "ContextList.hxx"
#include <boost/shared_ptr.hpp>
+#include <sfx2/sidebar/Deck.hxx>
+
namespace sfx2 { namespace sidebar {
class DeckDescriptor
@@ -41,6 +43,8 @@ public:
sal_Int32 mnOrderIndex;
bool mbExperimental;
+ VclPtr<Deck> mpDeck;
+
DeckDescriptor();
DeckDescriptor (const DeckDescriptor& rOther);
~DeckDescriptor();
diff --git a/sfx2/source/sidebar/DeckLayouter.hxx b/include/sfx2/sidebar/DeckLayouter.hxx
index 965fb5614247..8b3b24810aba 100644
--- a/sfx2/source/sidebar/DeckLayouter.hxx
+++ b/include/sfx2/sidebar/DeckLayouter.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_DECKLAYOUTER_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_DECKLAYOUTER_HXX
-#include "Panel.hxx"
+#include <sfx2/sidebar/Panel.hxx>
#include <tools/gen.hxx>
diff --git a/sfx2/source/sidebar/DeckTitleBar.hxx b/include/sfx2/sidebar/DeckTitleBar.hxx
index bd47883dccc9..3b42958f459e 100644
--- a/sfx2/source/sidebar/DeckTitleBar.hxx
+++ b/include/sfx2/sidebar/DeckTitleBar.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_DECKTITLEBAR_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_DECKTITLEBAR_HXX
-#include "TitleBar.hxx"
+#include <sfx2/sidebar/TitleBar.hxx>
namespace sfx2 { namespace sidebar {
diff --git a/sfx2/source/sidebar/DrawHelper.hxx b/include/sfx2/sidebar/DrawHelper.hxx
index 97bdb0c04530..97bdb0c04530 100644
--- a/sfx2/source/sidebar/DrawHelper.hxx
+++ b/include/sfx2/sidebar/DrawHelper.hxx
diff --git a/sfx2/source/sidebar/FocusManager.hxx b/include/sfx2/sidebar/FocusManager.hxx
index f93f9e82c368..f93f9e82c368 100644
--- a/sfx2/source/sidebar/FocusManager.hxx
+++ b/include/sfx2/sidebar/FocusManager.hxx
diff --git a/sfx2/source/sidebar/MenuButton.hxx b/include/sfx2/sidebar/MenuButton.hxx
index d725fb71c01d..d725fb71c01d 100644
--- a/sfx2/source/sidebar/MenuButton.hxx
+++ b/include/sfx2/sidebar/MenuButton.hxx
diff --git a/sfx2/source/sidebar/Paint.hxx b/include/sfx2/sidebar/Paint.hxx
index 91b36f093bf8..91b36f093bf8 100644
--- a/sfx2/source/sidebar/Paint.hxx
+++ b/include/sfx2/sidebar/Paint.hxx
diff --git a/sfx2/source/sidebar/Panel.hxx b/include/sfx2/sidebar/Panel.hxx
index 52e6e49018cf..b42dbc9779f0 100644
--- a/sfx2/source/sidebar/Panel.hxx
+++ b/include/sfx2/sidebar/Panel.hxx
@@ -19,11 +19,13 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_PANEL_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_PANEL_HXX
-#include "Context.hxx"
+#include <sfx2/sidebar/Context.hxx>
+
#include <vcl/window.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/ui/XSidebarPanel.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
@@ -40,7 +42,9 @@ class Panel : public vcl::Window
public:
Panel(const PanelDescriptor& rPanelDescriptor, vcl::Window* pParentWindow,
const bool bIsInitiallyExpanded, const std::function<void()>& rDeckLayoutTrigger,
- const std::function<Context()>& rContextAccess);
+ const std::function<Context()>& rContextAccess,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
virtual ~Panel();
virtual void dispose() SAL_OVERRIDE;
@@ -69,6 +73,9 @@ private:
bool mbIsExpanded;
const std::function<void()> maDeckLayoutTrigger;
const std::function<Context()> maContextAccess;
+
+ const css::uno::Reference<css::frame::XFrame>& mxFrame;
+
};
typedef std::vector<VclPtr<Panel> > SharedPanelContainer;
diff --git a/sfx2/source/sidebar/PanelDescriptor.hxx b/include/sfx2/sidebar/PanelDescriptor.hxx
index f67a12805471..fa490b9ec0f0 100644
--- a/sfx2/source/sidebar/PanelDescriptor.hxx
+++ b/include/sfx2/sidebar/PanelDescriptor.hxx
@@ -20,7 +20,7 @@
#define INCLUDED_SFX2_SOURCE_SIDEBAR_PANELDESCRIPTOR_HXX
#include <sfx2/sidebar/EnumContext.hxx>
-#include "ContextList.hxx"
+#include <sfx2/sidebar/ContextList.hxx>
#include <boost/shared_ptr.hpp>
namespace sfx2 { namespace sidebar {
diff --git a/sfx2/source/sidebar/PanelTitleBar.hxx b/include/sfx2/sidebar/PanelTitleBar.hxx
index 8c0f7e8849f5..c08140244fb8 100644
--- a/sfx2/source/sidebar/PanelTitleBar.hxx
+++ b/include/sfx2/sidebar/PanelTitleBar.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_PANELTITLEBAR_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_PANELTITLEBAR_HXX
-#include "TitleBar.hxx"
+#include <sfx2/sidebar/TitleBar.hxx>
#include <com/sun/star/frame/XFrame.hpp>
#include <boost/function.hpp>
diff --git a/sfx2/source/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx
index 9151760d00e4..4e6247d5c645 100644
--- a/sfx2/source/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -21,7 +21,7 @@
#include "DeckDescriptor.hxx"
#include "PanelDescriptor.hxx"
-#include "Context.hxx"
+#include <sfx2/sidebar/Context.hxx>
#include <unotools/confignode.hxx>
#include <com/sun/star/frame/XFrame.hpp>
#include <set>
@@ -40,6 +40,10 @@ class ContextList;
class ResourceManager
{
public:
+
+ ResourceManager();
+ ~ResourceManager();
+
static ResourceManager& Instance();
const DeckDescriptor* GetDeckDescriptor(const OUString& rsDeckId) const;
@@ -54,6 +58,13 @@ public:
*/
void SetIsDeckEnabled(const OUString& rsDeckId, const bool bIsEnabled);
+ void SetDeckToDescriptor(const OUString& rsDeckId, VclPtr<Deck> aDeck);
+
+ void SetDeckOrderIndex(const OUString& rsDeckId, const sal_Int32 orderIndex);
+
+ void SetPanelOrderIndex(const OUString& rsPanelId, const sal_Int32 orderIndex);
+
+
class DeckContextDescriptor
{
public:
@@ -92,8 +103,7 @@ public:
const Context& rContext);
private:
- ResourceManager();
- ~ResourceManager();
+
typedef std::vector<DeckDescriptor> DeckContainer;
DeckContainer maDecks;
diff --git a/sfx2/source/sidebar/Sidebar.hrc b/include/sfx2/sidebar/Sidebar.hrc
index 8f62aecbc91d..8f62aecbc91d 100644
--- a/sfx2/source/sidebar/Sidebar.hrc
+++ b/include/sfx2/sidebar/Sidebar.hrc
diff --git a/sfx2/source/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 5fb8466b1fbc..0e1fe0e09559 100644
--- a/sfx2/source/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -23,12 +23,12 @@
#include <map>
-#include "AsynchronousCall.hxx"
-#include "Context.hxx"
-#include "FocusManager.hxx"
-#include "Panel.hxx"
-#include "ResourceManager.hxx"
-#include "TabBar.hxx"
+#include <sfx2/sidebar/AsynchronousCall.hxx>
+#include <sfx2/sidebar/Context.hxx>
+#include <sfx2/sidebar/FocusManager.hxx>
+#include <sfx2/sidebar/Panel.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+#include <sfx2/sidebar/TabBar.hxx>
#include <vcl/menu.hxx>
@@ -45,6 +45,8 @@
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/weakref.hxx>
+
+
namespace
{
typedef ::cppu::WeakComponentImplHelper4 <
@@ -137,6 +139,21 @@ public:
FocusManager& GetFocusManager() { return maFocusManager;}
+ ResourceManager* GetResourceManager() { return mpResourceManager.get();}
+
+ // std::unique_ptr<ResourceManager> GetResourceManager() { return mpResourceManager;}
+
+ Context GetCurrentContext() const { return maCurrentContext;}
+ bool IsDocumentReadOnly (void) const { return mbIsDocumentReadOnly;}
+
+ void SwitchToDeck ( const ::rtl::OUString& rsDeckId);
+ void SwitchToDefaultDeck();
+
+ void CreateDeck(const ::rtl::OUString& rDeckId);
+
+ ResourceManager::DeckContextDescriptorContainer GetMatchingDecks();
+ ResourceManager::PanelContextDescriptorContainer GetMatchingPanels( const ::rtl::OUString& rDeckId);
+
private:
typedef ::std::map<
const css::uno::Reference<css::frame::XFrame>,
@@ -198,13 +215,13 @@ private:
const ::rtl::OUString& rsImplementationURL,
const bool bWantsCanvas,
const Context& rContext);
+
VclPtr<Panel> CreatePanel (
const ::rtl::OUString& rsPanelId,
vcl::Window* pParentWindow,
const bool bIsInitiallyExpanded,
const Context& rContext);
- void SwitchToDeck (
- const ::rtl::OUString& rsDeckId);
+
void SwitchToDeck (
const DeckDescriptor& rDeckDescriptor,
const Context& rContext);
@@ -245,9 +262,10 @@ private:
*/
void ShowPanel (const Panel& rPanel);
- Context GetCurrentContext() const { return maCurrentContext;}
-
virtual void SAL_CALL disposing() SAL_OVERRIDE;
+
+ std::unique_ptr<ResourceManager> mpResourceManager;
+
};
} } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.hxx b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index defbb17315e2..defbb17315e2 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
diff --git a/sfx2/source/sidebar/SidebarResource.hxx b/include/sfx2/sidebar/SidebarResource.hxx
index 3a6363a49b0d..78ce96b2b4ea 100644
--- a/sfx2/source/sidebar/SidebarResource.hxx
+++ b/include/sfx2/sidebar/SidebarResource.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARRESOURCE_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARRESOURCE_HXX
-#include "Sidebar.hrc"
+#include <sfx2/sidebar/Sidebar.hrc>
#include <sfx2/sfxresid.hxx>
#include <tools/rc.hxx>
diff --git a/sfx2/source/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 37089f873d56..1fe2a27a9085 100644
--- a/sfx2/source/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -20,7 +20,8 @@
#define INCLUDED_SFX2_SOURCE_SIDEBAR_TABBAR_HXX
#include "DeckDescriptor.hxx"
-#include "ResourceManager.hxx"
+#include <sfx2/sidebar/ResourceManager.hxx>
+
#include <vcl/menu.hxx>
#include <vcl/window.hxx>
@@ -39,6 +40,7 @@ namespace sfx2 { namespace sidebar {
class FocusManager;
class TabBarConfiguration;
class TabItem;
+class SidebarController;
/** The tab bar is the container for the individual tabs.
*/
@@ -66,7 +68,9 @@ public:
vcl::Window* pParentWindow,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
const ::boost::function<void(const ::rtl::OUString&rsDeckId)>& rDeckActivationFunctor,
- const PopupMenuProvider& rPopupMenuProvider);
+ const PopupMenuProvider& rPopupMenuProvider,
+ SidebarController* rParentSidebarController);
+
virtual ~TabBar();
virtual void dispose() SAL_OVERRIDE;
@@ -120,6 +124,8 @@ private:
void ShowPopupMenu() const;
DECL_LINK(OnToolboxClicked, void*);
+ SidebarController* pParentSidebarController;
+
};
diff --git a/sfx2/source/sidebar/TabItem.hxx b/include/sfx2/sidebar/TabItem.hxx
index f63e4e2ea3cb..c5eaabb858c1 100644
--- a/sfx2/source/sidebar/TabItem.hxx
+++ b/include/sfx2/sidebar/TabItem.hxx
@@ -21,7 +21,7 @@
#include <vcl/button.hxx>
-#include "DeckDescriptor.hxx"
+#include <sfx2/sidebar/DeckDescriptor.hxx>
namespace vcl { class Window; }
diff --git a/sfx2/source/sidebar/TitleBar.hxx b/include/sfx2/sidebar/TitleBar.hxx
index b0bc5d813816..9a4d343cf067 100644
--- a/sfx2/source/sidebar/TitleBar.hxx
+++ b/include/sfx2/sidebar/TitleBar.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_TITLEBAR_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_TITLEBAR_HXX
-#include "Paint.hxx"
+#include <sfx2/sidebar/Paint.hxx>
#include <vcl/fixed.hxx>
#include <sfx2/sidebar/SidebarToolBox.hxx>
@@ -35,7 +35,9 @@ public:
virtual ~TitleBar();
virtual void dispose() SAL_OVERRIDE;
- void SetTitle (const ::rtl::OUString& rsTitle);
+ void SetTitle (const OUString& rsTitle);
+ const OUString GetTitle() {return msTitle; }
+
void SetIcon (const Image& rIcon);
virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
diff --git a/sfx2/source/sidebar/ToolBox.hxx b/include/sfx2/sidebar/ToolBox.hxx
index 834d7cb2b7a0..834d7cb2b7a0 100644
--- a/sfx2/source/sidebar/ToolBox.hxx
+++ b/include/sfx2/sidebar/ToolBox.hxx
diff --git a/include/sfx2/sidebar/UnoDeck.hxx b/include/sfx2/sidebar/UnoDeck.hxx
new file mode 100644
index 000000000000..1d9fcc2096b4
--- /dev/null
+++ b/include/sfx2/sidebar/UnoDeck.hxx
@@ -0,0 +1,79 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_SFX2_SIDEBAR_UNODECK_HXX
+#define INCLUDED_SFX2_SIDEBAR_UNODECK_HXX
+
+
+#include <com/sun/star/ui/XDeck.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/ui/XPanels.hpp>
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+
+/** get the decks
+*/
+class SfxUnoDeck : public ::cppu::WeakImplHelper1< css::ui::XDeck >
+{
+
+public:
+
+ SfxUnoDeck(const css::uno::Reference<css::frame::XFrame>& , const OUString&);
+ virtual ~SfxUnoDeck() {};
+
+ virtual OUString SAL_CALL getId()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual OUString SAL_CALL getTitle()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL setTitle( const OUString& newTitle )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL isActive()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL activate( const sal_Bool bActivate )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Reference<css::ui::XPanels> SAL_CALL getPanels()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Int32 SAL_CALL getOrderIndex()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL setOrderIndex( const sal_Int32 newOrderIndex )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveFirst()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveLast()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveUp()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveDown()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+ const OUString mDeckId;
+ const OUString mTitle;
+
+ sal_Int32 GetMaxOrderIndex(sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer aDecks);
+ sal_Int32 GetMinOrderIndex(sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer aDecks);
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sidebar/UnoDecks.hxx b/include/sfx2/sidebar/UnoDecks.hxx
new file mode 100644
index 000000000000..5e0089935dd6
--- /dev/null
+++ b/include/sfx2/sidebar/UnoDecks.hxx
@@ -0,0 +1,75 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_SFX2_SIDEBAR_DECKS_HXX
+#define INCLUDED_SFX2_SIDEBAR_DECKS_HXX
+
+
+#include <com/sun/star/ui/XDecks.hpp>
+
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+
+/** get the decks
+*/
+class SfxUnoDecks : public ::cppu::WeakImplHelper1< css::ui::XDecks >
+{
+
+public:
+
+ SfxUnoDecks(const css::uno::Reference<css::frame::XFrame>&);
+ virtual ~SfxUnoDecks() {};
+
+// XNameAccess
+
+ virtual css::uno::Any SAL_CALL getByName( const OUString& aName )
+ throw(css::container::NoSuchElementException,
+ css::lang::WrappedTargetException,
+ css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+// XIndexAccess
+
+ virtual sal_Int32 SAL_CALL getCount()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
+ throw(css::lang::IndexOutOfBoundsException,
+ css::lang::WrappedTargetException,
+ css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+// XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL hasElements()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/include/sfx2/sidebar/UnoPanel.hxx b/include/sfx2/sidebar/UnoPanel.hxx
new file mode 100644
index 000000000000..051a00d8d5a0
--- /dev/null
+++ b/include/sfx2/sidebar/UnoPanel.hxx
@@ -0,0 +1,86 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_SFX2_SIDEBAR_UNOPANEL_HXX
+#define INCLUDED_SFX2_SIDEBAR_UNOPANEL_HXX
+
+#include <com/sun/star/ui/XPanel.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/Panel.hxx>
+#include <sfx2/sidebar/Deck.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+
+
+/** get the Panel
+*/
+class SfxUnoPanel : public ::cppu::WeakImplHelper1< css::ui::XPanel >
+{
+
+public:
+
+ SfxUnoPanel(const css::uno::Reference<css::frame::XFrame>& , const OUString&, const OUString&);
+ virtual ~SfxUnoPanel() {};
+
+ virtual OUString SAL_CALL getId()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual OUString SAL_CALL getTitle()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL setTitle( const OUString& newTitle )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL isExpanded()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL expand( const sal_Bool bCollapseOther )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL collapse( )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Int32 SAL_CALL getOrderIndex()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL setOrderIndex( const sal_Int32 newOrderIndex )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveFirst()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveLast()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveUp()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL moveDown()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getDialog()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+ const OUString mPanelId;
+ const OUString mDeckId;
+
+ sfx2::sidebar::Deck* mpDeck;
+ sfx2::sidebar::Panel* mpPanel;
+
+ sal_Int32 GetMaxOrderIndex(sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer aPanels);
+ sal_Int32 GetMinOrderIndex(sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer aPanels);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sidebar/UnoPanels.hxx b/include/sfx2/sidebar/UnoPanels.hxx
new file mode 100644
index 000000000000..679163347e46
--- /dev/null
+++ b/include/sfx2/sidebar/UnoPanels.hxx
@@ -0,0 +1,78 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_SFX2_SIDEBAR_PANELS_HXX
+#define INCLUDED_SFX2_SIDEBAR_PANELS_HXX
+
+
+#include <com/sun/star/ui/XPanels.hpp>
+
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <sfx2/sidebar/SidebarController.hxx>
+
+/** get the decks
+*/
+class SfxUnoPanels : public ::cppu::WeakImplHelper1< css::ui::XPanels >
+{
+
+public:
+
+ SfxUnoPanels(const css::uno::Reference<css::frame::XFrame>& , const OUString&);
+ virtual ~SfxUnoPanels() {};
+
+// XPanels
+ virtual OUString SAL_CALL getDeckId()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+// XNameAccess
+
+ virtual css::uno::Any SAL_CALL getByName( const OUString& aName )
+ throw(css::container::NoSuchElementException,
+ css::lang::WrappedTargetException,
+ css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+// XIndexAccess
+
+ virtual sal_Int32 SAL_CALL getCount()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
+ throw(css::lang::IndexOutOfBoundsException,
+ css::lang::WrappedTargetException,
+ css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+// XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL hasElements()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+ const OUString& mDeckId;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sidebar/UnoSidebar.hxx b/include/sfx2/sidebar/UnoSidebar.hxx
new file mode 100644
index 000000000000..6c154c0840a5
--- /dev/null
+++ b/include/sfx2/sidebar/UnoSidebar.hxx
@@ -0,0 +1,63 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_SFX2_SIDEBAR_SIDEBAR_HXX
+#define INCLUDED_SFX2_SIDEBAR_SIDEBAR_HXX
+
+#include <sfx2/dllapi.h>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/ui/XSidebarProvider.hpp>
+
+#include <com/sun/star/awt/XWindow2.hpp>
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/SidebarDockingWindow.hxx>
+
+#include <sfx2/sidebar/UnoDecks.hxx>
+#include <com/sun/star/ui/XDecks.hpp>
+
+/** get the sidebar for a given frame
+*/
+class SfxUnoSidebar : public ::cppu::WeakImplHelper1< css::ui::XSidebarProvider >
+{
+
+private :
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+public:
+
+ SfxUnoSidebar(const css::uno::Reference<css::frame::XFrame>&);
+
+ virtual void SAL_CALL showDecks (const sal_Bool bVisible)
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+
+ virtual void SAL_CALL setVisible (const sal_Bool bVisible)
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL isVisible()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Reference<css::frame::XFrame> SAL_CALL getFrame()
+ throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual css::uno::Reference<css::ui::XDecks> SAL_CALL getDecks()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 97f4f3e3321c..fd1b03a58118 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -4020,6 +4020,11 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/ui,\
XModuleUIConfigurationManagerSupplier \
XSidebar \
XSidebarPanel \
+ XPanel \
+ XPanels \
+ XDeck \
+ XDecks \
+ XSidebarProvider \
XStatusbarItem \
XToolPanel \
XUIConfiguration \
diff --git a/offapi/com/sun/star/frame/XController2.idl b/offapi/com/sun/star/frame/XController2.idl
index bd4eaba16482..400b7aea68da 100644
--- a/offapi/com/sun/star/frame/XController2.idl
+++ b/offapi/com/sun/star/frame/XController2.idl
@@ -23,6 +23,7 @@
#include <com/sun/star/frame/XController.idl>
#include <com/sun/star/awt/XWindow.idl>
#include <com/sun/star/beans/PropertyValue.idl>
+#include <com/sun/star/ui/XSidebarProvider.idl>
module com { module sun { module star { module frame {
@@ -60,6 +61,10 @@ interface XController2 : XController
*/
[readonly, attribute] sequence< ::com::sun::star::beans::PropertyValue >
CreationArguments;
+
+ /** get the sidebar if exists
+ */
+ ::com::sun::star::ui::XSidebarProvider getSidebar();
};
diff --git a/offapi/com/sun/star/ui/XDeck.idl b/offapi/com/sun/star/ui/XDeck.idl
new file mode 100644
index 000000000000..53b739703587
--- /dev/null
+++ b/offapi/com/sun/star/ui/XDeck.idl
@@ -0,0 +1,90 @@
+/* -*- 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/.
+ *
+ */
+#ifndef __com_sun_star_ui_XDeck_idl__
+#define __com_sun_star_ui_XDeck_idl__
+
+#include <com/sun/star/ui/XPanels.idl>
+
+
+ module com { module sun { module star { module ui {
+
+/** provides access to Desk */
+
+interface XDeck
+
+{
+ /** The deck identifier
+ */
+ string getId();
+
+ /** Get the deck title string
+ */
+ string getTitle();
+
+ /** Set the deck title string
+
+ @param newTitle
+ The new title string
+ */
+ void setTitle( [in] string newTitle );
+
+ /** Is the deck the active one
+ */
+ boolean isActive();
+
+ /** Activate the deck and isplays its content
+
+ @param bActivate
+ The requested state for the deck
+ <ul>
+ <li>TRUE sets the deck as the active one</li>
+ <li>FALSE hide the deck and defaults to the first deck of the sidebar</li>
+ </ul>
+ */
+ void activate( [in] boolean bActivate );
+
+ /** Get the ordering index of the deck button in sidebar
+ */
+ long getOrderIndex();
+
+ /** Set the ordering index of the deck button in sidebar
+
+ @param newOrderIndex
+ The new position
+ */
+ void setOrderIndex( [in] long newOrderIndex );
+
+ /** Move deck button at first position in sidebar
+ */
+ void moveFirst();
+
+ /** Move deck button at last position in sidebar
+ */
+ void moveLast();
+
+ /** Move deck one step up in the sidebar
+ */
+ void moveUp();
+
+ /** Move deck one step down in the sidebar
+ */
+ void moveDown();
+
+ /** Panels collection attached to the deck
+ */
+ com::sun::star::ui::XPanels getPanels();
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/offapi/com/sun/star/ui/XDecks.idl b/offapi/com/sun/star/ui/XDecks.idl
new file mode 100644
index 000000000000..ba7c3a7f3107
--- /dev/null
+++ b/offapi/com/sun/star/ui/XDecks.idl
@@ -0,0 +1,32 @@
+/* -*- 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/.
+ *
+ */
+#ifndef __com_sun_star_ui_XDecks_idl__
+#define __com_sun_star_ui_XDecks_idl__
+
+#include <com/sun/star/container/XIndexAccess.idl>
+#include <com/sun/star/container/XNameAccess.idl>
+
+ module com { module sun { module star { module ui {
+
+/** provides access to Desks of a Sidebar.*/
+
+interface XDecks
+
+{
+ interface com::sun::star::container::XIndexAccess;
+ interface com::sun::star::container::XNameAccess;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/offapi/com/sun/star/ui/XPanel.idl b/offapi/com/sun/star/ui/XPanel.idl
new file mode 100644
index 000000000000..0070d2356cca
--- /dev/null
+++ b/offapi/com/sun/star/ui/XPanel.idl
@@ -0,0 +1,92 @@
+/* -*- 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/.
+ *
+ */
+#ifndef __com_sun_star_ui_XPanel_idl__
+#define __com_sun_star_ui_XPanel_idl__
+
+#include <com/sun/star/ui/XPanel.idl>
+#include <com/sun/star/awt/XWindow.idl>
+
+
+ module com { module sun { module star { module ui {
+
+/** provides access to Desk */
+
+interface XPanel
+
+{
+ /** The panel identifier
+ */
+ string getId();
+
+ /** Get the panel title string
+ */
+ string getTitle();
+
+ /** Set the panel title string
+
+ @param newTitle
+ The new title string
+ */
+ void setTitle( [in] string newTitle );
+
+ /** Is the panel expanded
+ */
+ boolean isExpanded();
+
+ /** Collapse the panel to only show its title bar
+ */
+ void collapse ();
+
+ /** Expand and display the panel
+
+ @param bCollapseOther
+ <ul>
+ <li>TRUE collapse all other panels of the deck</li>
+ <li>FALSE do not change other panels state</li>
+ </ul>
+ */
+ void expand ( [in] boolean bCollapseOther );
+
+ /** Get the ordering index of the panel in the deck
+ */
+ long getOrderIndex();
+
+ /** Set the ordering index of the panel in the deck
+ */
+ void setOrderIndex( [in] long newOrderIndex );
+
+ /** Move panel as first item of the deck
+ */
+ void moveFirst();
+
+ /** Move panel as last item of the deck
+ **/
+ void moveLast();
+
+ /** Move panel one step up in the deck
+ */
+ void moveUp();
+
+ /** Move the panel one step down in the deck
+ */
+ void moveDown();
+
+ /** Get the panel dialog element
+ */
+ com::sun::star::awt::XWindow getDialog();
+
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/offapi/com/sun/star/ui/XPanels.idl b/offapi/com/sun/star/ui/XPanels.idl
new file mode 100644
index 000000000000..a2aa85103e46
--- /dev/null
+++ b/offapi/com/sun/star/ui/XPanels.idl
@@ -0,0 +1,34 @@
+/* -*- 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/.
+ *
+ */
+#ifndef __com_sun_star_ui_XPanels_idl__
+#define __com_sun_star_ui_XPanels_idl__
+
+#include <com/sun/star/container/XIndexAccess.idl>
+#include <com/sun/star/container/XNameAccess.idl>
+
+ module com { module sun { module star { module ui {
+
+/** provides access to Panels of a Deck.*/
+
+interface XPanels
+
+{
+ interface com::sun::star::container::XIndexAccess;
+ interface com::sun::star::container::XNameAccess;
+
+ string getDeckId();
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/offapi/com/sun/star/ui/XSidebarProvider.idl b/offapi/com/sun/star/ui/XSidebarProvider.idl
new file mode 100644
index 000000000000..370925ec8084
--- /dev/null
+++ b/offapi/com/sun/star/ui/XSidebarProvider.idl
@@ -0,0 +1,61 @@
+/* -*- 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/.
+ *
+ */
+#ifndef __com_sun_star_ui_XSidebarProvider_idl__
+#define __com_sun_star_ui_XSidebarProvider_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/frame/XFrame.idl>
+#include <com/sun/star/awt/XWindow2.idl>
+
+#include <com/sun/star/ui/XDecks.idl>
+
+
+module com { module sun { module star { module ui {
+
+/** Interface of the sidebar
+*/
+interface XSidebarProvider: com::sun::star::uno::XInterface
+{
+ /** Display the sidebar
+
+ @param bVisible
+ the requested visible state
+ */
+ void setVisible ( [in] boolean bVisible);
+
+ /** Is the sidebar visible
+ */
+ boolean isVisible();
+
+ /** Get the XFrame owner
+ */
+ com::sun::star::frame::XFrame getFrame();
+
+ /* Decks collection attached to the sidebar
+ */
+ com::sun::star::ui::XDecks getDecks();
+
+ /** Decks container visibility
+
+ @param bVisible
+ the requested visible state
+ <ul>
+ <li>FALSE collapses the deck container horizontally. Then Only shows the deck TabBar selector</li>
+ <li>TRUE expands the deck container and show active Deck content</li>
+ </ul>
+ */
+ void showDecks([in] boolean bVisible);
+} ;
+
+} ; } ; } ; } ;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 0a1100e1f51a..5db89dd2444b 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -283,6 +283,11 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/sidebar/TitleBar \
sfx2/source/sidebar/Theme \
sfx2/source/sidebar/Tools \
+ sfx2/source/sidebar/UnoPanel \
+ sfx2/source/sidebar/UnoPanels \
+ sfx2/source/sidebar/UnoDeck \
+ sfx2/source/sidebar/UnoDecks \
+ sfx2/source/sidebar/UnoSidebar \
sfx2/source/statbar/stbitem \
sfx2/source/toolbox/imgmgr \
sfx2/source/toolbox/tbxitem \
diff --git a/sfx2/source/sidebar/Accessible.cxx b/sfx2/source/sidebar/Accessible.cxx
index 7cf157e012f2..10b01dc07c8f 100644
--- a/sfx2/source/sidebar/Accessible.cxx
+++ b/sfx2/source/sidebar/Accessible.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Accessible.hxx"
+#include <sfx2/sidebar/Accessible.hxx>
using namespace css;
using namespace css::uno;
diff --git a/sfx2/source/sidebar/AccessibleTitleBar.cxx b/sfx2/source/sidebar/AccessibleTitleBar.cxx
index 5405837c3046..0d2597ba9659 100644
--- a/sfx2/source/sidebar/AccessibleTitleBar.cxx
+++ b/sfx2/source/sidebar/AccessibleTitleBar.cxx
@@ -17,9 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "AccessibleTitleBar.hxx"
-#include "Accessible.hxx"
-#include "TitleBar.hxx"
+#include <sfx2/sidebar/AccessibleTitleBar.hxx>
+#include <sfx2/sidebar/Accessible.hxx>
+#include <sfx2/sidebar/TitleBar.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
diff --git a/sfx2/source/sidebar/AsynchronousCall.cxx b/sfx2/source/sidebar/AsynchronousCall.cxx
index a4080fdffc01..f9ebe18624a9 100644
--- a/sfx2/source/sidebar/AsynchronousCall.cxx
+++ b/sfx2/source/sidebar/AsynchronousCall.cxx
@@ -16,7 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "AsynchronousCall.hxx"
+
+#include <sfx2/sidebar/AsynchronousCall.hxx>
#include <vcl/svapp.hxx>
namespace sfx2 { namespace sidebar {
diff --git a/sfx2/source/sidebar/Context.cxx b/sfx2/source/sidebar/Context.cxx
index 27d35dd48817..3a7ce010b24c 100644
--- a/sfx2/source/sidebar/Context.cxx
+++ b/sfx2/source/sidebar/Context.cxx
@@ -16,7 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Context.hxx"
+#include <sfx2/sidebar/Context.hxx>
+
#define AnyApplicationName "any"
#define AnyContextName "any"
diff --git a/sfx2/source/sidebar/ContextList.cxx b/sfx2/source/sidebar/ContextList.cxx
index a64b43a8f5af..20cdcbc8806b 100644
--- a/sfx2/source/sidebar/ContextList.cxx
+++ b/sfx2/source/sidebar/ContextList.cxx
@@ -16,8 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "ContextList.hxx"
-#include "Context.hxx"
+#include <sfx2/sidebar/ContextList.hxx>
+#include <sfx2/sidebar/Context.hxx>
using ::rtl::OUString;
@@ -85,6 +85,11 @@ void ContextList::AddContextDescription (
maEntries.back().msMenuCommand = rsMenuCommand;
}
+sal_Int32 ContextList::GetCount()
+{
+ return maEntries.size();
+}
+
} } // end of namespace sfx2::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/ControlFactory.cxx b/sfx2/source/sidebar/ControlFactory.cxx
index 1376f9ee9961..96bd62aefc2d 100644
--- a/sfx2/source/sidebar/ControlFactory.cxx
+++ b/sfx2/source/sidebar/ControlFactory.cxx
@@ -18,8 +18,8 @@
*/
#include <sfx2/sidebar/ControlFactory.hxx>
-#include "MenuButton.hxx"
-#include "TabItem.hxx"
+#include <sfx2/sidebar/MenuButton.hxx>
+#include <sfx2/sidebar/TabItem.hxx>
#include <sfx2/sidebar/SidebarToolBox.hxx>
#include <vcl/toolbox.hxx>
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index d5dc5d30b965..b2eb225e490b 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -17,14 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Deck.hxx"
-#include "DeckDescriptor.hxx"
-#include "DeckLayouter.hxx"
-#include "DrawHelper.hxx"
-#include "DeckTitleBar.hxx"
-#include "PanelTitleBar.hxx"
-#include "Paint.hxx"
-#include "Panel.hxx"
+#include <sfx2/sidebar/Deck.hxx>
+#include <sfx2/sidebar/DeckDescriptor.hxx>
+#include <sfx2/sidebar/DeckLayouter.hxx>
+#include <sfx2/sidebar/DrawHelper.hxx>
+#include <sfx2/sidebar/DeckTitleBar.hxx>
+#include <sfx2/sidebar/PanelTitleBar.hxx>
+#include <sfx2/sidebar/Paint.hxx>
+#include <sfx2/sidebar/Panel.hxx>
#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/Theme.hxx>
@@ -223,6 +223,19 @@ vcl::Window* Deck::GetPanelParentWindow()
return mpScrollContainer.get();
}
+Panel* Deck::GetPanel(const OUString panelId)
+{
+ for (size_t i = 0; i < maPanels.size(); i++)
+ {
+ if(maPanels[i].get()->GetId() == panelId)
+ {
+ return maPanels[i].get();
+ }
+ }
+ return NULL;
+
+}
+
void Deck::ShowPanel(const Panel& rPanel)
{
if (mpVerticalScrollBar && mpVerticalScrollBar->IsVisible())
diff --git a/sfx2/source/sidebar/DeckDescriptor.cxx b/sfx2/source/sidebar/DeckDescriptor.cxx
index 2f431e525315..fd4f6400fe4f 100644
--- a/sfx2/source/sidebar/DeckDescriptor.cxx
+++ b/sfx2/source/sidebar/DeckDescriptor.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DeckDescriptor.hxx"
+#include <sfx2/sidebar/DeckDescriptor.hxx>
namespace sfx2 { namespace sidebar {
@@ -33,7 +33,8 @@ DeckDescriptor::DeckDescriptor()
maContextList(),
mbIsEnabled(true),
mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
- mbExperimental(false)
+ mbExperimental(false),
+ mpDeck()
{
}
@@ -49,7 +50,8 @@ DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther)
maContextList(rOther.maContextList),
mbIsEnabled(rOther.mbIsEnabled),
mnOrderIndex(rOther.mnOrderIndex),
- mbExperimental(rOther.mbExperimental)
+ mbExperimental(rOther.mbExperimental),
+ mpDeck(rOther.mpDeck)
{
}
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx
index 3a2edfc2aef5..896edd862ffc 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -17,11 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DeckLayouter.hxx"
+#include <sfx2/sidebar/DeckLayouter.hxx>
#include <sfx2/sidebar/Theme.hxx>
-#include "Panel.hxx"
-#include "PanelTitleBar.hxx"
-#include "Deck.hxx"
+#include <sfx2/sidebar/Panel.hxx>
+#include <sfx2/sidebar/PanelTitleBar.hxx>
+#include <sfx2/sidebar/Deck.hxx>
#include <vcl/window.hxx>
#include <vcl/scrbar.hxx>
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx
index 41c8fcf78569..a55fef62e719 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -17,10 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DeckTitleBar.hxx"
+#include <sfx2/sidebar/DeckTitleBar.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sfxresid.hxx>
-#include "Sidebar.hrc"
+
+#include <sfx2/sidebar/Sidebar.hrc>
#include <vcl/image.hxx>
diff --git a/sfx2/source/sidebar/DrawHelper.cxx b/sfx2/source/sidebar/DrawHelper.cxx
index 66ac2f727421..7297fc244b23 100644
--- a/sfx2/source/sidebar/DrawHelper.cxx
+++ b/sfx2/source/sidebar/DrawHelper.cxx