summaryrefslogtreecommitdiff
path: root/include/vcl/syswin.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-09 16:40:12 +0200
committerNoel Grandin <noel@peralex.com>2016-05-10 08:42:17 +0200
commitc748debd8f1c6a8c0cd202013edebd74d608ada1 (patch)
treec23fa49f1d1041407711f64667a3f6eb9e9c289c /include/vcl/syswin.hxx
parent9c7222c11c331ecd1562e963e78ab85be75b8e49 (diff)
convert WINDOWSTATE_STATE to scoped enum
Change-Id: I5448c7e46042850f18970c7613ec5a37df57bce7
Diffstat (limited to 'include/vcl/syswin.hxx')
-rw-r--r--include/vcl/syswin.hxx29
1 files changed, 18 insertions, 11 deletions
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index a85ede993b2c..fd09ad9cc692 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -63,13 +63,20 @@ namespace o3tl
template<> struct typed_flags<WindowStateMask> : is_typed_flags<WindowStateMask, 0x0f3f> {};
}
-#define WINDOWSTATE_STATE_NORMAL ((sal_uInt32)0x00000001)
-#define WINDOWSTATE_STATE_MINIMIZED ((sal_uInt32)0x00000002)
-#define WINDOWSTATE_STATE_MAXIMIZED ((sal_uInt32)0x00000004)
-#define WINDOWSTATE_STATE_ROLLUP ((sal_uInt32)0x00000008)
-#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((sal_uInt32)0x00000010)
-#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((sal_uInt32)0x00000020)
-#define WINDOWSTATE_STATE_SYSTEMMASK ((sal_uInt32)0x0000FFFF)
+enum class WindowStateState {
+ NONE = 0x0000,
+ Normal = 0x0001,
+ Minimized = 0x0002,
+ Maximized = 0x0004,
+ Rollup = 0x0008,
+ MaximizedHorz = 0x0010,
+ MaximizedVert = 0x0020,
+ SystemMask = 0xffff
+};
+namespace o3tl
+{
+ template<> struct typed_flags<WindowStateState> : is_typed_flags<WindowStateState, 0xffff> {};
+}
class VCL_PLUGIN_PUBLIC WindowStateData
{
@@ -83,7 +90,7 @@ private:
int mnMaximizedY;
unsigned int mnMaximizedWidth;
unsigned int mnMaximizedHeight;
- sal_uInt32 mnState;
+ WindowStateState mnState;
public:
WindowStateData()
@@ -96,7 +103,7 @@ public:
, mnMaximizedY(0)
, mnMaximizedWidth(0)
, mnMaximizedHeight(0)
- , mnState(0)
+ , mnState(WindowStateState::NONE)
{
}
@@ -111,8 +118,8 @@ public:
unsigned int GetWidth() const { return mnWidth; }
void SetHeight( unsigned int nHeight ) { mnHeight = nHeight; }
unsigned int GetHeight() const { return mnHeight; }
- void SetState( sal_uInt32 nState ) { mnState = nState; }
- sal_uInt32 GetState() const { return mnState; }
+ void SetState( WindowStateState nState ) { mnState = nState; }
+ WindowStateState GetState() const { return mnState; }
void SetMaximizedX( int nRX ) { mnMaximizedX = nRX; }
int GetMaximizedX() const { return mnMaximizedX; }
void SetMaximizedY( int nRY ) { mnMaximizedY = nRY; }