20#ifndef INCLUDED_SW_INC_BREAKIT_HXX
21#define INCLUDED_SW_INC_BREAKIT_HXX
25#include <com/sun/star/uno/Reference.h>
26#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
36 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
37 css::uno::Reference<css::i18n::XBreakIterator>
m_xBreak;
52 explicit SwBreakIt(css::uno::Reference<css::uno::XComponentContext> xContext);
57 const css::uno::Reference< css::uno::XComponentContext > & rxContext);
58 static void Delete_();
63 css::uno::Reference< css::i18n::XBreakIterator >
const &
GetBreakIter()
const
70 if (!m_xLanguageTag || m_xLanguageTag->getLanguageType() != aLang)
72 return m_xLanguageTag->getLocale();
81 if (!m_xLanguageTag || m_xLanguageTag->getLanguageType() != rLanguageTag.
getLanguageType())
82 GetLocale_(rLanguageTag);
83 return m_xLanguageTag->getLocale();
88 if (!m_xLanguageTag || m_xLanguageTag->getLanguageType() != aLang)
90 return *m_xLanguageTag;
99 if (!m_xLanguageTag || m_xLanguageTag->getLanguageType() != rLanguageTag.
getLanguageType())
100 GetLocale_( rLanguageTag );
101 return *m_xLanguageTag;
106 if (!m_oForbidden || m_aForbiddenLang != aLang)
107 GetForbidden_( aLang );
108 return *m_oForbidden;
111 sal_uInt16 GetRealScriptOfText(
const OUString& rText, sal_Int32 nPos )
const;
112 SvtScriptType GetAllScriptsOfText(
const OUString& rText )
const;
114 sal_Int32 getGraphemeCount(
const OUString& rStr,
115 sal_Int32 nStart, sal_Int32 nEnd)
const;
118 return getGraphemeCount(rStr, 0, rStr.getLength());
122#define SW_BREAKITER() SwBreakIt::Get()
SW_DLLPUBLIC SwBreakIt * g_pBreakIt
LanguageType getLanguageType(bool bResolveSystem=true) const
const css::i18n::ForbiddenCharacters & GetForbidden(const LanguageType aLang)
sal_Int32 getGraphemeCount(const OUString &rStr) const
const LanguageTag & GetLanguageTag(const LanguageTag &rLanguageTag)
std::optional< css::i18n::ForbiddenCharacters > m_oForbidden
const css::lang::Locale & GetLocale(const LanguageTag &rLanguageTag)
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
SwBreakIt(SwBreakIt const &)=delete
SwBreakIt & operator=(SwBreakIt const &)=delete
const css::lang::Locale & GetLocale(const LanguageType aLang)
LanguageType m_aForbiddenLang
language of the current forbiddenChar struct
std::unique_ptr< LanguageTag > m_xLanguageTag
language tag of the current locale
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::i18n::XBreakIterator > m_xBreak
SwBreakIt(css::uno::Reference< css::uno::XComponentContext > xContext)
const LanguageTag & GetLanguageTag(const LanguageType aLang)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)