summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-15 09:36:39 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-04-17 07:21:08 +0000
commita7b7c64afc523cfd9ff4e724b3efbec6567fc1c8 (patch)
tree52fd05ef3292f3dab172864cbc3be96a8d44a9d0 /include/svl
parentadd7eeb7dbd0eefa0c5ae5430490864079add801 (diff)
convert SCRIPTTYPE_ constants to scoped enum
Change-Id: I5be3980ac865162d8d7626556ca47eca4b0ee433 Reviewed-on: https://gerrit.libreoffice.org/15344 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/languageoptions.hxx48
1 files changed, 34 insertions, 14 deletions
diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx
index 8c0ea1af24e8..693a12407d00 100644
--- a/include/svl/languageoptions.hxx
+++ b/include/svl/languageoptions.hxx
@@ -24,13 +24,24 @@
#include <unotools/configitem.hxx>
#include <unotools/options.hxx>
#include <i18nlangtag/lang.h>
+#include <o3tl/typed_flags_set.hxx>
// class SvtLanguageOptions ----------------------------------------------------
-// these defines can be ored
-#define SCRIPTTYPE_LATIN 0x01
-#define SCRIPTTYPE_ASIAN 0x02
-#define SCRIPTTYPE_COMPLEX 0x04
+// these defines can be ORed
+// note these values DO NOT match the values in com::sun::star::i18n::ScriptType
+enum class SvtScriptType
+{
+ NONE = 0x00,
+ LATIN = 0x01,
+ ASIAN = 0x02,
+ COMPLEX = 0x04,
+ UNKNOWN = 0x08 // (only used in SC) if type has not been determined yet
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SvtScriptType> : is_typed_flags<SvtScriptType, 0x0f> {};
+}
class SvtCJKOptions;
class SvtCTLOptions;
@@ -71,24 +82,33 @@ public:
bool IsVerticalTextEnabled() const;
bool IsAsianTypographyEnabled() const;
bool IsJapaneseFindEnabled() const;
- void SetAll( bool _bSet );
+ void SetAll( bool _bSet );
bool IsAnyEnabled() const;
// CTL options
- void SetCTLFontEnabled( bool _bEnabled );
+ void SetCTLFontEnabled( bool _bEnabled );
bool IsCTLFontEnabled() const;
- void SetCTLSequenceChecking( bool _bEnabled );
+ void SetCTLSequenceChecking( bool _bEnabled );
- void SetCTLSequenceCheckingRestricted( bool _bEnable );
+ void SetCTLSequenceCheckingRestricted( bool _bEnable );
- void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable );
+ void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable );
bool IsReadOnly(EOption eOption) const;
// returns for a language the scripttype
- static sal_uInt16 GetScriptTypeOfLanguage( sal_uInt16 nLang );
+ static SvtScriptType GetScriptTypeOfLanguage( sal_uInt16 nLang );
+
+ // convert from css::i18n::ScriptType constants to SvtScriptType
+ static SvtScriptType FromI18NToSvtScriptType( sal_Int16 nI18NType );
+
+ static sal_Int16 FromSvtScriptTypeToI18N( SvtScriptType nI18NType );
+
+ static sal_Int16 GetI18NScriptTypeOfLanguage( sal_uInt16 nLang );
+
};
+
/** #i42730# Gives access to the Windows 16bit system locale
*/
class SVL_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem
@@ -96,7 +116,7 @@ class SVL_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem
private:
OUString m_sWin16SystemLocale;
- bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType) const;
+ bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType) const;
virtual void ImplCommit() SAL_OVERRIDE;
@@ -106,10 +126,10 @@ public:
virtual void Notify( const com::sun::star::uno::Sequence< OUString >& rPropertyNames ) SAL_OVERRIDE;
- LanguageType GetWin16SystemLanguage() const;
+ LanguageType GetWin16SystemLanguage() const;
- bool isCTLKeyboardLayoutInstalled() const;
- bool isCJKKeyboardLayoutInstalled() const;
+ bool isCTLKeyboardLayoutInstalled() const;
+ bool isCJKKeyboardLayoutInstalled() const;
};
#endif // INCLUDED_SVL_LANGUAGEOPTIONS_HXX