From e436f31147c7eb75908a8750b0e4053c2efdca5b Mon Sep 17 00:00:00 2001 From: Rishabh Kumar Date: Mon, 15 Jun 2015 01:54:43 +0530 Subject: tdf#73071:Styles tab addition to the sidebar for writer Addition of .uno:StyleApply , .uno:StyleUpdateByExample and .uno:StyleNewByExample uno commands to the sidebar Change-Id: Iab6f1fb465066fce523fd376038a059189f1b842 Reviewed-on: https://gerrit.libreoffice.org/16279 Reviewed-by: Yousuf Philips Tested-by: Yousuf Philips --- svx/Library_svx.mk | 1 + svx/UIConfig_svx.mk | 1 + svx/source/sidebar/PanelFactory.cxx | 5 + svx/source/sidebar/styles/StylesPropertyPanel.cxx | 55 ++++++++++ svx/source/sidebar/styles/StylesPropertyPanel.hxx | 52 ++++++++++ svx/uiconfig/ui/sidebarstylespanel.ui | 118 ++++++++++++++++++++++ 6 files changed, 232 insertions(+) create mode 100644 svx/source/sidebar/styles/StylesPropertyPanel.cxx create mode 100644 svx/source/sidebar/styles/StylesPropertyPanel.hxx create mode 100644 svx/uiconfig/ui/sidebarstylespanel.ui (limited to 'svx') diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index db5ab90c463e..7cc76cb00650 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -182,6 +182,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/sidebar/text/TextUnderlineControl \ svx/source/sidebar/text/TextUnderlinePopup \ svx/source/sidebar/text/TextPropertyPanel \ + svx/source/sidebar/styles/StylesPropertyPanel \ svx/source/sidebar/paragraph/ParaLineSpacingControl \ svx/source/sidebar/paragraph/ParaLineSpacingPopup \ svx/source/sidebar/paragraph/ParaPropertyPanel \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index f4e1f9fa2302..ba19a9c14d3c 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -64,6 +64,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/sidebarline \ svx/uiconfig/ui/sidebarparagraph \ svx/uiconfig/ui/sidebarpossize \ + svx/uiconfig/ui/sidebarstylespanel \ svx/uiconfig/ui/sidebartextpanel \ svx/uiconfig/ui/textcontrolchardialog \ svx/uiconfig/ui/textcontrolparadialog \ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index bab0a12df7be..a89b9e0282a3 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -18,6 +18,7 @@ */ #include "text/TextPropertyPanel.hxx" +#include "styles/StylesPropertyPanel.hxx" #include "paragraph/ParaPropertyPanel.hxx" #include "area/AreaPropertyPanel.hxx" #include "graphic/GraphicPropertyPanel.hxx" @@ -144,6 +145,10 @@ Reference SAL_CALL PanelFactory::createUIElement ( { pControl = TextPropertyPanel::Create(pParentWindow, xFrame, pBindings, aContext); } + else if (rsResourceURL.endsWith("/StylesPropertyPanel")) + { + pControl = StylesPropertyPanel::Create(pParentWindow, xFrame, pBindings); + } else if (rsResourceURL.endsWith("/ParaPropertyPanel")) { pControl = ParaPropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar); diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.cxx b/svx/source/sidebar/styles/StylesPropertyPanel.cxx new file mode 100644 index 000000000000..12190cab81f4 --- /dev/null +++ b/svx/source/sidebar/styles/StylesPropertyPanel.cxx @@ -0,0 +1,55 @@ +#include "StylesPropertyPanel.hxx" +#include + +using namespace css; +using namespace css::uno; + +namespace svx { namespace sidebar { + +VclPtr StylesPropertyPanel::Create ( + vcl::Window* pParent, + const css::uno::Reference& rxFrame, + SfxBindings* pBindings) +{ + if (pParent == NULL) + throw lang::IllegalArgumentException("no parent Window given to StylesPropertyPanel::Create", NULL, 0); + if ( ! rxFrame.is()) + throw lang::IllegalArgumentException("no XFrame given to StylesPropertyPanel::Create", NULL, 1); + if (pBindings == NULL) + throw lang::IllegalArgumentException("no SfxBindings given to StylesPropertyPanel::Create", NULL, 2); + + return VclPtr::Create(pParent,rxFrame,pBindings); +} + +StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings ) + : PanelLayout(pParent, "SidebarStylesPanel", "svx/ui/sidebarstylespanel.ui", rxFrame), + mpBindings(pBindings) +{ + +} + +StylesPropertyPanel::~StylesPropertyPanel() +{ + disposeOnce(); +} + +void StylesPropertyPanel::dispose() +{ + PanelLayout::dispose(); +} + +void StylesPropertyPanel::DataChanged( const DataChangedEvent& /*rEvent*/) +{ + +} + +void StylesPropertyPanel::NotifyItemUpdate ( + const sal_uInt16 /*nSId*/, + const SfxItemState /*eState*/, + const SfxPoolItem* /*pState*/, + const bool /*bIsEnabled*/) +{ + +} + +}} diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.hxx b/svx/source/sidebar/styles/StylesPropertyPanel.hxx new file mode 100644 index 000000000000..73bc30c8b22c --- /dev/null +++ b/svx/source/sidebar/styles/StylesPropertyPanel.hxx @@ -0,0 +1,52 @@ +#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace svx { namespace sidebar{ + +class StylesPropertyPanel: + public PanelLayout +{ +public: + virtual ~StylesPropertyPanel(); + virtual void dispose() SAL_OVERRIDE; + + static VclPtr Create ( + vcl::Window* pParent, + const css::uno::Reference& rxFrame, + SfxBindings* pBindings); + + virtual void DataChanged( const DataChangedEvent& rEvent ) SAL_OVERRIDE; + + virtual void NotifyItemUpdate( + const sal_uInt16 nSId, + const SfxItemState eState, + const SfxPoolItem* pState, + const bool bIsEnabled); //SAL_OVERRIDE; + + StylesPropertyPanel( + vcl::Window* pParent, + const css::uno::Reference& rxFrame, + SfxBindings* pBindings); + SfxBindings* GetBindings() { return mpBindings; } + +private: + SfxBindings* mpBindings; + //more controls will be added later +}; + +} } //end of namespace svx::sidebar + +#endif diff --git a/svx/uiconfig/ui/sidebarstylespanel.ui b/svx/uiconfig/ui/sidebarstylespanel.ui new file mode 100644 index 000000000000..00257bca2a39 --- /dev/null +++ b/svx/uiconfig/ui/sidebarstylespanel.ui @@ -0,0 +1,118 @@ + + + + + + True + False + True + + + True + False + True + True + 6 + 6 + + + True + False + True + vertical + + + True + True + + + True + False + True + .uno:StyleApply + + + True + True + + + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + 6 + + + True + True + + + True + False + True + .uno:StyleUpdateByExample + + + True + True + + + + + False + True + 0 + + + + + True + True + + + True + False + True + .uno:StyleNewByExample + + + True + True + + + + + False + True + 1 + + + + + False + True + 1 + + + + + 0 + 0 + + + + -- cgit