From 0f33526ec27a3abcfa1ca9348a46238b1432e5e4 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Wed, 14 Sep 2016 19:33:42 +0200 Subject: put all SfxShell feature flags in one typed_flags class make values unique across modules. check if flag used in correct module. Change-Id: I656ffd3d527dd895777e14e1cc933c8b9b3f6e46 Reviewed-on: https://gerrit.libreoffice.org/28906 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- include/sfx2/shell.hxx | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'include/sfx2/shell.hxx') diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx index ffb6d27c70d9..a337aed0289d 100644 --- a/include/sfx2/shell.hxx +++ b/include/sfx2/shell.hxx @@ -26,6 +26,7 @@ #include #include #include +#include class ResMgr; namespace vcl { class Window; } @@ -93,6 +94,35 @@ enum SfxInterfaceId SFX_INTERFACE_APP = SFX_INTERFACE_SW_START, }; +enum class SfxShellFeature +{ + NONE = 0x0000, + // Writer only, class SwView + SwChildWindowLabel = 0x0001, + SwChildWindowMailmerge = 0x0002, + // Basic only, class Shell + BasicShowBrowser = 0x0004, + // Forms only, class FmFormShell + FormShowDatabaseBar = 0x0008, + FormShowField = 0x0010, + FormShowProperies = 0x0020, + FormShowExplorer = 0x0040, + FormShowFilterBar = 0x0080, + FormShowFilterNavigator = 0x0100, + FormShowTextControlBar = 0x0200, + FormTBControls = 0x0400, + FormTBMoreControls = 0x0800, + FormTBDesign = 0x1000, + FormShowDataNavigator = 0x2000, + // masks to make sure modules don't use flags from an other + SwMask = 0x0003, + BasicMask = 0x0004, + FormMask = 0x3ff8 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq); typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet); @@ -380,7 +410,7 @@ public: */ SfxViewFrame* GetFrame() const; - virtual bool HasUIFeature( sal_uInt32 nFeature ); + virtual bool HasUIFeature(SfxShellFeature nFeature) const; void UIFeatureChanged(); // Items -- cgit