diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-09-24 09:06:18 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-09-24 09:13:08 +0200 |
commit | 0a56da5b110d6a3329ed7ebf296856f839e9980c (patch) | |
tree | ea7645d507624c85653038f5b2d7b721335e806e /include | |
parent | 0bcd32da2efd287bbab51e335b382ec27e023644 (diff) |
vcl button: Allow automatic handling of UNO commands (like .uno:Something).
Change-Id: I71c00286dde2e5a01a7a592305c1790f1ed63a93
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/button.hxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 7a9623286569..13fd5066e7a1 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -42,7 +42,10 @@ class VCL_DLLPUBLIC Button : public Control { private: ImplCommonButtonData *mpButtonData; - Link maClickHdl; + Link maClickHdl; + + /// Command URL (like .uno:Save) in case the button should handle it. + OUString maCommand; // Copy assignment is forbidden and not implemented. SAL_DLLPRIVATE Button (const Button &); @@ -72,6 +75,9 @@ public: void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; } const Link& GetClickHdl() const { return maClickHdl; } + /// Setup handler for UNO commands so that commands like .uno:Something are handled automagically by this button. + void SetCommandHandler(const OUString& aCommand); + static OUString GetStandardText( StandardButtonType eButton ); bool SetModeImage( const Image& rImage ); @@ -87,6 +93,11 @@ public: bool IsSmallSymbol() const; void SetSmallSymbol(bool bSmall = true); virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; + +protected: + + /// Handler for click, in case we want the button to handle uno commands (.uno:Something). + static long dispatchCommandHandler(void *, void *pCaller); }; |