diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-09 17:07:54 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-11 07:14:34 +0000 |
commit | 63ba54a168dbc777cdcec2393be476bdd5f79bc1 (patch) | |
tree | 48de29007d02ba4a982a50a1bd0138460e215c23 /include/vcl/commandevent.hxx | |
parent | 7b9ea3348ac08d775ae452132239853724c65a41 (diff) |
convert EXTTEXTINPUT_ATTR to scoped enum
Change-Id: I94706bdea91d367fc8c2bbd482f6b4d8f55449d7
Reviewed-on: https://gerrit.libreoffice.org/24821
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/vcl/commandevent.hxx')
-rw-r--r-- | include/vcl/commandevent.hxx | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx index 9670aeae0ad3..ba0542a48bc4 100644 --- a/include/vcl/commandevent.hxx +++ b/include/vcl/commandevent.hxx @@ -25,18 +25,7 @@ #include <vcl/dllapi.h> #include <vcl/keycod.hxx> #include <vcl/font.hxx> - -#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100) -#define EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200) -#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400) -#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800) -#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000) -#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000) -#define EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000) -#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000) - -#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001) -#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002) +#include <o3tl/typed_flags_set.hxx> class CommandExtTextInputData; class CommandWheelData; @@ -49,6 +38,26 @@ class CommandSwipeData; class CommandLongPressData; enum class CommandEventId; +enum class ExtTextInputAttr { + NONE = 0x0000, + GrayWaveline = 0x0100, + Underline = 0x0200, + BoldUnderline = 0x0400, + DottedUnderline = 0x0800, + DashDotUnderline = 0x1000, + Highlight = 0x2000, + RedText = 0x4000, + HalfToneText = 0x8000 +}; +namespace o3tl +{ + template<> struct typed_flags<ExtTextInputAttr> : is_typed_flags<ExtTextInputAttr, 0xff00> {}; +} + +#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001) +#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002) + + class VCL_DLLPUBLIC CommandEvent { private: @@ -82,14 +91,14 @@ class VCL_DLLPUBLIC CommandExtTextInputData { private: OUString maText; - sal_uInt16* mpTextAttr; + ExtTextInputAttr* mpTextAttr; sal_Int32 mnCursorPos; sal_uInt16 mnCursorFlags; bool mbOnlyCursor; public: CommandExtTextInputData( const OUString& rText, - const sal_uInt16* pTextAttr, + const ExtTextInputAttr* pTextAttr, sal_Int32 nCursorPos, sal_uInt16 nCursorFlags, bool bOnlyCursor ); @@ -97,7 +106,7 @@ public: ~CommandExtTextInputData(); const OUString& GetText() const { return maText; } - const sal_uInt16* GetTextAttr() const { return mpTextAttr; } + const ExtTextInputAttr* GetTextAttr() const { return mpTextAttr; } sal_Int32 GetCursorPos() const { return mnCursorPos; } bool IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; } |