1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <i18nutil/i18nutildllapi.h>
11 #include <rtl/ustring.hxx>
17 struct DirectionChange
19 sal_Int32 m_nStartIndex
= 0;
20 sal_Int32 m_nEndIndex
= 0;
21 sal_uInt8 m_nLevel
= 0;
22 bool m_bHasEmbeddedStrongLTR
= false;
27 sal_Int32 m_nStartIndex
= 0;
28 sal_Int32 m_nEndIndex
= 0;
29 sal_Int16 m_nScriptType
= 0;
32 class I18NUTIL_DLLPUBLIC DirectionChangeScanner
35 virtual ~DirectionChangeScanner() = default;
37 virtual bool AtEnd() const = 0;
38 virtual void Advance() = 0;
39 virtual DirectionChange
Peek() const = 0;
40 virtual sal_uInt8
GetLevelAt(sal_Int32 nIndex
) const = 0;
41 virtual void Reset() = 0;
44 class I18NUTIL_DLLPUBLIC ScriptChangeScanner
47 virtual ~ScriptChangeScanner() = default;
49 virtual bool AtEnd() const = 0;
50 virtual void Advance() = 0;
51 virtual ScriptChange
Peek() const = 0;
54 I18NUTIL_DLLPUBLIC
std::unique_ptr
<DirectionChangeScanner
>
55 MakeDirectionChangeScanner(const OUString
& rWord
, sal_uInt8 nInitialDirection
);
57 I18NUTIL_DLLPUBLIC
std::unique_ptr
<ScriptChangeScanner
>
58 MakeScriptChangeScanner(const OUString
& rWord
, sal_Int16 nDefaultScriptType
,
59 DirectionChangeScanner
& rDirScanner
);
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */