diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-11 12:33:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-13 08:54:36 +0200 |
commit | 670b7ade84ec972d831055349e2bdbc2b1218955 (patch) | |
tree | 90e18c89c0e8d789c97eec18eb8c4285b9a37097 /include | |
parent | d61f0a8c8634827ad427ebb4609d389164c0cc79 (diff) |
convert BUTTON_DRAW constants to scoped enum
Change-Id: I6ad6558c855736a4a5268593ced9c8300235d4bd
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/button.hxx | 11 | ||||
-rw-r--r-- | include/vcl/decoview.hxx | 36 |
2 files changed, 28 insertions, 19 deletions
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index e0fc1786ba6e..0732165ff29d 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -33,6 +33,7 @@ class UserDrawEvent; class ImplCommonButtonData; +enum class DrawButtonFlags; class VCL_DLLPUBLIC Button : public Control { @@ -46,8 +47,8 @@ private: Button (const Button &) SAL_DELETED_FUNCTION; Button & operator= (const Button &) SAL_DELETED_FUNCTION; public: - SAL_DLLPRIVATE sal_uInt16 ImplGetButtonState() const; - SAL_DLLPRIVATE sal_uInt16& ImplGetButtonState(); + SAL_DLLPRIVATE DrawButtonFlags ImplGetButtonState() const; + SAL_DLLPRIVATE DrawButtonFlags& ImplGetButtonState(); SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( OUString& rText, WinBits nWinStyle, sal_uLong nDrawFlags ); SAL_DLLPRIVATE void ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize, bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags, @@ -143,7 +144,7 @@ protected: using Window::ImplInit; public: SAL_DLLPRIVATE void ImplSetDefButton( bool bSet ); - SAL_DLLPRIVATE void ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext, Rectangle& rRect, sal_uInt16 nStyle); + SAL_DLLPRIVATE void ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext, Rectangle& rRect, DrawButtonFlags nStyle); SAL_DLLPRIVATE static bool ImplHitTestPushButton(vcl::Window* pDev, const Point& rPos); SAL_DLLPRIVATE bool ImplIsDefButton() const; @@ -371,7 +372,7 @@ public: bool GetSavedValue() const { return mbSaveValue; } bool IsValueChangedFromSaved() const { return mbSaveValue != IsChecked(); } - static Image GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags ); + static Image GetRadioImage( const AllSettings& rSettings, DrawButtonFlags nFlags ); Size CalcMinimumSize( long nMaxWidth = 0 ) const; virtual Size GetOptimalSize() const SAL_OVERRIDE; @@ -482,7 +483,7 @@ public: TriState GetSavedValue() const { return meSaveValue; } bool IsValueChangedFromSaved() const { return meSaveValue != GetState(); } - static Image GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags ); + static Image GetCheckImage( const AllSettings& rSettings, DrawButtonFlags nFlags ); Size CalcMinimumSize( long nMaxWidth = 0 ) const; virtual Size GetOptimalSize() const SAL_OVERRIDE; diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx index ffe2b173ed4b..4a5bd17d7933 100644 --- a/include/vcl/decoview.hxx +++ b/include/vcl/decoview.hxx @@ -75,19 +75,27 @@ enum class DrawHighlightFrameStyle }; // Flags for DrawButton() -#define BUTTON_DRAW_DEFAULT ((sal_uInt16)0x0001) -#define BUTTON_DRAW_NOLIGHTBORDER ((sal_uInt16)0x0002) -#define BUTTON_DRAW_PRESSED ((sal_uInt16)0x0004) -#define BUTTON_DRAW_CHECKED ((sal_uInt16)0x0008) -#define BUTTON_DRAW_DONTKNOW ((sal_uInt16)0x0010) -#define BUTTON_DRAW_MONO ((sal_uInt16)0x0020) -#define BUTTON_DRAW_NOFILL ((sal_uInt16)0x0040) -#define BUTTON_DRAW_DISABLED ((sal_uInt16)0x0080) -#define BUTTON_DRAW_HIGHLIGHT ((sal_uInt16)0x0100) -#define BUTTON_DRAW_FLAT ((sal_uInt16)0x0200) -#define BUTTON_DRAW_NOLEFTLIGHTBORDER ((sal_uInt16)0x1000) -#define BUTTON_DRAW_NOTEXT ((sal_uInt16)0x2000) -#define BUTTON_DRAW_NOIMAGE ((sal_uInt16)0x4000) +enum class DrawButtonFlags +{ + NONE = 0x0000, + Default = 0x0001, + NoLightBorder = 0x0002, + Pressed = 0x0004, + Checked = 0x0008, + DontKnow = 0x0010, + Mono = 0x0020, + NoFill = 0x0040, + Disabled = 0x0080, + Highlight = 0x0100, + Flat = 0x0200, + NoLeftLightBorder = 0x1000, + NoText = 0x2000, + NoImage = 0x4000, +}; +namespace o3tl +{ + template<> struct typed_flags<DrawButtonFlags> : is_typed_flags<DrawButtonFlags, 0x73ff> {}; +} class VCL_DLLPUBLIC DecorationView { @@ -105,7 +113,7 @@ public: void DrawHighlightFrame( const Rectangle& rRect, DrawHighlightFrameStyle nStyle = DrawHighlightFrameStyle::Out, bool bTestBackground = false ); Rectangle DrawFrame( const Rectangle& rRect, DrawFrameStyle nStyle = DrawFrameStyle::Out, DrawFrameFlags nFlags = DrawFrameFlags::NONE ); - Rectangle DrawButton( const Rectangle& rRect, sal_uInt16 nStyle ); + Rectangle DrawButton( const Rectangle& rRect, DrawButtonFlags nStyle ); void DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true ); void DrawHandle(const Rectangle& rRectangle, bool bVertical = true); }; |