25#include <com/sun/star/uno/Any.h>
26#include <com/sun/star/uno/Sequence.hxx>
27#include <osl/mutex.hxx>
29#include <officecfg/Office/Common.hxx>
34#define CFG_READONLY_DEFAULT false
60 virtual void Notify(
const Sequence< OUString >& _aPropertyNames )
override;
80 Sequence<OUString> & PropertyNames()
82 static Sequence<OUString> SINGLETON;
97 default: assert(
false);
103 utl::ConfigItem(
"Office.Common/I18N/CTL"),
105 m_bIsLoaded ( false ),
106 m_bCTLFontEnabled ( true ),
107 m_bCTLSequenceChecking ( false ),
108 m_bCTLRestricted ( false ),
109 m_bCTLTypeAndReplace ( false ),
134 Sequence< OUString > &rPropertyNames = PropertyNames();
135 OUString* pOrgNames = rPropertyNames.getArray();
136 sal_Int32 nOrgCount = rPropertyNames.getLength();
138 Sequence< OUString > aNames( nOrgCount );
139 Sequence< Any > aValues( nOrgCount );
141 OUString* pNames = aNames.getArray();
143 sal_Int32 nRealCount = 0;
145 for (
int nProp = 0; nProp < nOrgCount; nProp++ )
153 pNames[nRealCount] = pOrgNames[nProp];
164 pNames[nRealCount] = pOrgNames[nProp];
175 pNames[nRealCount] = pOrgNames[nProp];
186 pNames[nRealCount] = pOrgNames[nProp];
197 pNames[nRealCount] = pOrgNames[nProp];
207 pNames[nRealCount] = pOrgNames[nProp];
215 aNames.realloc(nRealCount);
216 aValues.realloc(nRealCount);
224 Sequence< OUString >& rPropertyNames = PropertyNames();
225 if ( !rPropertyNames.hasElements() )
229 "CTLSequenceChecking",
232 "CTLSequenceCheckingRestricted",
233 "CTLSequenceCheckingTypeAndReplace" };
239 const sal_Bool* pROStates = aROStates.getConstArray();
240 assert(aValues.getLength() == rPropertyNames.getLength() &&
"GetProperties failed");
241 assert(aROStates.getLength() == rPropertyNames.getLength() &&
"GetReadOnlyStates failed");
242 if ( aValues.getLength() == rPropertyNames.getLength() && aROStates.getLength() == rPropertyNames.getLength() )
247 for (
int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ )
249 if (
pValues[nProp].hasValue() )
251 if (
pValues[nProp] >>= bValue )
333 std::weak_ptr<SvtCTLOptions_Impl> g_pCTLOptions;
335 osl::Mutex& CTLMutex()
345 ::osl::MutexGuard aGuard( CTLMutex() );
347 m_pImpl = g_pCTLOptions.lock();
350 m_pImpl = std::make_shared<SvtCTLOptions_Impl>();
355 if( !bDontLoad && !
m_pImpl->IsLoaded() )
365 ::osl::MutexGuard aGuard( CTLMutex() );
374 m_pImpl->SetCTLFontEnabled( _bEnabled );
379 return officecfg::Office::Common::I18N::CTL::CTLFont::get();
385 m_pImpl->SetCTLSequenceChecking(_bEnabled);
390 return officecfg::Office::Common::I18N::CTL::CTLSequenceChecking::get();
396 m_pImpl->SetCTLSequenceCheckingRestricted(_bEnable);
401 return officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get();
407 m_pImpl->SetCTLSequenceCheckingTypeAndReplace(_bEnable);
412 return officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingTypeAndReplace::get();
418 m_pImpl->SetCTLCursorMovement( _eMovement );
429 m_pImpl->SetCTLTextNumerals( _eNumerals );
442 return m_pImpl->IsReadOnly(eOption);
const PropertyValue * pValues
static void holdConfigItem(EItem eItem)
void SetCTLSequenceChecking(bool _bEnabled)
bool m_bROCTLSequenceChecking
bool m_bROCTLTypeAndReplace
bool m_bROCTLCursorMovement
virtual void ImplCommit() override
void SetCTLSequenceCheckingRestricted(bool _bEnable)
bool m_bCTLSequenceChecking
void SetCTLSequenceCheckingTypeAndReplace(bool _bEnable)
bool IsReadOnly(SvtCTLOptions::EOption eOption) const
bool m_bCTLTypeAndReplace
SvtCTLOptions::CursorMovement m_eCTLCursorMovement
void SetCTLCursorMovement(SvtCTLOptions::CursorMovement _eMovement)
bool m_bROCTLTextNumerals
SvtCTLOptions::TextNumerals m_eCTLTextNumerals
void SetCTLFontEnabled(bool _bEnabled)
virtual ~SvtCTLOptions_Impl() override
virtual void Notify(const Sequence< OUString > &_aPropertyNames) override
void SetCTLTextNumerals(SvtCTLOptions::TextNumerals _eNumerals)
void SetCTLTextNumerals(TextNumerals _eNumerals)
void SetCTLSequenceCheckingTypeAndReplace(bool _bEnable)
static bool IsCTLFontEnabled()
static bool IsCTLSequenceCheckingTypeAndReplace()
void SetCTLCursorMovement(CursorMovement _eMovement)
SvtCTLOptions(bool bDontLoad=false)
static CursorMovement GetCTLCursorMovement()
static TextNumerals GetCTLTextNumerals()
std::shared_ptr< SvtCTLOptions_Impl > m_pImpl
bool IsReadOnly(EOption eOption) const
static bool IsCTLSequenceChecking()
@ E_CTLSEQUENCECHECKINGTYPEANDREPLACE
@ E_CTLSEQUENCECHECKINGRESTRICTED
static bool IsCTLSequenceCheckingRestricted()
void SetCTLSequenceChecking(bool _bEnabled)
void SetCTLFontEnabled(bool _bEnabled)
virtual ~SvtCTLOptions() override
void SetCTLSequenceCheckingRestricted(bool _bEnable)
static bool PutProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues, bool bAllLocales)
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
css::uno::Sequence< sal_Bool > GetReadOnlyStates(const css::uno::Sequence< OUString > &rNames)
void NotifyListeners(ConfigurationHints nHint)
#define CFG_READONLY_DEFAULT