summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/vcl/commandevent.hxx39
-rw-r--r--include/vcl/textdata.hxx6
2 files changed, 28 insertions, 17 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; }
diff --git a/include/vcl/textdata.hxx b/include/vcl/textdata.hxx
index b982b1ecf74e..7339f0f876b4 100644
--- a/include/vcl/textdata.hxx
+++ b/include/vcl/textdata.hxx
@@ -24,6 +24,8 @@
#include <svl/smplhint.hxx>
#include <vcl/dllapi.h>
+enum class ExtTextInputAttr;
+
// for Notify, if all paragraphs were deleted
#define TEXT_PARA_ALL SAL_MAX_UINT32
#define TEXT_INDEX_ALL SAL_MAX_INT32
@@ -138,7 +140,7 @@ public:
struct TEIMEInfos
{
OUString aOldTextAfterStartPos;
- sal_uInt16* pAttribs;
+ ExtTextInputAttr* pAttribs;
TextPaM aPos;
sal_Int32 nLen;
bool bCursor;
@@ -147,7 +149,7 @@ struct TEIMEInfos
TEIMEInfos(const TextPaM& rPos, const OUString& rOldTextAfterStartPos);
~TEIMEInfos();
- void CopyAttribs(const sal_uInt16* pA, sal_Int32 nL);
+ void CopyAttribs(const ExtTextInputAttr* pA, sal_Int32 nL);
void DestroyAttribs();
};