summaryrefslogtreecommitdiff
path: root/sfx2/source/inc/workwin.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-08 15:28:27 +0200
committerNoel Grandin <noel@peralex.com>2015-03-11 10:16:55 +0200
commit3146851b6984dff768a88770785c5573ec7f6bbb (patch)
treef9d86a684576db57e6d2baae29687f01e8f644bd /sfx2/source/inc/workwin.hxx
parentfc4b79f76cf030015c5fdc9609afc0482223d198 (diff)
convert CHILD_ constants to enum class
Change-Id: I1aca134fcc0384df4797cacafa9fbc1ed88d6617
Diffstat (limited to 'sfx2/source/inc/workwin.hxx')
-rw-r--r--sfx2/source/inc/workwin.hxx38
1 files changed, 23 insertions, 15 deletions
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index 762a2ff002e4..1d5281746f2c 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -31,6 +31,7 @@
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
+#include <o3tl/typed_flags_set.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/childwin.hxx>
@@ -49,7 +50,7 @@ struct SfxObjectBar_Impl
sal_uInt16 nMode; // special visibility flags
sal_uInt16 nPos;
sal_uInt16 nIndex;
- bool bDestroy;
+ bool bDestroy;
SfxInterface* pIFace;
SfxObjectBar_Impl() :
@@ -67,7 +68,7 @@ struct SfxObjectBar_Impl
struct SfxStatBar_Impl
{
- sal_uInt16 nId;
+ sal_uInt16 nId;
bool bOn;
bool bTemp;
@@ -79,19 +80,26 @@ struct SfxStatBar_Impl
};
+enum class SfxChildVisibility
+{
+ NOT_VISIBLE = 0,
+ ACTIVE = 1, // not disabled through HidePopups
+ NOT_HIDDEN = 2, // not disabled through HideChildWindow
+ FITS_IN = 4, // not too large for output size of the parent
+ VISIBLE = 7, // NOT_HIDDEN | ACTIVE | FITS_IN)
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SfxChildVisibility> : is_typed_flags<SfxChildVisibility, 0x07> {};
+}
-#define CHILD_NOT_VISIBLE 0
-#define CHILD_ACTIVE 1 // not disabled through HidePopups
-#define CHILD_NOT_HIDDEN 2 // not disabled through HideChildWindow
-#define CHILD_FITS_IN 4 // not too large for output size of the parent
-#define CHILD_VISIBLE (CHILD_NOT_HIDDEN | CHILD_ACTIVE | CHILD_FITS_IN)
struct SfxChild_Impl
{
- vcl::Window* pWin;
+ vcl::Window* pWin;
Size aSize;
SfxChildAlignment eAlign;
- sal_uInt16 nVisible;
+ SfxChildVisibility nVisible;
bool bResize;
bool bCanGetFocus;
bool bSetFocus;
@@ -101,20 +109,20 @@ struct SfxChild_Impl
pWin(&rChild), aSize(rSize), eAlign(eAlignment), bResize(false),
bCanGetFocus( false ), bSetFocus( false )
{
- nVisible = bIsVisible ? CHILD_VISIBLE : CHILD_NOT_VISIBLE;
+ nVisible = bIsVisible ? SfxChildVisibility::VISIBLE : SfxChildVisibility::NOT_VISIBLE;
}
};
struct SfxChildWin_Impl
{
- sal_uInt16 nSaveId; // the ChildWindow-Id
- sal_uInt16 nInterfaceId; // the current context
- sal_uInt16 nId; // current Id
+ sal_uInt16 nSaveId; // the ChildWindow-Id
+ sal_uInt16 nInterfaceId; // the current context
+ sal_uInt16 nId; // current Id
SfxChildWindow* pWin;
bool bCreate;
SfxChildWinInfo aInfo;
- SfxChild_Impl* pCli; // != 0 at direct Children
- sal_uInt16 nVisibility;
+ SfxChild_Impl* pCli; // != 0 at direct Children
+ sal_uInt16 nVisibility;
bool bEnable;
bool bDisabled;