summaryrefslogtreecommitdiff
path: root/include/unotools/configitem.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-30 15:29:09 +0200
committerNoel Grandin <noel@peralex.com>2015-05-06 09:01:26 +0200
commitb35828ba7dc33af81d17c8c870ec981d18a57b08 (patch)
treedb0d9185e5dbfd2bcc4d756a95e0e886f3a3999f /include/unotools/configitem.hxx
parentc8fdfc39ebf89e10bc01bf9569b29b5b4c85d40d (diff)
convert CONFIG_MODE constants to scoped enum
Change-Id: I1b0fb976e7bf8d7de06da0c30012e8bba1320498
Diffstat (limited to 'include/unotools/configitem.hxx')
-rw-r--r--include/unotools/configitem.hxx29
1 files changed, 19 insertions, 10 deletions
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 929ffd74e3bb..16a6f84b96e3 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/Reference.h>
#include <unotools/unotoolsdllapi.h>
#include <unotools/options.hxx>
+#include <o3tl/typed_flags_set.hxx>
namespace com{ namespace sun{ namespace star{
namespace uno{
@@ -42,12 +43,20 @@ namespace com{ namespace sun{ namespace star{
}
}}}
+enum class ConfigItemMode
+{
+ ImmediateUpdate = 0x00,
+ DelayedUpdate = 0x01,
+ AllLocales = 0x02,
+ ReleaseTree = 0x04,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ConfigItemMode> : is_typed_flags<ConfigItemMode, 0x07> {};
+}
+
namespace utl
{
-#define CONFIG_MODE_IMMEDIATE_UPDATE 0x00
-#define CONFIG_MODE_DELAYED_UPDATE 0x01
-#define CONFIG_MODE_ALL_LOCALES 0x02
-#define CONFIG_MODE_RELEASE_TREE 0x04
enum ConfigNameFormat
{
@@ -72,10 +81,10 @@ namespace utl
m_xHierarchyAccess;
com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
xChangeLstnr;
- sal_Int16 m_nMode;
- bool m_bIsModified;
- bool m_bEnableInternalNotification;
- sal_Int16 m_nInValueChange;
+ ConfigItemMode m_nMode;
+ bool m_bIsModified;
+ bool m_bEnableInternalNotification;
+ sal_Int16 m_nInValueChange;
void RemoveChangesListener();
void CallNotify(
@@ -107,7 +116,7 @@ namespace utl
protected:
explicit ConfigItem(const OUString &rSubTree,
- sal_Int16 nMode = CONFIG_MODE_DELAYED_UPDATE);
+ ConfigItemMode nMode = ConfigItemMode::DelayedUpdate);
void SetModified (); // mark item as modified
void ClearModified(); // reset state after commit!
@@ -173,7 +182,7 @@ namespace utl
bool IsInValueChange() const { return m_nInValueChange > 0;}
- sal_Int16 GetMode() const { return m_nMode;}
+ ConfigItemMode GetMode() const { return m_nMode;}
};
}//namespace utl
#endif // INCLUDED_UNOTOOLS_CONFIGITEM_HXX