diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-14 19:33:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-14 20:05:29 +0000 |
commit | 0f33526ec27a3abcfa1ca9348a46238b1432e5e4 (patch) | |
tree | 07b13b44a6c106275593fa7351f12dda62be9b68 /include | |
parent | bee4ff508a456a1552aacdf6fc838b8b7cffb9ec (diff) |
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 <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/objface.hxx | 8 | ||||
-rw-r--r-- | include/sfx2/shell.hxx | 32 | ||||
-rw-r--r-- | include/svx/fmshell.hxx | 2 |
3 files changed, 36 insertions, 6 deletions
diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx index babbc9f0464a..a0dfc169b744 100644 --- a/include/sfx2/objface.hxx +++ b/include/sfx2/objface.hxx @@ -65,16 +65,16 @@ public: const SfxInterface* GetGenoType() const { return pGenoType; } void RegisterObjectBar(sal_uInt16, sal_uInt32 nResId); - void RegisterObjectBar(sal_uInt16, sal_uInt32 nResId, sal_uInt32 nFeature); + void RegisterObjectBar(sal_uInt16, sal_uInt32 nResId, SfxShellFeature nFeature); void RegisterChildWindow(sal_uInt16, bool bContext = false); - void RegisterChildWindow(sal_uInt16, bool bContext, sal_uInt32 nFeature); + void RegisterChildWindow(sal_uInt16, bool bContext, SfxShellFeature nFeature); void RegisterStatusBar(sal_uInt32 nResId); sal_uInt32 GetObjectBarId(sal_uInt16 nNo) const; sal_uInt16 GetObjectBarPos( sal_uInt16 nNo ) const; - sal_uInt32 GetObjectBarFeature( sal_uInt16 nNo ) const; + SfxShellFeature GetObjectBarFeature(sal_uInt16 nNo) const; sal_uInt16 GetObjectBarCount() const; bool IsObjectBarVisible( sal_uInt16 nNo) const; - sal_uInt32 GetChildWindowFeature( sal_uInt16 nNo ) const; + SfxShellFeature GetChildWindowFeature(sal_uInt16 nNo) const; sal_uInt32 GetChildWindowId( sal_uInt16 nNo ) const; sal_uInt16 GetChildWindowCount() const; void RegisterPopupMenu( const OUString& ); 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 <sfx2/dllapi.h> #include <sfx2/sfxuno.hxx> #include <svl/SfxBroadcaster.hxx> +#include <o3tl/typed_flags_set.hxx> 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<SfxShellFeature> : is_typed_flags<SfxShellFeature, 0x3fff> {}; +} 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 diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx index 82a289757456..05def09f75c4 100644 --- a/include/svx/fmshell.hxx +++ b/include/svx/fmshell.hxx @@ -100,7 +100,7 @@ public: void Execute( SfxRequest& ); void GetState( SfxItemSet& ); - virtual bool HasUIFeature( sal_uInt32 nFeature ) override; + virtual bool HasUIFeature(SfxShellFeature nFeature) const override; void ExecuteTextAttribute( SfxRequest& ); void GetTextAttributeState( SfxItemSet& ); |