21#include <com/sun/star/i18n/XCharacterClassification.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
32namespace i18npool {
class Transliteration_casemapping; }
64class cclass_Unicode final :
public cppu::WeakImplHelper < css::i18n::XCharacterClassification, css::lang::XServiceInfo >
67 cclass_Unicode(css::uno::Reference < css::uno::XComponentContext > xContext );
71 const css::lang::Locale& rLocale )
override;
73 const css::lang::Locale& rLocale )
override;
75 const css::lang::Locale& rLocale )
override;
76 virtual sal_Int16 SAL_CALL
getType(
const OUString&
Text, sal_Int32
nPos )
override;
78 virtual sal_Int16 SAL_CALL
getScript(
const OUString&
Text, sal_Int32
nPos )
override;
80 const css::lang::Locale& rLocale )
override;
82 const css::lang::Locale& rLocale )
override;
84 const css::lang::Locale& rLocale, sal_Int32 nStartCharFlags,
const OUString& userDefinedCharactersStart,
85 sal_Int32 nContCharFlags,
const OUString& userDefinedCharactersCont )
override;
87 sal_Int32
nPos,
const css::lang::Locale& rLocale, sal_Int32 nStartCharFlags,
88 const OUString& userDefinedCharactersStart, sal_Int32 nContCharFlags,
89 const OUString& userDefinedCharactersCont )
override;
128 css::uno::Reference < css::uno::XComponentContext >
m_xContext;
133 css::uno::Reference < css::i18n::XNativeNumberSupplier >
xNatNumSup;
138 std::unique_ptr<ParserFlags[]>
pCont;
161 void setupParserTable(
const css::lang::Locale& rLocale, sal_Int32 startCharTokenType,
162 const OUString& userDefinedCharactersStart, sal_Int32 contCharTokenType,
163 const OUString& userDefinedCharactersCont );
166 void initParserTable(
const css::lang::Locale& rLocale, sal_Int32 startCharTokenType,
167 const OUString& userDefinedCharactersStart, sal_Int32 contCharTokenType,
168 const OUString& userDefinedCharactersCont );
174 void parseText( css::i18n::ParseResult& r,
const OUString& rText, sal_Int32 nPos,
175 sal_Int32 nTokenType = 0xffffffff );
181 static sal_Int32
getCharType( std::u16string_view Text, sal_Int32 *nPos, sal_Int32 increment);
ParserFlags
Flag values of table.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
cclass_Unicode(css::uno::Reference< css::uno::XComponentContext > xContext)
virtual OUString SAL_CALL getImplementationName() override
virtual OUString SAL_CALL toUpper(const OUString &Text, sal_Int32 nPos, sal_Int32 nCount, const css::lang::Locale &rLocale) override
virtual OUString SAL_CALL toLower(const OUString &Text, sal_Int32 nPos, sal_Int32 nCount, const css::lang::Locale &rLocale) override
virtual css::i18n::ParseResult SAL_CALL parseAnyToken(const OUString &Text, sal_Int32 nPos, const css::lang::Locale &rLocale, sal_Int32 nStartCharFlags, const OUString &userDefinedCharactersStart, sal_Int32 nContCharFlags, const OUString &userDefinedCharactersCont) override
css::lang::Locale aParserLocale
used for parser only
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL toTitle(const OUString &Text, sal_Int32 nPos, sal_Int32 nCount, const css::lang::Locale &rLocale) override
static const ParserFlags pDefaultParserTable[]
void parseText(css::i18n::ParseResult &r, const OUString &rText, sal_Int32 nPos, sal_Int32 nTokenType=0xffffffff)
Parse a text.
void setupInternational(const css::lang::Locale &rLocale)
Setup International class, new'ed only if different from existing.
virtual sal_Int32 SAL_CALL getStringType(const OUString &text, sal_Int32 nPos, sal_Int32 nCount, const css::lang::Locale &rLocale) override
static const sal_uInt8 nDefCnt
std::unique_ptr< ParserFlags[]> pTable
void setupParserTable(const css::lang::Locale &rLocale, sal_Int32 startCharTokenType, const OUString &userDefinedCharactersStart, sal_Int32 contCharTokenType, const OUString &userDefinedCharactersCont)
Setup parser table. Calls initParserTable() only if needed.
rtl::Reference< Transliteration_casemapping > transToTitle
ParserFlags getStartCharsFlags(sal_uInt32 c)
Access parser table flags for user defined start characters.
sal_Unicode cDecimalSepAlt
rtl::Reference< Transliteration_casemapping > transToLower
virtual sal_Int16 SAL_CALL getCharacterDirection(const OUString &Text, sal_Int32 nPos) override
virtual css::i18n::ParseResult SAL_CALL parsePredefinedToken(sal_Int32 nTokenType, const OUString &Text, sal_Int32 nPos, const css::lang::Locale &rLocale, sal_Int32 nStartCharFlags, const OUString &userDefinedCharactersStart, sal_Int32 nContCharFlags, const OUString &userDefinedCharactersCont) override
css::uno::Reference< css::i18n::XNativeNumberSupplier > xNatNumSup
virtual sal_Int16 SAL_CALL getType(const OUString &Text, sal_Int32 nPos) override
std::unique_ptr< ParserFlags[]> pCont
ParserFlags getFlagsExtended(sal_uInt32 c, ScanState eState) const
Access parser flags via International and special definitions.
void destroyParserTable()
Destroy parser table.
virtual sal_Int16 SAL_CALL getScript(const OUString &Text, sal_Int32 nPos) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
ParserFlags getFlags(sal_uInt32 c, ScanState eState)
Access parser table flags.
std::unique_ptr< ParserFlags[]> pStart
static const sal_Unicode * StrChr(const sal_Unicode *pStr, sal_uInt32 c)
If and where c occurs in pStr.
virtual sal_Int32 SAL_CALL getCharacterType(const OUString &text, sal_Int32 nPos, const css::lang::Locale &rLocale) override
static sal_Int32 getParseTokensType(sal_uInt32 c, bool isFirst)
Get corresponding KParseTokens flag for a character.
rtl::Reference< Transliteration_casemapping > transToUpper
virtual ~cclass_Unicode() override
static const sal_Int32 pParseTokensType[]
css::uno::Reference< css::i18n::XLocaleData5 > mxLocaleData
void initParserTable(const css::lang::Locale &rLocale, sal_Int32 startCharTokenType, const OUString &userDefinedCharactersStart, sal_Int32 contCharTokenType, const OUString &userDefinedCharactersCont)
Init parser table.
static sal_Int32 getCharType(std::u16string_view Text, sal_Int32 *nPos, sal_Int32 increment)
Implementation of getCharacterType() for one single character.
@ ssIgnoreLeadingInRewind
ParserFlags getContCharsFlags(sal_Unicode c)
Access parser table flags for user defined continuation characters.
Constant values shared between i18npool and, for example, the number formatter.
const wchar_t *typedef BOOL