1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_HHCWRP_HXX
20 #define INCLUDED_SW_INC_HHCWRP_HXX
22 #include <editeng/hangulhanja.hxx>
23 #include <editeng/svxenum.hxx>
28 struct SwConversionArgs
;
31 class SW_DLLPUBLIC SwHHCWrapper final
: public editeng::HangulHanjaConversion
34 SwWrtShell
&m_rWrtShell
;
36 std::unique_ptr
<SwConversionArgs
> m_pConvArgs
; /**< object for arguments (and results) needed
37 to find of next convertible text portion */
39 sal_Int32 m_nLastPos
; /**< starting position of the last found text part
40 (needs to be sth that gets not moved like
41 SwPaM or SwPosition by replace operations!) */
42 sal_Int32 m_nUnitOffset
;
44 sal_uInt16 m_nPageCount
; ///< page count for progress bar
45 sal_uInt16 m_nPageStart
; ///< first checked page
48 bool m_bIsOtherContent
;
50 bool m_bIsSelection
; ///< true if only the selected text should be converted
54 /// from SvxSpellWrapper copied and modified
55 bool ConvNext_impl(); ///< former SpellNext
56 void FindConvText_impl(); ///< former FindSpellError
58 void ConvStart_impl( SwConversionArgs
*pConvArgs
, SvxSpellArea eSpell
); ///< former SpellStart
59 void ConvEnd_impl( SwConversionArgs
const *pConvArgs
); ///< former SpellEnd
60 bool ConvContinue_impl( SwConversionArgs
*pConvArgs
); ///< former SpellContinue
62 void SelectNewUnit_impl( const sal_Int32 nUnitStart
,
63 const sal_Int32 nUnitEnd
);
64 void ChangeText( const OUString
&rNewText
,
65 std::u16string_view aOrigText
,
66 const css::uno::Sequence
< sal_Int32
> *pOffsets
,
68 void ChangeText_impl( const OUString
&rNewText
, bool bKeepAttributes
);
70 virtual void GetNextPortion( OUString
& rNextPortion
,
71 LanguageType
& rLangOfPortion
,
72 bool bAllowImplicitChangesForNotConvertibleText
) override
;
73 virtual void HandleNewUnit( const sal_Int32 nUnitStart
,
74 const sal_Int32 nUnitEnd
) override
;
75 virtual void ReplaceUnit(
76 const sal_Int32 nUnitStart
, const sal_Int32 nUnitEnd
,
77 const OUString
& rOrigText
,
78 const OUString
& rReplaceWith
,
79 const css::uno::Sequence
< sal_Int32
> &rOffsets
,
80 ReplacementAction eAction
,
81 LanguageType
*pNewUnitLanguage
) override
;
83 virtual bool HasRubySupport() const override
;
88 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
89 LanguageType nSourceLanguage
, LanguageType nTargetLanguage
,
90 const vcl::Font
*pTargetFont
,
91 sal_Int32 nConvOptions
, bool bIsInteractive
,
92 bool bStart
, bool bOther
, bool bSelection
);
94 virtual ~SwHHCWrapper() COVERITY_NOEXCEPT_FALSE override
;
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */