LibreOffice Module editeng (master) 1
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
editeng::HangulHanjaConversion_Impl Class Reference
Collaboration diagram for editeng::HangulHanjaConversion_Impl:
[legend]

Public Member Functions

 HangulHanjaConversion_Impl (weld::Widget *pUIParent, const Reference< XComponentContext > &rxContext, const lang::Locale &_rSourceLocale, const lang::Locale &_rTargetLocale, const vcl::Font *_pTargetFont, sal_Int32 _nConvOptions, bool _bIsInteractive, HangulHanjaConversion *_pAntiImpl)
 
void DoDocumentConversion ()
 
bool IsValid () const
 
weld::WidgetGetUIParent () const
 
LanguageType GetSourceLang () const
 
LanguageType GetTargetLang () const
 
const vcl::FontGetTargetFont () const
 
sal_Int32 GetConvOptions () const
 
bool IsInteractive () const
 

Protected Member Functions

void createDialog ()
 
bool ContinueConversion (bool _bRepeatCurrentUnit)
 continue with the conversion, return <TRUE> if and only if the complete conversion is done More...
 

Private Types

typedef std::set< OUString > StringBag
 
typedef std::map< OUString, OUString > StringMap
 

Private Member Functions

 DECL_LINK (OnOptionsChanged, LinkParamNone *, void)
 
 DECL_LINK (OnIgnore, weld::Button &, void)
 
 DECL_LINK (OnIgnoreAll, weld::Button &, void)
 
 DECL_LINK (OnChange, weld::Button &, void)
 
 DECL_LINK (OnChangeAll, weld::Button &, void)
 
 DECL_LINK (OnByCharClicked, weld::Toggleable &, void)
 
 DECL_LINK (OnConversionTypeChanged, weld::Toggleable &, void)
 
 DECL_LINK (OnFind, weld::Button &, void)
 
void implProceed (bool _bRepeatCurrentUnit)
 proceed, after the current convertible has been handled More...
 
void implChange (const OUString &_rChangeInto)
 
bool implNextConvertible (bool _bRepeatUnit)
 find the next convertible piece of text, with possibly advancing to the next portion More...
 
bool implNextConvertibleUnit (const sal_Int32 _nStartAt)
 find the next convertible unit within the current portion More...
 
bool implRetrieveNextPortion ()
 retrieves the next portion, with setting the index members properly More...
 
bool implGetConversionDirectionForCurrentPortion (HHC::ConversionDirection &rDirection)
 determine the ConversionDirection for m_sCurrentPortion More...
 
bool implUpdateSuggestions (const bool _bAllowSearchNextConvertibleText=false, const sal_Int32 _nStartAt=-1)
 member m_aCurrentSuggestions and m_nCurrentEndIndex are updated according to the other settings and current dictionaries More...
 
void implReadOptionsFromConfiguration ()
 reads the options from Hangul/Hanja Options dialog that are saved to configuration More...
 
OUString GetCurrentUnit () const
 get the string currently considered to be replaced or ignored More...
 
void implUpdateData ()
 read options from configuration, update suggestion list and dialog content More...
 
sal_Int16 implGetConversionType (bool bSwitchDirection=false) const
 get the conversion direction dependent from m_eConvType and m_eCurrentConversionDirection in case of switching the direction is allowed this can be triggered with parameter bSwitchDirection More...
 

Private Attributes

StringBag m_sIgnoreList
 
StringMap m_aChangeList
 
VclPtr< AbstractHangulHanjaConversionDialogm_pConversionDialog
 
weld::Widgetm_pUIParent
 
Reference< XComponentContext > m_xContext
 
Reference< XExtendedTextConversion > m_xConverter
 
lang::Locale m_aSourceLocale
 
HHC::ConversionType m_eConvType
 
LanguageType m_nSourceLang
 
LanguageType m_nTargetLang
 
const vcl::Fontm_pTargetFont
 
sal_Int32 m_nConvOptions
 
bool m_bIsInteractive
 
HangulHanjaConversionm_pAntiImpl
 
bool m_bByCharacter
 
HHC::ConversionFormat m_eConversionFormat
 
HHC::ConversionDirection m_ePrimaryConversionDirection
 
HHC::ConversionDirection m_eCurrentConversionDirection
 
bool m_bIgnorePostPositionalWord
 
bool m_bShowRecentlyUsedFirst
 
bool m_bAutoReplaceUnique
 
OUString m_sCurrentPortion
 
LanguageType m_nCurrentPortionLang
 
sal_Int32 m_nCurrentStartIndex
 
sal_Int32 m_nCurrentEndIndex
 
sal_Int32 m_nReplacementBaseIndex
 
sal_Int32 m_nCurrentConversionOption
 
sal_Int16 m_nCurrentConversionType
 
Sequence< OUString > m_aCurrentSuggestions
 
bool m_bTryBothDirections
 

Static Private Attributes

static StringMap m_aRecentlyUsedList = HangulHanjaConversion_Impl::StringMap()
 

Detailed Description

Definition at line 56 of file hangulhanja.cxx.

Member Typedef Documentation

◆ StringBag

Definition at line 59 of file hangulhanja.cxx.

◆ StringMap

typedef std::map<OUString, OUString> editeng::HangulHanjaConversion_Impl::StringMap
private

Definition at line 60 of file hangulhanja.cxx.

Constructor & Destructor Documentation

◆ HangulHanjaConversion_Impl()

editeng::HangulHanjaConversion_Impl::HangulHanjaConversion_Impl ( weld::Widget pUIParent,
const Reference< XComponentContext > &  rxContext,
const lang::Locale &  _rSourceLocale,
const lang::Locale &  _rTargetLocale,
const vcl::Font _pTargetFont,
sal_Int32  _nConvOptions,
bool  _bIsInteractive,
HangulHanjaConversion _pAntiImpl 
)

Member Function Documentation

◆ ContinueConversion()

bool editeng::HangulHanjaConversion_Impl::ContinueConversion ( bool  _bRepeatCurrentUnit)
protected

continue with the conversion, return <TRUE> if and only if the complete conversion is done

Parameters
_bRepeatCurrentUnitif <TRUE>, an implNextConvertible will be called initially to advance to the next convertible. if <FALSE>, the method will initially work with the current convertible unit

Definition at line 523 of file hangulhanja.cxx.

References DBG_ASSERT, GetCurrentUnit(), editeng::HangulHanjaConversion::HandleNewUnit(), implChange(), implNextConvertible(), m_aChangeList, m_aCurrentSuggestions, m_bAutoReplaceUnique, m_bIsInteractive, m_nCurrentEndIndex, m_nCurrentStartIndex, m_nReplacementBaseIndex, m_pAntiImpl, m_pConversionDialog, and m_sIgnoreList.

Referenced by DoDocumentConversion(), and implProceed().

◆ createDialog()

void editeng::HangulHanjaConversion_Impl::createDialog ( )
protected

◆ DECL_LINK() [1/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnByCharClicked  ,
weld::Toggleable ,
void   
)
private

◆ DECL_LINK() [2/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnChange  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [3/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnChangeAll  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [4/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnConversionTypeChanged  ,
weld::Toggleable ,
void   
)
private

◆ DECL_LINK() [5/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnFind  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [6/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnIgnore  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [7/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnIgnoreAll  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [8/8]

editeng::HangulHanjaConversion_Impl::DECL_LINK ( OnOptionsChanged  ,
LinkParamNone ,
void   
)
private

◆ DoDocumentConversion()

void editeng::HangulHanjaConversion_Impl::DoDocumentConversion ( )

◆ GetConvOptions()

sal_Int32 editeng::HangulHanjaConversion_Impl::GetConvOptions ( ) const
inline

Definition at line 138 of file hangulhanja.cxx.

References m_nConvOptions.

◆ GetCurrentUnit()

OUString editeng::HangulHanjaConversion_Impl::GetCurrentUnit ( ) const
private

get the string currently considered to be replaced or ignored

Definition at line 510 of file hangulhanja.cxx.

References DBG_ASSERT, m_nCurrentEndIndex, m_nCurrentStartIndex, and m_sCurrentPortion.

Referenced by ContinueConversion(), implChange(), implUpdateData(), and implUpdateSuggestions().

◆ GetSourceLang()

LanguageType editeng::HangulHanjaConversion_Impl::GetSourceLang ( ) const
inline

Definition at line 135 of file hangulhanja.cxx.

References m_nSourceLang.

◆ GetTargetFont()

const vcl::Font * editeng::HangulHanjaConversion_Impl::GetTargetFont ( ) const
inline

Definition at line 137 of file hangulhanja.cxx.

References m_pTargetFont.

◆ GetTargetLang()

LanguageType editeng::HangulHanjaConversion_Impl::GetTargetLang ( ) const
inline

Definition at line 136 of file hangulhanja.cxx.

References m_nTargetLang.

◆ GetUIParent()

weld::Widget * editeng::HangulHanjaConversion_Impl::GetUIParent ( ) const
inline

Definition at line 134 of file hangulhanja.cxx.

References m_pUIParent.

◆ implChange()

void editeng::HangulHanjaConversion_Impl::implChange ( const OUString &  _rChangeInto)
private

◆ implGetConversionDirectionForCurrentPortion()

bool editeng::HangulHanjaConversion_Impl::implGetConversionDirectionForCurrentPortion ( HHC::ConversionDirection &  rDirection)
private

determine the ConversionDirection for m_sCurrentPortion

Returns
<FALSE> if and only if something went wrong

Definition at line 572 of file hangulhanja.cxx.

References Exception, CharClass::getScript(), m_aSourceLocale, m_eConvType, m_nCurrentStartIndex, m_sCurrentPortion, m_xContext, and TOOLS_WARN_EXCEPTION.

Referenced by DoDocumentConversion(), and implRetrieveNextPortion().

◆ implGetConversionType()

sal_Int16 editeng::HangulHanjaConversion_Impl::implGetConversionType ( bool  bSwitchDirection = false) const
private

get the conversion direction dependent from m_eConvType and m_eCurrentConversionDirection in case of switching the direction is allowed this can be triggered with parameter bSwitchDirection

Definition at line 303 of file hangulhanja.cxx.

References DBG_ASSERT, LANGUAGE_CHINESE_SIMPLIFIED, m_eConvType, m_eCurrentConversionDirection, and m_nTargetLang.

Referenced by implUpdateSuggestions().

◆ implNextConvertible()

bool editeng::HangulHanjaConversion_Impl::implNextConvertible ( bool  _bRepeatUnit)
private

find the next convertible piece of text, with possibly advancing to the next portion

See also
HangulHanjaConversion::GetNextPortion

Definition at line 480 of file hangulhanja.cxx.

References implNextConvertibleUnit(), implRetrieveNextPortion(), m_nCurrentEndIndex, m_nCurrentStartIndex, and m_sCurrentPortion.

Referenced by ContinueConversion().

◆ implNextConvertibleUnit()

bool editeng::HangulHanjaConversion_Impl::implNextConvertibleUnit ( const sal_Int32  _nStartAt)
private

find the next convertible unit within the current portion

Parameters
_bRepeatUnitif <TRUE>, the search will start at the beginning of the current unit, if <FALSE>, it will start at the end of the current unit

Definition at line 434 of file hangulhanja.cxx.

References implUpdateSuggestions(), m_aCurrentSuggestions, m_bTryBothDirections, editeng::HangulHanjaConversion::m_bTryBothDirectionsSave, m_eConvType, m_eCurrentConversionDirection, editeng::HangulHanjaConversion::m_ePrimaryConversionDirectionSave, m_nCurrentStartIndex, m_pConversionDialog, and m_sCurrentPortion.

Referenced by implNextConvertible().

◆ implProceed()

void editeng::HangulHanjaConversion_Impl::implProceed ( bool  _bRepeatCurrentUnit)
private

proceed, after the current convertible has been handled

Attention: When returning from this method, the dialog may have been deleted!

Parameters
_bRepeatCurrentUnitwill be passed to the <member>ContinueConversion</member> call

Definition at line 676 of file hangulhanja.cxx.

References ContinueConversion(), DBG_ASSERT, m_bIsInteractive, m_pConversionDialog, and RET_OK.

◆ implReadOptionsFromConfiguration()

void editeng::HangulHanjaConversion_Impl::implReadOptionsFromConfiguration ( )
private

◆ implRetrieveNextPortion()

bool editeng::HangulHanjaConversion_Impl::implRetrieveNextPortion ( )
private

◆ implUpdateData()

void editeng::HangulHanjaConversion_Impl::implUpdateData ( )
private

◆ implUpdateSuggestions()

bool editeng::HangulHanjaConversion_Impl::implUpdateSuggestions ( const bool  _bAllowSearchNextConvertibleText = false,
const sal_Int32  _nStartAt = -1 
)
private

member m_aCurrentSuggestions and m_nCurrentEndIndex are updated according to the other settings and current dictionaries

if _bAllowSearchNextConvertibleText is true _nStartAt is used as starting point to search the next convertible text portion. This may result in changing of the member m_nCurrentStartIndex additionally.

Returns
<TRUE> if Suggestions were found

!! at least we want to move on in the text in order !! to avoid an endless loop...

Definition at line 314 of file hangulhanja.cxx.

References Exception, GetCurrentUnit(), implGetConversionType(), m_aCurrentSuggestions, m_aRecentlyUsedList, m_aSourceLocale, m_bByCharacter, m_bIgnorePostPositionalWord, m_bShowRecentlyUsedFirst, m_bTryBothDirections, m_eConvType, m_eCurrentConversionDirection, m_nCurrentConversionOption, m_nCurrentConversionType, m_nCurrentEndIndex, m_nCurrentStartIndex, m_sCurrentPortion, m_xConverter, n, nCount, nLength, and TOOLS_WARN_EXCEPTION.

Referenced by implNextConvertibleUnit(), and implUpdateData().

◆ IsInteractive()

bool editeng::HangulHanjaConversion_Impl::IsInteractive ( ) const
inline

Definition at line 139 of file hangulhanja.cxx.

References m_bIsInteractive.

◆ IsValid()

bool editeng::HangulHanjaConversion_Impl::IsValid ( ) const
inline

Definition at line 132 of file hangulhanja.cxx.

References m_xConverter.

Member Data Documentation

◆ m_aChangeList

StringMap editeng::HangulHanjaConversion_Impl::m_aChangeList
private

Definition at line 64 of file hangulhanja.cxx.

Referenced by ContinueConversion(), and DoDocumentConversion().

◆ m_aCurrentSuggestions

Sequence< OUString > editeng::HangulHanjaConversion_Impl::m_aCurrentSuggestions
private

◆ m_aRecentlyUsedList

HangulHanjaConversion_Impl::StringMap editeng::HangulHanjaConversion_Impl::m_aRecentlyUsedList = HangulHanjaConversion_Impl::StringMap()
staticprivate

Definition at line 65 of file hangulhanja.cxx.

Referenced by implChange(), and implUpdateSuggestions().

◆ m_aSourceLocale

lang::Locale editeng::HangulHanjaConversion_Impl::m_aSourceLocale
private

◆ m_bAutoReplaceUnique

bool editeng::HangulHanjaConversion_Impl::m_bAutoReplaceUnique
private

Definition at line 102 of file hangulhanja.cxx.

Referenced by ContinueConversion(), and implReadOptionsFromConfiguration().

◆ m_bByCharacter

bool editeng::HangulHanjaConversion_Impl::m_bByCharacter
private

Definition at line 94 of file hangulhanja.cxx.

Referenced by createDialog(), and implUpdateSuggestions().

◆ m_bIgnorePostPositionalWord

bool editeng::HangulHanjaConversion_Impl::m_bIgnorePostPositionalWord
private

Definition at line 100 of file hangulhanja.cxx.

Referenced by implReadOptionsFromConfiguration(), and implUpdateSuggestions().

◆ m_bIsInteractive

bool editeng::HangulHanjaConversion_Impl::m_bIsInteractive
private

◆ m_bShowRecentlyUsedFirst

bool editeng::HangulHanjaConversion_Impl::m_bShowRecentlyUsedFirst
private

Definition at line 101 of file hangulhanja.cxx.

Referenced by implReadOptionsFromConfiguration(), and implUpdateSuggestions().

◆ m_bTryBothDirections

bool editeng::HangulHanjaConversion_Impl::m_bTryBothDirections
private

◆ m_eConversionFormat

HHC::ConversionFormat editeng::HangulHanjaConversion_Impl::m_eConversionFormat
private

Definition at line 95 of file hangulhanja.cxx.

Referenced by createDialog(), and implChange().

◆ m_eConvType

HHC::ConversionType editeng::HangulHanjaConversion_Impl::m_eConvType
private

◆ m_eCurrentConversionDirection

HHC::ConversionDirection editeng::HangulHanjaConversion_Impl::m_eCurrentConversionDirection
private

◆ m_ePrimaryConversionDirection

HHC::ConversionDirection editeng::HangulHanjaConversion_Impl::m_ePrimaryConversionDirection
private

Definition at line 96 of file hangulhanja.cxx.

Referenced by createDialog(), and DoDocumentConversion().

◆ m_nConvOptions

sal_Int32 editeng::HangulHanjaConversion_Impl::m_nConvOptions
private

Definition at line 84 of file hangulhanja.cxx.

Referenced by GetConvOptions().

◆ m_nCurrentConversionOption

sal_Int32 editeng::HangulHanjaConversion_Impl::m_nCurrentConversionOption
private

Definition at line 110 of file hangulhanja.cxx.

Referenced by implChange(), and implUpdateSuggestions().

◆ m_nCurrentConversionType

sal_Int16 editeng::HangulHanjaConversion_Impl::m_nCurrentConversionType
private

Definition at line 111 of file hangulhanja.cxx.

Referenced by implChange(), and implUpdateSuggestions().

◆ m_nCurrentEndIndex

sal_Int32 editeng::HangulHanjaConversion_Impl::m_nCurrentEndIndex
private

◆ m_nCurrentPortionLang

LanguageType editeng::HangulHanjaConversion_Impl::m_nCurrentPortionLang
private

Definition at line 106 of file hangulhanja.cxx.

Referenced by implChange(), and implRetrieveNextPortion().

◆ m_nCurrentStartIndex

sal_Int32 editeng::HangulHanjaConversion_Impl::m_nCurrentStartIndex
private

◆ m_nReplacementBaseIndex

sal_Int32 editeng::HangulHanjaConversion_Impl::m_nReplacementBaseIndex
private

◆ m_nSourceLang

LanguageType editeng::HangulHanjaConversion_Impl::m_nSourceLang
private

Definition at line 79 of file hangulhanja.cxx.

Referenced by GetSourceLang(), and HangulHanjaConversion_Impl().

◆ m_nTargetLang

LanguageType editeng::HangulHanjaConversion_Impl::m_nTargetLang
private

◆ m_pAntiImpl

HangulHanjaConversion* editeng::HangulHanjaConversion_Impl::m_pAntiImpl
private

◆ m_pConversionDialog

VclPtr<AbstractHangulHanjaConversionDialog> editeng::HangulHanjaConversion_Impl::m_pConversionDialog
private

◆ m_pTargetFont

const vcl::Font* editeng::HangulHanjaConversion_Impl::m_pTargetFont
private

Definition at line 83 of file hangulhanja.cxx.

Referenced by GetTargetFont().

◆ m_pUIParent

weld::Widget* editeng::HangulHanjaConversion_Impl::m_pUIParent
private

Definition at line 70 of file hangulhanja.cxx.

Referenced by createDialog(), and GetUIParent().

◆ m_sCurrentPortion

OUString editeng::HangulHanjaConversion_Impl::m_sCurrentPortion
private

◆ m_sIgnoreList

StringBag editeng::HangulHanjaConversion_Impl::m_sIgnoreList
private

Definition at line 63 of file hangulhanja.cxx.

Referenced by ContinueConversion().

◆ m_xContext

Reference< XComponentContext > editeng::HangulHanjaConversion_Impl::m_xContext
private

◆ m_xConverter

Reference< XExtendedTextConversion > editeng::HangulHanjaConversion_Impl::m_xConverter
private

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