summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-05-30 18:25:09 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-06-05 10:06:49 +0100
commit0346a83833d2ed82715b0425abe36051cfb3f3a9 (patch)
tree478fa6552e140248338ba6b7911106b462528ddc /include
parente6354cc0752c5de0efefb9e3bdb9b196b205a73a (diff)
sidebar: Allow creation of toolboxes using Widget layout / .ui.
Change-Id: Idc07614005a00401a51007b1a0aef00e17507daa (cherry picked from commit 6fe1ff54c667a4f669feee6954dd9b859fd442b2)
Diffstat (limited to 'include')
-rw-r--r--include/svx/sidebar/PanelLayout.hxx5
-rw-r--r--include/vcl/builder.hxx9
-rw-r--r--include/vcl/toolbox.hxx12
3 files changed, 23 insertions, 3 deletions
diff --git a/include/svx/sidebar/PanelLayout.hxx b/include/svx/sidebar/PanelLayout.hxx
index c29f6b90f4ed..3395e7f9aab7 100644
--- a/include/svx/sidebar/PanelLayout.hxx
+++ b/include/svx/sidebar/PanelLayout.hxx
@@ -15,11 +15,14 @@
#include <vcl/builder.hxx>
#include <vcl/ctrl.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+
/// This class is the base for the Widget Layout-based sidebar panels.
class SVX_DLLPUBLIC PanelLayout : public Control, public VclBuilderContainer
{
public:
- PanelLayout(Window* pParent, const OString& rID, const OUString& rUIXMLDescription);
+ PanelLayout(Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
+ const com::sun::star::uno::Reference<com::sun::star::frame::XFrame> &rFrame);
virtual ~PanelLayout() {}
virtual Size GetOptimalSize() const;
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 31a82418447a..d699d504278d 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -23,6 +23,8 @@
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_map.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
class ListBox;
class NumericFormatter;
class PopupMenu;
@@ -235,8 +237,13 @@ private:
}
bool operator()(const Window *pA, const Window *pB) const;
};
+
+ /// XFrame to be able to extract labels and other properties of the UNO commands (like of .uno:Bold).
+ com::sun::star::uno::Reference<com::sun::star::frame::XFrame> m_xFrame;
+
public:
- VclBuilder(Window *pParent, OUString sUIRootDir, OUString sUIFile, OString sID = OString());
+ VclBuilder(Window *pParent, OUString sUIRootDir, OUString sUIFile, OString sID = OString(),
+ const com::sun::star::uno::Reference<com::sun::star::frame::XFrame> &rFrame = com::sun::star::uno::Reference<com::sun::star::frame::XFrame>());
~VclBuilder();
Window *get_widget_root();
//sID must exist and be of type T
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 3b1f69e36477..501eeedb6ac1 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -28,6 +28,8 @@
#include <vcl/timer.hxx>
#include <vector>
+#include <com/sun/star/frame/XFrame.hpp>
+
class UserDrawEvent;
struct ImplToolItem;
@@ -333,9 +335,15 @@ public:
virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
virtual void Resizing( Size& rSize );
+ virtual Size GetOptimalSize() const;
void InsertItem( const ResId& rResId,
sal_uInt16 nPos = TOOLBOX_APPEND );
+ /// Insert a command (like '.uno:Save').
+ void InsertItem( const OUString& rCommand,
+ const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rFrame,
+ ToolBoxItemBits nBits = 0,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
void InsertItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nBits = 0,
sal_uInt16 nPos = TOOLBOX_APPEND );
@@ -386,10 +394,12 @@ public:
sal_uInt16 GetItemPos( const Point& rPos ) const;
sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
sal_uInt16 GetItemId( const Point& rPos ) const;
+ /// Map the command name (like .uno:Save) back to item id.
+ sal_uInt16 GetItemId( const OUString& rCommand ) const;
Rectangle GetItemRect( sal_uInt16 nItemId ) const;
Rectangle GetItemPosRect( sal_uInt16 nPos ) const;
- // retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
+ /// Retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
Rectangle GetScrollRect() const;