diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-26 10:20:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-26 14:48:13 +0000 |
commit | 873141fb5be5fa49b56ea413bc912af33f758a0b (patch) | |
tree | e996d17f50a08c82bb469448886d0198a065d2b4 /include/vcl | |
parent | 1c78277801f377458e8cb1d04fae0578a60c69b7 (diff) |
add GtkLongPressGesture support and implement long-press in slideshow
so a long press shows the context menu to e.g. allow switching on/off
draw-on-slide mode
Change-Id: Icd6ea52d2172217794f4fc802246ccf13020e134
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/cmdevt.hxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx index 8e62e256fa73..851c5d9aec1e 100644 --- a/include/vcl/cmdevt.hxx +++ b/include/vcl/cmdevt.hxx @@ -355,6 +355,26 @@ public: double getVelocityY() const { return mnVelocityY; } }; +class VCL_DLLPUBLIC CommandLongPressData +{ + double mnX; + double mnY; +public: + CommandLongPressData() + : mnX(0) + , mnY(0) + { + } + CommandLongPressData(double nX, double nY) + : mnX(nX) + , mnY(nY) + { + } + double getX() const { return mnX; } + double getY() const { return mnY; } +}; + + // - CommandEvent - #define COMMAND_CONTEXTMENU ((sal_uInt16)1) #define COMMAND_STARTDRAG ((sal_uInt16)2) @@ -376,6 +396,7 @@ public: #define COMMAND_PREPARERECONVERSION ((sal_uInt16)19) #define COMMAND_QUERYCHARPOSITION ((sal_uInt16)20) #define COMMAND_SWIPE ((sal_uInt16)21) +#define COMMAND_LONGPRESS ((sal_uInt16)22) class VCL_DLLPUBLIC CommandEvent { @@ -404,6 +425,7 @@ public: CommandMediaData* GetMediaData() const; const CommandSelectionChangeData* GetSelectionChangeData() const; const CommandSwipeData* GetSwipeData() const; + const CommandLongPressData* GetLongPressData() const; }; inline CommandEvent::CommandEvent() @@ -494,6 +516,14 @@ inline const CommandSwipeData* CommandEvent::GetSwipeData() const return NULL; } +inline const CommandLongPressData* CommandEvent::GetLongPressData() const +{ + if( mnCommand == COMMAND_LONGPRESS ) + return (const CommandLongPressData*)(mpData); + else + return NULL; +} + #endif // INCLUDED_VCL_CMDEVT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |