summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-31 18:39:32 +0200
committerNoel Grandin <noel@peralex.com>2015-01-07 11:20:43 +0200
commit079590c9097a9491b31f1ef1b30d67d42bd0139a (patch)
treee77fb91fbc3b4b7312bcd29875434b1d1344e3e7 /include
parente197bcc6285b69179463b5847fe8ce459806455a (diff)
fdo#84938: convert INDICATOR_ #defines to 'enum class'
and replace SalIndicatorState, it serves the same purpose Change-Id: I618b8946b8e2527883eecb13060b2256abc505b6
Diffstat (limited to 'include')
-rw-r--r--include/vcl/keycodes.hxx14
-rw-r--r--include/vcl/window.hxx8
2 files changed, 15 insertions, 7 deletions
diff --git a/include/vcl/keycodes.hxx b/include/vcl/keycodes.hxx
index 271ff61ec7a2..45adac1f6d24 100644
--- a/include/vcl/keycodes.hxx
+++ b/include/vcl/keycodes.hxx
@@ -24,6 +24,7 @@
#undef DELETE
#include <com/sun/star/awt/Key.hpp>
#include <com/sun/star/awt/KeyGroup.hpp>
+#include <o3tl/typed_flags_set.hxx>
// Key-Gruppen
#define KEYGROUP_NUM ((sal_uInt16)::com::sun::star::awt::KeyGroup::NUM)
@@ -169,9 +170,16 @@
#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
#define MOUSE_RIGHT ((sal_uInt16)0x0004)
-#define INDICATOR_CAPSLOCK 0x0001
-#define INDICATOR_NUMLOCK 0x0002
-#define INDICATOR_SCROLLLOCK 0x0004
+enum class KeyIndicatorState {
+ NONE = 0x0000,
+ CAPSLOCK = 0x0001,
+ NUMLOCK = 0x0002,
+ SCROLLLOCK = 0x0004
+};
+namespace o3tl
+{
+ template<> struct typed_flags<KeyIndicatorState> : is_typed_flags<KeyIndicatorState, 0x0007> {};
+}
#endif // INCLUDED_VCL_KEYCODES_HXX
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 3b0c0e93864c..eefc0051169a 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1437,11 +1437,11 @@ public:
Scroll Lock. Use the following mask to retrieve the state of each
indicator:
- INDICATOR_CAPS_LOCK
- INDICATOR_NUM_LOCK
- INDICATOR_SCROLL_LOCK
+ KeyIndicatorState::CAPS_LOCK
+ KeyIndicatorState::NUM_LOCK
+ KeyIndicatorState::SCROLL_LOCK
*/
- sal_uInt16 GetIndicatorState() const;
+ KeyIndicatorState GetIndicatorState() const;
void SimulateKeyPress( sal_uInt16 nKeyCode ) const;