summaryrefslogtreecommitdiff
path: root/include/vcl/salnativewidgets.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-20 13:29:57 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-05-21 06:40:36 +0000
commitebdba869de1de51b4cc7ca24c1a6a639d44de1bf (patch)
treea51965a28861f7e82dd2f55cf88be251a67f0347 /include/vcl/salnativewidgets.hxx
parent5bf6fecde772d1fb35645fe217e6fe3b5b5ac918 (diff)
convert TABITEM constants to scoped enum
Change-Id: Ia16127a7d97ef7db59bd2b0e6b8d14d8625bc526 Reviewed-on: https://gerrit.libreoffice.org/15827 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/vcl/salnativewidgets.hxx')
-rw-r--r--include/vcl/salnativewidgets.hxx30
1 files changed, 19 insertions, 11 deletions
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 6cab0bad52a4..5b0bda7d45bc 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -361,32 +361,40 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue
*/
/* TABITEM constants are OR-ed together */
-#define TABITEM_LEFTALIGNED 0x001 // the tabitem is aligned with the left border of the TabControl
-#define TABITEM_RIGHTALIGNED 0x002 // the tabitem is aligned with the right border of the TabControl
-#define TABITEM_FIRST_IN_GROUP 0x004 // the tabitem is the first in group of tabitems
-#define TABITEM_LAST_IN_GROUP 0x008 // the tabitem is the last in group of tabitems
+enum class TabitemFlags
+{
+ NONE = 0x00,
+ LeftAligned = 0x01, // the tabitem is aligned with the left border of the TabControl
+ RightAligned = 0x02, // the tabitem is aligned with the right border of the TabControl
+ FirstInGroup = 0x04, // the tabitem is the first in group of tabitems
+ LastInGroup = 0x08, // the tabitem is the last in group of tabitems
+};
+namespace o3tl
+{
+ template<> struct typed_flags<TabitemFlags> : is_typed_flags<TabitemFlags, 0x0f> {};
+}
class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
{
public:
- unsigned int mnAlignment;
+ TabitemFlags mnAlignment;
Rectangle maContentRect;
TabitemValue(const Rectangle &rContentRect)
: ImplControlValue( CTRL_TAB_ITEM, BUTTONVALUE_DONTKNOW, 0 )
- , mnAlignment(0)
+ , mnAlignment(TabitemFlags::NONE)
, maContentRect(rContentRect)
{
}
virtual ~TabitemValue();
virtual TabitemValue* clone() const SAL_OVERRIDE;
- bool isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
- bool isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+ bool isLeftAligned() const { return bool(mnAlignment & TabitemFlags::LeftAligned); }
+ bool isRightAligned() const { return bool(mnAlignment & TabitemFlags::RightAligned); }
bool isBothAligned() const { return isLeftAligned() && isRightAligned(); }
- bool isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
- bool isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
- bool isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+ bool isNotAligned() const { return !(mnAlignment & (TabitemFlags::LeftAligned | TabitemFlags::RightAligned)); }
+ bool isFirst() const { return bool(mnAlignment & TabitemFlags::FirstInGroup); }
+ bool isLast() const { return bool(mnAlignment & TabitemFlags::LastInGroup); }
const Rectangle& getContentRect() const { return maContentRect; }
};