20#include <com/sun/star/i18n/TextConversionOption.hpp>
22#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
23#include <com/sun/star/lang/XMultiComponentFactory.hpp>
24#include <com/sun/star/lang/XInitialization.hpp>
25#include <com/sun/star/awt/XWindow.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
60 :
FuPoor(pViewSh, pWin, pView, pDocument, rReq),
98 const vcl::Font *pTargetFont, sal_Int32 nOptions,
bool bIsInteractive )
104 if (pBase !=
nullptr)
155 if( !pStyleSheetPool )
163 const bool bHasParent = !pStyle->
GetParent().isEmpty();
181 pStyle = pStyleSheetPool->
Next();
190 Reference< XComponentContext > xContext(
191 ::cppu::defaultBootstrap_InitialComponentContext() );
195 Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
199 Reference< ui::dialogs::XExecutableDialog > xDialog(
200 xMCF->createInstanceWithContext(
"com.sun.star.linguistic2.ChineseTranslationDialog"
201 , xContext), UNO_QUERY);
202 Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
206 Reference< awt::XWindow > xDialogParentWindow;
209 {
"ParentWindow",
uno::Any(xDialogParentWindow)}
211 xInit->initialize(
aSeq );
214 sal_Int16 nDialogRet = xDialog->execute();
215 if(
RET_OK == nDialogRet )
218 bool bToSimplified =
true;
219 bool bUseVariants =
true;
220 bool bCommonTerms =
true;
221 Reference< beans::XPropertySet > xProp( xDialog, UNO_QUERY );
226 xProp->getPropertyValue(
"IsDirectionToSimplified" ) >>= bToSimplified;
227 xProp->getPropertyValue(
"IsUseCharacterVariants" ) >>= bUseVariants;
228 xProp->getPropertyValue(
"IsTranslateCommonTerms" ) >>= bCommonTerms;
238 sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
240 nOptions = nOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
243 DefaultFontType::CJK_PRESENTATION,
244 nTargetLang, GetDefaultFontFlags::OnlyOne );
246 StartConversion( nSourceLang, nTargetLang, &aTargetFont, nOptions,
false );
250 Reference< lang::XComponent > xComponent( xDialog, UNO_QUERY );
251 if( xComponent.is() )
252 xComponent->dispose();
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
SAL_DLLPRIVATE SdOutliner * GetOutliner(bool bCreateOutliner=true)
SAL_DLLPRIVATE void SetLanguage(const LanguageType eLang, const sal_uInt16 nId)
The main purpose of this class is searching and replacing as well as spelling of impress documents.
void PrepareSpelling()
Despite the name this method is called prior to spell checking and searching and replacing.
void BeginConversion()
This is called internally when text conversion is started.
void StartConversion(LanguageType nSourceLanguage, LanguageType nTargetLanguage, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive)
Starts the text conversion (hangul/hanja or Chinese simplified/traditional) for the current viewshell...
void EndConversion()
Release all resources that have been created during the conversion.
SfxStyleSheetBasePool * GetStyleSheetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
virtual const OUString & GetParent() const
virtual SfxItemSet & GetItemSet()
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
void SetStyleName(const OUString &rStyleName)
void SetFamily(FontFamily _eFamily)
void SetPitch(FontPitch _ePitch)
void SetFamilyName(const OUString &rFamilyName)
void SetCharSet(rtl_TextEncoding _eEncoding)
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
void ConvertStyles(LanguageType nTargetLanguage, const vcl::Font *pTargetFont)
FuHangulHanjaConversion(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
void StartChineseConversion()
void StartConversion(LanguageType nSourceLanguage, LanguageType nTargetLanguage, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive)
Search and replace.
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
virtual ~FuHangulHanjaConversion() override
Base class for all functions.
VclPtr< ::sd::Window > mpWindow
Show a textual overview of the text contents of all slides.
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
Base class of the stacked shell hierarchy.
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
An SdWindow contains the actual working area of ViewShell.
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
#define LANGUAGE_CHINESE_TRADITIONAL
#define LANGUAGE_CHINESE_SIMPLIFIED
Sequence< sal_Int8 > aSeq
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
OUString SdResId(TranslateId aId)