diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-10 10:14:16 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-10 09:57:14 +0000 |
commit | 57f84e5b1f27a442981602bc428270a5ecb95959 (patch) | |
tree | fcb7b5881b50bf3fd97bfa2b7521d43d0f06fdb4 /include | |
parent | effde80f670c60986a92ca0f1c5c9922eb17908d (diff) |
Convert TOOLBOX_MENUTYPE_ to scoped enum
Change-Id: I8eb25fc274b45b8add04dfc03e4b52f130ad04de
Reviewed-on: https://gerrit.libreoffice.org/24827
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/toolbox.hxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index d559c59c7d9e..408964f3a739 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -25,6 +25,7 @@ #include <vcl/dllapi.h> #include <vcl/dockwin.hxx> #include <vcl/image.hxx> +#include <o3tl/typed_flags_set.hxx> #include <vector> #include <com/sun/star/frame/XFrame.hpp> @@ -47,9 +48,15 @@ class PopupMenu; #define TOOLBOX_MENUITEM_START ((sal_uInt16)0x1000) // defines for the menubutton -#define TOOLBOX_MENUTYPE_NONE ((sal_uInt16)0x0000) // no menu at all, scrolling by spin buttons -#define TOOLBOX_MENUTYPE_CLIPPEDITEMS ((sal_uInt16)0x0001) // menu will contain "more" indicator -#define TOOLBOX_MENUTYPE_CUSTOMIZE ((sal_uInt16)0x0002) // menu will contain "customization" and "more" indicator +enum class ToolBoxMenuType { + NONE = 0x0000, // no menu at all, scrolling by spin buttons + ClippedItems = 0x0001, // menu will contain "more" indicator + Customize = 0x0002 // menu will contain "customization" and "more" indicator +}; +namespace o3tl +{ + template<> struct typed_flags<ToolBoxMenuType> : is_typed_flags<ToolBoxMenuType, 0x0003> {}; +} // small or large force an exact toolbox size for proper alignemnt // dontcare will let the toolbox decide about its size @@ -477,8 +484,8 @@ public: // the private toolbox items will only use item ids starting from TOOLBOX_MENUITEM_START // to allow for customization of the menu the coresponding handler is called // when the menu button was clicked and before the menu is executed - void SetMenuType( sal_uInt16 aType = TOOLBOX_MENUTYPE_CUSTOMIZE ); - sal_uInt16 GetMenuType() const; + void SetMenuType( ToolBoxMenuType aType = ToolBoxMenuType::Customize ); + ToolBoxMenuType GetMenuType() const; bool IsMenuEnabled() const; PopupMenu* GetMenu() const; void UpdateCustomMenu(); |