diff options
author | Rishabh Kumar <kris.kr296@gmail.com> | 2015-06-15 01:54:43 +0530 |
---|---|---|
committer | Yousuf Philips <philipz85@hotmail.com> | 2015-06-16 09:17:18 +0000 |
commit | e436f31147c7eb75908a8750b0e4053c2efdca5b (patch) | |
tree | eceb3ddbca4dd080be27eb93b98cda048062e2d7 /svx | |
parent | 9ef671364ff9fbb552a5433053af9283d12d90c7 (diff) |
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 <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svx.mk | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/sidebar/PanelFactory.cxx | 5 | ||||
-rw-r--r-- | svx/source/sidebar/styles/StylesPropertyPanel.cxx | 55 | ||||
-rw-r--r-- | svx/source/sidebar/styles/StylesPropertyPanel.hxx | 52 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebarstylespanel.ui | 118 |
6 files changed, 232 insertions, 0 deletions
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<ui::XUIElement> 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 <boost/bind.hpp> + +using namespace css; +using namespace css::uno; + +namespace svx { namespace sidebar { + +VclPtr<vcl::Window> StylesPropertyPanel::Create ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& 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<StylesPropertyPanel>::Create(pParent,rxFrame,pBindings); +} + +StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& 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 <sfx2/sidebar/SidebarPanelBase.hxx> +#include <sfx2/sidebar/ControllerItem.hxx> +#include <sfx2/sidebar/IContextChangeReceiver.hxx> +#include <sfx2/sidebar/EnumContext.hxx> +#include <svtools/ctrlbox.hxx> +#include <editeng/fhgtitem.hxx> +#include <boost/scoped_ptr.hpp> +#include <com/sun/star/ui/XUIElement.hpp> +#include <com/sun/star/ui/XSidebar.hpp> +#include <com/sun/star/frame/XToolbarController.hpp> + +#include <svx/sidebar/PanelLayout.hxx> + +namespace svx { namespace sidebar{ + +class StylesPropertyPanel: + public PanelLayout +{ +public: + virtual ~StylesPropertyPanel(); + virtual void dispose() SAL_OVERRIDE; + + static VclPtr<vcl::Window> Create ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& 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<css::frame::XFrame>& 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkGrid" id="SidebarStylesPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="sfxlo-SidebarToolBox" id="fontstyletoolbox"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkToolButton" id="fontstyle"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="is_important">True</property> + <property name="action_name">.uno:StyleApply</property> + </object> + <packing> + <property name="expand">True</property> + <property name="homogenous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_right">6</property> + <child> + <object class="sfxlo-SidebarToolBox" id="styleupdate"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkToolButton" id="styleupdateexample"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="is_important">True</property> + <property name="action_name">.uno:StyleUpdateByExample</property> + </object> + <packing> + <property name="expand">True</property> + <property name="homogenous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="sfxlo-SidebarToolBox" id="stylenew"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkToolButton" id="stylenewexample"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="is_important">True</property> + <property name="action_name">.uno:StyleNewByExample</property> + </object> + <packing> + <property name="expand">True</property> + <property name="homogenous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> +</interface> |