summaryrefslogtreecommitdiff
path: root/include/sfx2/shell.hxx
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-14 19:33:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-14 20:05:29 +0000
commit0f33526ec27a3abcfa1ca9348a46238b1432e5e4 (patch)
tree07b13b44a6c106275593fa7351f12dda62be9b68 /include/sfx2/shell.hxx
parentbee4ff508a456a1552aacdf6fc838b8b7cffb9ec (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/sfx2/shell.hxx')
-rw-r--r--include/sfx2/shell.hxx32
1 files changed, 31 insertions, 1 deletions
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