diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-10 13:34:35 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-11-11 06:17:36 +0000 |
commit | a52f29216d2a70ea4a0a0347d71273cdbf8830e3 (patch) | |
tree | 3884a4aedca33777c43a18b40313ab125b1b4c30 /include | |
parent | vcl: make ImplDrawOutDevDirect a protected function in OutputDevice (diff) | |
download | core-a52f29216d2a70ea4a0a0347d71273cdbf8830e3.tar.gz core-a52f29216d2a70ea4a0a0347d71273cdbf8830e3.zip |
fdo#84938: replace HELPMODE_ constants with enum
Change-Id: I44be5567e84cdabd8b10771ea37e28b8a88cc23e
Reviewed-on: https://gerrit.libreoffice.org/12333
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/event.hxx | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx index 76e609dd0211..14181cc4e2f9 100644 --- a/include/vcl/event.hxx +++ b/include/vcl/event.hxx @@ -244,44 +244,51 @@ public: // - HelpEvent - - -#define HELPMODE_CONTEXT ((sal_uInt16)0x0001) -#define HELPMODE_EXTENDED ((sal_uInt16)0x0002) -#define HELPMODE_BALLOON ((sal_uInt16)0x0004) -#define HELPMODE_QUICK ((sal_uInt16)0x0008) +enum class HelpEventMode +{ + NONE = 0x0000, + CONTEXT = 0x0001, + EXTENDED = 0x0002, + BALLOON = 0x0004, + QUICK = 0x0008 +}; +namespace o3tl +{ + template<> struct typed_flags<HelpEventMode> : is_typed_flags<HelpEventMode, 0x0f> {}; +} class VCL_DLLPUBLIC HelpEvent { private: Point maPos; - sal_uInt16 mnMode; + HelpEventMode mnMode; bool mbKeyboardActivated; public: explicit HelpEvent(); - explicit HelpEvent( sal_uInt16 nHelpMode ); - explicit HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode ); + explicit HelpEvent( HelpEventMode nHelpMode ); + explicit HelpEvent( const Point& rMousePos, HelpEventMode nHelpMode ); const Point& GetMousePosPixel() const { return maPos; } - sal_uInt16 GetMode() const { return mnMode; } + HelpEventMode GetMode() const { return mnMode; } bool KeyboardActivated() const { return mbKeyboardActivated; } void SetKeyboardActivated( bool bKeyboard ) { mbKeyboardActivated = bKeyboard; } }; inline HelpEvent::HelpEvent() { - mnMode = HELPMODE_CONTEXT; + mnMode = HelpEventMode::CONTEXT; mbKeyboardActivated = true; } -inline HelpEvent::HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode ) : +inline HelpEvent::HelpEvent( const Point& rMousePos, HelpEventMode nHelpMode ) : maPos( rMousePos ) { mnMode = nHelpMode; mbKeyboardActivated = false; } -inline HelpEvent::HelpEvent( sal_uInt16 nHelpMode ) +inline HelpEvent::HelpEvent( HelpEventMode nHelpMode ) { mnMode = nHelpMode; mbKeyboardActivated = true; @@ -296,8 +303,8 @@ class VCL_DLLPUBLIC UserDrawEvent private: OutputDevice* mpOutDev; Rectangle maOutRect; - sal_uInt16 mnItemId; - sal_uInt16 mnStyle; + sal_uInt16 mnItemId; + sal_uInt16 mnStyle; public: UserDrawEvent(); |