LibreOffice Module sw (master)  1
hhcwrp.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_INC_HHCWRP_HXX
20 #define INCLUDED_SW_INC_HHCWRP_HXX
21 
22 #include <editeng/hangulhanja.hxx>
23 #include "swdllapi.h"
24 
25 class SwView;
26 class SwWrtShell;
27 struct SwConversionArgs;
28 class SwPaM;
29 
31 {
35 
36  std::unique_ptr<SwConversionArgs> m_pConvArgs;
39  sal_Int32 m_nLastPos;
42  sal_Int32 m_nUnitOffset;
43 
44  sal_uInt16 m_nPageCount;
45  sal_uInt16 m_nPageStart;
46 
50  bool const m_bIsSelection;
52  bool m_bEndDone;
53 
55  bool ConvNext_impl();
56  void FindConvText_impl();
57 
58  void ConvStart_impl( SwConversionArgs *pConvArgs, SvxSpellArea eSpell );
59  void ConvEnd_impl( SwConversionArgs const *pConvArgs );
60  bool ConvContinue_impl( SwConversionArgs *pConvArgs );
61 
62  void SelectNewUnit_impl( const sal_Int32 nUnitStart,
63  const sal_Int32 nUnitEnd );
64  void ChangeText( const OUString &rNewText,
65  const OUString& rOrigText,
66  const css::uno::Sequence< sal_Int32 > *pOffsets,
67  SwPaM *pCursor );
68  void ChangeText_impl( const OUString &rNewText, bool bKeepAttributes );
69 
70 protected:
71  virtual void GetNextPortion( OUString& rNextPortion,
72  LanguageType& rLangOfPortion,
73  bool bAllowImplicitChangesForNotConvertibleText ) override;
74  virtual void HandleNewUnit( const sal_Int32 nUnitStart,
75  const sal_Int32 nUnitEnd ) override;
76  virtual void ReplaceUnit(
77  const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd,
78  const OUString& rOrigText,
79  const OUString& rReplaceWith,
80  const css::uno::Sequence< sal_Int32 > &rOffsets,
81  ReplacementAction eAction,
82  LanguageType *pNewUnitLanguage ) override;
83 
84  virtual bool HasRubySupport() const override;
85 
86 public:
88  SwView* pView,
89  const css::uno::Reference< css::uno::XComponentContext >& rxContext,
90  LanguageType nSourceLanguage, LanguageType nTargetLanguage,
91  const vcl::Font *pTargetFont,
92  sal_Int32 nConvOptions, bool bIsInteractive,
93  bool bStart, bool bOther, bool bSelection );
94 
95  virtual ~SwHHCWrapper() override;
96 
97  void Convert();
98 };
99 
100 #endif
101 
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void HandleNewUnit(const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd)=0
SwWrtShell & m_rWrtShell
Definition: hhcwrp.hxx:34
bool const m_bIsSelection
true if only the selected text should be converted
Definition: hhcwrp.hxx:50
virtual void GetNextPortion(OUString &_rNextPortion, LanguageType &_rLangOfPortion, bool _bAllowImplicitChangesForNotConvertibleText)=0
Used by the UI to modify the document model.
Definition: wrtsh.hxx:86
sal_Int32 m_nLastPos
starting position of the last found text part (needs to be sth that gets not moved like SwPaM or SwPo...
Definition: hhcwrp.hxx:39
bool m_bStartDone
Definition: hhcwrp.hxx:51
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
SwView * m_pView
Definition: hhcwrp.hxx:32
sal_uInt16 m_nPageStart
first checked page
Definition: hhcwrp.hxx:45
sal_Int32 m_nUnitOffset
Definition: hhcwrp.hxx:42
VclPtr< vcl::Window > m_pWin
Definition: hhcwrp.hxx:33
bool m_bEndDone
Definition: hhcwrp.hxx:52
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool m_bStartChk
Definition: hhcwrp.hxx:49
bool m_bIsDrawObj
Definition: hhcwrp.hxx:47
SvxSpellArea
virtual void ReplaceUnit(const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd, const OUString &_rOrigText, const OUString &_rReplaceWith, const css::uno::Sequence< sal_Int32 > &_rOffsets, ReplacementAction _eAction, LanguageType *pNewUnitLanguage)=0
sal_uInt16 m_nPageCount
page count for progress bar
Definition: hhcwrp.hxx:44
bool m_bIsOtherContent
Definition: hhcwrp.hxx:48
virtual bool HasRubySupport() const =0
std::unique_ptr< SwConversionArgs > m_pConvArgs
object for arguments (and results) needed to find of next convertible text portion ...
Definition: hhcwrp.hxx:36
Definition: view.hxx:146