LibreOffice Module sw (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwHHCWrapper Class Referencefinal

#include <hhcwrp.hxx>

Inheritance diagram for SwHHCWrapper:
[legend]
Collaboration diagram for SwHHCWrapper:
[legend]

Public Member Functions

 SwHHCWrapper (SwView *pView, const css::uno::Reference< css::uno::XComponentContext > &rxContext, LanguageType nSourceLanguage, LanguageType nTargetLanguage, const vcl::Font *pTargetFont, sal_Int32 nConvOptions, bool bIsInteractive, bool bStart, bool bOther, bool bSelection)
 
virtual ~SwHHCWrapper () COVERITY_NOEXCEPT_FALSE override
 
void Convert ()
 
- Public Member Functions inherited from editeng::HangulHanjaConversion
 HangulHanjaConversion (weld::Widget *pUIParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::lang::Locale &_rSourceLocale, const css::lang::Locale &_rTargetLocale, const vcl::Font *_pTargetFont, sal_Int32 nOptions, bool _bIsInteractive)
 
virtual ~HangulHanjaConversion () COVERITY_NOEXCEPT_FALSE
 
void ConvertDocument ()
 
weld::WidgetGetUIParent () const
 
LanguageType GetSourceLanguage () const
 
LanguageType GetTargetLanguage () const
 
const vcl::FontGetTargetFont () const
 
sal_Int32 GetConversionOptions () const
 
bool IsInteractive () const
 

Private Member Functions

bool ConvNext_impl ()
 from SvxSpellWrapper copied and modified More...
 
void FindConvText_impl ()
 former FindSpellError More...
 
void ConvStart_impl (SwConversionArgs *pConvArgs, SvxSpellArea eSpell)
 former SpellStart More...
 
void ConvEnd_impl (SwConversionArgs const *pConvArgs)
 former SpellEnd More...
 
bool ConvContinue_impl (SwConversionArgs *pConvArgs)
 former SpellContinue More...
 
void SelectNewUnit_impl (const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd)
 
void ChangeText (const OUString &rNewText, std::u16string_view aOrigText, const css::uno::Sequence< sal_Int32 > *pOffsets, SwPaM *pCursor)
 
void ChangeText_impl (const OUString &rNewText, bool bKeepAttributes)
 
virtual void GetNextPortion (OUString &rNextPortion, LanguageType &rLangOfPortion, bool bAllowImplicitChangesForNotConvertibleText) override
 
virtual void HandleNewUnit (const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd) override
 
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) override
 
virtual bool HasRubySupport () const override
 

Private Attributes

SwViewm_pView
 
SwWrtShellm_rWrtShell
 
std::unique_ptr< SwConversionArgsm_pConvArgs
 object for arguments (and results) needed to find of next convertible text portion More...
 
sal_Int32 m_nLastPos
 starting position of the last found text part (needs to be sth that gets not moved like SwPaM or SwPosition by replace operations!) More...
 
sal_Int32 m_nUnitOffset
 
sal_uInt16 m_nPageCount
 page count for progress bar More...
 
sal_uInt16 m_nPageStart
 first checked page More...
 
bool m_bIsDrawObj
 
bool m_bIsOtherContent
 
bool m_bStartChk
 
bool m_bIsSelection
 true if only the selected text should be converted More...
 
bool m_bStartDone
 
bool m_bEndDone
 

Additional Inherited Members

- Public Types inherited from editeng::HangulHanjaConversion
enum  ReplacementAction
 
enum  ConversionType
 
enum  ConversionDirection
 
enum  ConversionFormat
 
- Static Public Member Functions inherited from editeng::HangulHanjaConversion
static bool IsSimplified (LanguageType nLang)
 
static bool IsTraditional (LanguageType nLang)
 
static bool IsChinese (LanguageType nLang)
 
static void SetUseSavedConversionDirectionState (bool bVal)
 
static bool IsUseSavedConversionDirectionState ()
 
- Public Attributes inherited from editeng::HangulHanjaConversion
 eExchange
 
 eReplacementBracketed
 
 eOriginalBracketed
 
 eReplacementAbove
 
 eOriginalAbove
 
 eReplacementBelow
 
 eOriginalBelow
 
 eConvHangulHanja
 
 eConvSimplifiedTraditional
 
 eHangulToHanja
 
 eHanjaToHangul
 
 eSimpleConversion
 
 eHangulBracketed
 
 eHanjaBracketed
 
 eRubyHanjaAbove
 
 eRubyHanjaBelow
 
 eRubyHangulAbove
 
 eRubyHangulBelow
 
virtual void GetNextPortion (OUString &_rNextPortion, LanguageType &_rLangOfPortion, bool _bAllowImplicitChangesForNotConvertibleText)=0
 
virtual void HandleNewUnit (const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd)=0
 
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
 
virtual bool HasRubySupport () const=0
 

Detailed Description

Definition at line 31 of file hhcwrp.hxx.

Constructor & Destructor Documentation

◆ SwHHCWrapper()

SwHHCWrapper::SwHHCWrapper ( SwView pView,
const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
LanguageType  nSourceLanguage,
LanguageType  nTargetLanguage,
const vcl::Font pTargetFont,
sal_Int32  nConvOptions,
bool  bIsInteractive,
bool  bStart,
bool  bOther,
bool  bSelection 
)

Definition at line 80 of file hhcwrp.cxx.

◆ ~SwHHCWrapper()

SwHHCWrapper::~SwHHCWrapper ( )
overridevirtual

Member Function Documentation

◆ ChangeText()

void SwHHCWrapper::ChangeText ( const OUString &  rNewText,
std::u16string_view  aOrigText,
const css::uno::Sequence< sal_Int32 > *  pOffsets,
SwPaM pCursor 
)
private

◆ ChangeText_impl()

void SwHHCWrapper::ChangeText_impl ( const OUString &  rNewText,
bool  bKeepAttributes 
)
private

◆ ConvContinue_impl()

bool SwHHCWrapper::ConvContinue_impl ( SwConversionArgs pConvArgs)
private

◆ ConvEnd_impl()

void SwHHCWrapper::ConvEnd_impl ( SwConversionArgs const *  pConvArgs)
private

former SpellEnd

Definition at line 666 of file hhcwrp.cxx.

References m_pView, and SwView::SpellEnd().

Referenced by Convert(), and FindConvText_impl().

◆ Convert()

void SwHHCWrapper::Convert ( )

◆ ConvNext_impl()

bool SwHHCWrapper::ConvNext_impl ( )
private

from SvxSpellWrapper copied and modified

former SpellNext

modified version of SvxSpellWrapper::SpellNext

Definition at line 595 of file hhcwrp.cxx.

References ConvStart_impl(), SwEditShell::HasOtherCnt(), m_bEndDone, m_bIsOtherContent, m_bIsSelection, m_bStartChk, m_bStartDone, m_pConvArgs, and m_rWrtShell.

Referenced by FindConvText_impl().

◆ ConvStart_impl()

void SwHHCWrapper::ConvStart_impl ( SwConversionArgs pConvArgs,
SvxSpellArea  eSpell 
)
private

former SpellStart

Definition at line 660 of file hhcwrp.cxx.

References m_bEndDone, m_bIsDrawObj, m_bStartDone, m_pView, and SwView::SpellStart().

Referenced by Convert(), and ConvNext_impl().

◆ FindConvText_impl()

void SwHHCWrapper::FindConvText_impl ( )
private

former FindSpellError

modified version of SvxSpellWrapper::FindSpellError

Definition at line 636 of file hhcwrp.cxx.

References ConvContinue_impl(), ConvEnd_impl(), ConvNext_impl(), editeng::HangulHanjaConversion::GetUIParent(), and m_pConvArgs.

Referenced by GetNextPortion().

◆ GetNextPortion()

void SwHHCWrapper::GetNextPortion ( OUString &  rNextPortion,
LanguageType rLangOfPortion,
bool  bAllowImplicitChangesForNotConvertibleText 
)
overrideprivatevirtual

◆ HandleNewUnit()

void SwHHCWrapper::HandleNewUnit ( const sal_Int32  nUnitStart,
const sal_Int32  nUnitEnd 
)
overrideprivatevirtual

◆ HasRubySupport()

bool SwHHCWrapper::HasRubySupport ( ) const
overrideprivatevirtual

Implements editeng::HangulHanjaConversion.

Definition at line 498 of file hhcwrp.cxx.

◆ ReplaceUnit()

void SwHHCWrapper::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 
)
overrideprivatevirtual

! since Delete, Insert in 'ChangeText' do not set the WrtShells ! bInSelect flag ! back to false we do it now manually in order for the selection ! to be done properly in the following call to Left.

Implements editeng::HangulHanjaConversion.

Definition at line 346 of file hhcwrp.cxx.

References SwPosition::AdjustContent(), ChangeText(), Chars, SwCursorShell::ClearMark(), editeng::HangulHanjaConversion::eExchange, SwEditShell::EndAllAction(), SwWrtShell::EndSelect(), SwEditShell::EndUndo(), editeng::HangulHanjaConversion::eOriginalAbove, editeng::HangulHanjaConversion::eOriginalBelow, editeng::HangulHanjaConversion::eOriginalBracketed, editeng::HangulHanjaConversion::eReplacementAbove, editeng::HangulHanjaConversion::eReplacementBelow, editeng::HangulHanjaConversion::eReplacementBracketed, SwViewShell::GetAttrPool(), vcl::Font::GetCharSet(), SwCursorShell::GetCursor(), vcl::Font::GetFamilyName(), vcl::Font::GetFamilyType(), SwPaM::GetMark(), vcl::Font::GetPitch(), SwCursorShell::GetSelText(), editeng::HangulHanjaConversion::GetSourceLanguage(), vcl::Font::GetStyleName(), editeng::HangulHanjaConversion::GetTargetFont(), editeng::HangulHanjaConversion::GetTargetLanguage(), editeng::HangulHanjaConversion::IsChinese(), LANGUAGE_CHINESE_SIMPLIFIED, LANGUAGE_CHINESE_TRADITIONAL, lcl_ActivateTextShell(), SwWrtShell::Left(), m_nUnitOffset, m_rWrtShell, OVERWRITE, RES_CHRATR_CJK_FONT(), RES_CHRATR_CJK_LANGUAGE(), SelectNewUnit_impl(), SwEditShell::SetAttrItem(), SwEditShell::SetAttrSet(), SvxFontItem::SetCharSet(), SvxFontItem::SetFamily(), SvxFontItem::SetFamilyName(), SwCursorShell::SetMark(), SvxFontItem::SetPitch(), SETRUBYATTR, SvxFontItem::SetStyleName(), SwEditShell::StartAllAction(), and SwEditShell::StartUndo().

◆ SelectNewUnit_impl()

void SwHHCWrapper::SelectNewUnit_impl ( const sal_Int32  nUnitStart,
const sal_Int32  nUnitEnd 
)
private

Member Data Documentation

◆ m_bEndDone

bool SwHHCWrapper::m_bEndDone
private

Definition at line 52 of file hhcwrp.hxx.

Referenced by ConvNext_impl(), and ConvStart_impl().

◆ m_bIsDrawObj

bool SwHHCWrapper::m_bIsDrawObj
private

Definition at line 47 of file hhcwrp.hxx.

Referenced by ConvContinue_impl(), ConvStart_impl(), and ~SwHHCWrapper().

◆ m_bIsOtherContent

bool SwHHCWrapper::m_bIsOtherContent
private

Definition at line 48 of file hhcwrp.hxx.

Referenced by Convert(), and ConvNext_impl().

◆ m_bIsSelection

bool SwHHCWrapper::m_bIsSelection
private

true if only the selected text should be converted

Definition at line 50 of file hhcwrp.hxx.

Referenced by ConvContinue_impl(), and ConvNext_impl().

◆ m_bStartChk

bool SwHHCWrapper::m_bStartChk
private

Definition at line 49 of file hhcwrp.hxx.

Referenced by Convert(), and ConvNext_impl().

◆ m_bStartDone

bool SwHHCWrapper::m_bStartDone
private

Definition at line 51 of file hhcwrp.hxx.

Referenced by ConvNext_impl(), and ConvStart_impl().

◆ m_nLastPos

sal_Int32 SwHHCWrapper::m_nLastPos
private

starting position of the last found text part (needs to be sth that gets not moved like SwPaM or SwPosition by replace operations!)

Definition at line 39 of file hhcwrp.hxx.

Referenced by GetNextPortion(), and SelectNewUnit_impl().

◆ m_nPageCount

sal_uInt16 SwHHCWrapper::m_nPageCount
private

page count for progress bar

Definition at line 44 of file hhcwrp.hxx.

Referenced by ConvContinue_impl(), and ~SwHHCWrapper().

◆ m_nPageStart

sal_uInt16 SwHHCWrapper::m_nPageStart
private

first checked page

Definition at line 45 of file hhcwrp.hxx.

Referenced by ConvContinue_impl().

◆ m_nUnitOffset

sal_Int32 SwHHCWrapper::m_nUnitOffset
private

Definition at line 42 of file hhcwrp.hxx.

Referenced by GetNextPortion(), ReplaceUnit(), and SelectNewUnit_impl().

◆ m_pConvArgs

std::unique_ptr<SwConversionArgs> SwHHCWrapper::m_pConvArgs
private

object for arguments (and results) needed to find of next convertible text portion

Definition at line 36 of file hhcwrp.hxx.

Referenced by Convert(), ConvNext_impl(), FindConvText_impl(), GetNextPortion(), and ~SwHHCWrapper().

◆ m_pView

SwView* SwHHCWrapper::m_pView
private

Definition at line 33 of file hhcwrp.hxx.

Referenced by ConvContinue_impl(), ConvEnd_impl(), Convert(), ConvStart_impl(), and ~SwHHCWrapper().

◆ m_rWrtShell

SwWrtShell& SwHHCWrapper::m_rWrtShell
private

The documentation for this class was generated from the following files: