summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRishabh Kumar <kris.kr296@gmail.com>2015-06-15 01:54:43 +0530
committerCaolán McNamara <caolanm@redhat.com>2015-06-16 14:45:13 +0000
commit31fcd558a2fdf892e190d9738c224a0752997903 (patch)
treecd7559e284c9eecdb3f026ec8c86799a5e8ceddb
parentad8e91255b6c07adc1e8c04e06eba55c6a4e8b3d (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> (cherry picked from commit e436f31147c7eb75908a8750b0e4053c2efdca5b) Reviewed-on: https://gerrit.libreoffice.org/16306 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu29
-rw-r--r--svx/Library_svx.mk1
-rw-r--r--svx/UIConfig_svx.mk1
-rw-r--r--svx/source/sidebar/PanelFactory.cxx5
-rw-r--r--svx/source/sidebar/styles/StylesPropertyPanel.cxx55
-rw-r--r--svx/source/sidebar/styles/StylesPropertyPanel.hxx52
-rw-r--r--svx/uiconfig/ui/sidebarstylespanel.ui118
7 files changed, 260 insertions, 1 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 3f9e93ec6d4d..9a400065e72b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -231,6 +231,33 @@
</node>
<node oor:name="PanelList">
+ <node oor:name="StylesPropertyPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Styles</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>StylesPropertyPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>PropertyDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ WriterVariants, Annotation, visible ;
+ WriterVariants, DrawText, visible ;
+ WriterVariants, Table, visible ;
+ WriterVariants, Text, visible ;
+ WriterVariants, default, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/SvxPanelFactory/StylesPropertyPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>100</value>
+ </prop>
+ </node>
+
<node oor:name="TextPropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Character</value>
@@ -270,7 +297,7 @@
<value>private:resource/toolpanel/SvxPanelFactory/TextPropertyPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>100</value>
+ <value>120</value>
</prop>
</node>
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>