summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-09-22 11:45:37 +0200
committerJan Holesovsky <kendy@collabora.com>2014-09-22 11:57:00 +0200
commit8da21eca455134a1d017893a9b1d26f827fba185 (patch)
treeff6012cf56cc67eaf9b2ea37fe24249adeebca11 /include
parentb66dc3cd84c7031a0df75e9d782edebbaca6fdf1 (diff)
vcl: Allow creation of button content from action name (.uno: commands).
Change-Id: If4b2aef59d45a848fb77de9e1b7bf80d49548a75
Diffstat (limited to 'include')
-rw-r--r--include/vcl/builder.hxx11
-rw-r--r--include/vcl/menu.hxx3
-rw-r--r--include/vcl/syswin.hxx2
3 files changed, 13 insertions, 3 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index baa77d367f54..f9adddb84585 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -29,6 +29,7 @@
#include <boost/ptr_container/ptr_map.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
class ListBox;
class NumericFormatter;
@@ -258,7 +259,7 @@ private:
public:
VclBuilder(::Window *pParent, const OUString& sUIRootDir, const OUString& sUIFile,
const 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>());
+ const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
~VclBuilder();
::Window *get_widget_root();
//sID must exist and be of type T
@@ -324,6 +325,14 @@ public:
static void reorderWithinParent(std::vector< ::Window*>& rChilds, bool bIsButtonBox);
static void reorderWithinParent(::Window &rWindow, sal_uInt16 nNewPosition);
+ /// Get label of the command (like of .uno:Save) from the description service
+ static OUString getCommandLabel(const OUString& rCommand, const css::uno::Reference<css::uno::XComponentContext>& rContext, const OUString& rModuleId);
+
+ /// Get image of the command (like of .uno:Save) from the description service
+ static Image getCommandImage(const OUString& rCommand, bool bLarge,
+ const css::uno::Reference<css::uno::XComponentContext>& rContext, const css::uno::Reference<css::frame::XFrame>& rFrame,
+ const OUString& rModuleId);
+
css::uno::Reference<css::frame::XFrame> getFrame() { return m_xFrame; }
private:
::Window *insertObject(::Window *pParent,
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index de5dea0c101d..77313014bde8 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -29,6 +29,7 @@
#include <vcl/bitmapex.hxx>
#include <vcl/keycod.hxx>
#include <vcl/vclevent.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/uno/Reference.hxx>
struct ImplSVEvent;
@@ -407,7 +408,7 @@ class VCL_DLLPUBLIC MenuBar : public Menu
friend class MenuFloatingWindow;
friend class SystemWindow;
- SAL_DLLPRIVATE static Window* ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
+ SAL_DLLPRIVATE static Window* ImplCreate(Window* pParent, Window* pWindow, MenuBar* pMenu, const css::uno::Reference<css::frame::XFrame> &rFrame);
SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, bool bDelete );
SAL_DLLPRIVATE bool ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu = true );
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index ce79e114a8a1..382e9b1e2c03 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -224,7 +224,7 @@ public:
void SetWindowState(const OString& rStr);
OString GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const;
- void SetMenuBar( MenuBar* pMenuBar );
+ void SetMenuBar(MenuBar* pMenuBar, const css::uno::Reference<css::frame::XFrame>& rFrame = css::uno::Reference<css::frame::XFrame>());
MenuBar* GetMenuBar() const { return mpMenuBar; }
void SetMenuBarMode( sal_uInt16 nMode );
sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }