diff options
author | Andre Fischer <af@apache.org> | 2013-05-16 11:43:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-21 16:36:07 +0100 |
commit | edaca7c6e1d1ade6bf6cdae753028ee62297f0b1 (patch) | |
tree | 7d753b4337f8b993c3585fd4597a65e7672c2d49 /include | |
parent | aad035bd70b29253e9206de48259a9f0943bbc41 (diff) |
Resolves: #i121960# Improve creation of toolbox/toolbar controllers
(cherry picked from commit 3608a33d8362cbc44a2eb7203b7d1bffe481c7ab)
Conflicts:
sfx2/inc/sfx2/sidebar/ControlFactory.hxx
sfx2/inc/sfx2/sidebar/ControllerFactory.hxx
sfx2/inc/sfx2/sidebar/SidebarToolBox.hxx
sfx2/inc/sfx2/sidebar/Tools.hxx
sfx2/source/sidebar/ToolBoxBackground.cxx
Change-Id: I833a33bbc58ebe46bd28c6d97a4d76329f1f0186
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/sidebar/ControlFactory.hxx | 29 | ||||
-rw-r--r-- | include/sfx2/sidebar/ControllerFactory.hxx | 16 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarToolBox.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/sidebar/Tools.hxx | 3 |
4 files changed, 44 insertions, 8 deletions
diff --git a/include/sfx2/sidebar/ControlFactory.hxx b/include/sfx2/sidebar/ControlFactory.hxx index 3b286e927975..b4d329acc27b 100644 --- a/include/sfx2/sidebar/ControlFactory.hxx +++ b/include/sfx2/sidebar/ControlFactory.hxx @@ -28,26 +28,49 @@ namespace sfx2 { namespace sidebar { class ToolBoxBackground; +/** Factory for controls used in sidebar panels. + The reason to use this factory instead of creating the controls + directly is that this way the sidebar has a little more control + over look and feel of its controls. +*/ class SFX2_DLLPUBLIC ControlFactory { public: + /** Create the menu button for the task bar. + */ static CheckBox* CreateMenuButton (Window* pParentWindow); + static ImageRadioButton* CreateTabItem (Window* pParentWindow); - /** Create a tool box that does *not* handle its items. + /** Create a tool box that does *not* handle its items. The + caller has to register callbacks to process, among others, + click and selection events. */ static SidebarToolBox* CreateToolBox ( Window* pParentWindow, const ResId& rResId); - /** Create a tool box that *does* handle its items. + /** Create a tool box that *does* handle its items. All event + processing is done by toolbox controllers. */ static SidebarToolBox* CreateToolBox ( Window* pParentWindow, const ResId& rResId, const ::com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rxFrame); - static Window* CreateToolBoxBackground (Window* pParentWindow); + /** Create a window that acts as background of a tool box. + In general it is slightly larger than the tool box. + @param pParentWindow + The parent window of the new background control. + @param bShowBorder + When <TRUE/> then the background control is made slightly + larger then its tool box child, once that is created. + Otherwise the background control will not be visible. + */ + static Window* CreateToolBoxBackground ( + Window* pParentWindow, + const bool bShowBorder = true); + static ImageRadioButton* CreateCustomImageRadionButton( Window* pParentWindow, const ResId& rResId ); diff --git a/include/sfx2/sidebar/ControllerFactory.hxx b/include/sfx2/sidebar/ControllerFactory.hxx index 030b050adfb9..fa341f13cb2a 100644 --- a/include/sfx2/sidebar/ControllerFactory.hxx +++ b/include/sfx2/sidebar/ControllerFactory.hxx @@ -19,8 +19,9 @@ #define SFX_SIDEBAR_CONTROLLER_FACTORY_HXX #include "sfx2/dllapi.h" -#include <com/sun/star/frame/XToolbarController.hpp> +#include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XToolbarController.hpp> namespace css = ::com::sun::star; namespace cssu = ::com::sun::star::uno; @@ -29,7 +30,7 @@ class ToolBox; namespace sfx2 { namespace sidebar { -/** Convenience class for easy creation of toolbox controllers. +/** Convenience class for the easy creation of toolbox controllers. */ class SFX2_DLLPUBLIC ControllerFactory { @@ -38,7 +39,16 @@ public: ToolBox* pToolBox, const sal_uInt16 nItemId, const ::rtl::OUString& rsCommandName, - const cssu::Reference<css::frame::XFrame>& rxFrame); + const cssu::Reference<css::frame::XFrame>& rxFrame, + const cssu::Reference<css::awt::XWindow>& rxParentWindow, + const sal_Int32 nItemWidth); + +private: + static cssu::Reference<css::frame::XToolbarController> CreateToolBarController( + ToolBox* pToolBox, + const ::rtl::OUString& rsCommandName, + const cssu::Reference<css::frame::XFrame>& rxFrame, + const sal_Int32 nWidth); }; diff --git a/include/sfx2/sidebar/SidebarToolBox.hxx b/include/sfx2/sidebar/SidebarToolBox.hxx index 4d5625c3961a..bb96a9ee69eb 100644 --- a/include/sfx2/sidebar/SidebarToolBox.hxx +++ b/include/sfx2/sidebar/SidebarToolBox.hxx @@ -76,7 +76,6 @@ private: cssu::Reference<css::frame::XToolbarController> mxController; css::util::URL maURL; rtl::OUString msCurrentCommand; - cssu::Reference<css::frame::XDispatch> mxDispatch; }; typedef ::std::map<sal_uInt16, ItemDescriptor> ControllerContainer; ControllerContainer maControllers; @@ -90,7 +89,8 @@ private: void CreateController ( const sal_uInt16 nItemId, - const cssu::Reference<css::frame::XFrame>& rxFrame); + const cssu::Reference<css::frame::XFrame>& rxFrame, + const sal_Int32 nItemWidth = 0); void UpdateIcons ( const cssu::Reference<css::frame::XFrame>& rxFrame); }; diff --git a/include/sfx2/sidebar/Tools.hxx b/include/sfx2/sidebar/Tools.hxx index 769cd04d10f4..db72103c6e94 100644 --- a/include/sfx2/sidebar/Tools.hxx +++ b/include/sfx2/sidebar/Tools.hxx @@ -60,6 +60,9 @@ public: static cssu::Reference<css::frame::XDispatch> GetDispatch ( const cssu::Reference<css::frame::XFrame>& rxFrame, const css::util::URL& rURL); + + static ::rtl::OUString GetModuleName ( + const cssu::Reference<css::frame::XFrame>& rxFrame); }; |