From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- cui/source/factory/cuiexp.cxx | 36 + cui/source/factory/cuiresmgr.cxx | 25 + cui/source/factory/dlgfact.cxx | 1547 ++++++++++++++++++++++++++++++++++++++ cui/source/factory/dlgfact.hxx | 621 +++++++++++++++ cui/source/factory/init.cxx | 44 ++ 5 files changed, 2273 insertions(+) create mode 100644 cui/source/factory/cuiexp.cxx create mode 100644 cui/source/factory/cuiresmgr.cxx create mode 100644 cui/source/factory/dlgfact.cxx create mode 100644 cui/source/factory/dlgfact.hxx create mode 100644 cui/source/factory/init.cxx (limited to 'cui/source/factory') diff --git a/cui/source/factory/cuiexp.cxx b/cui/source/factory/cuiexp.cxx new file mode 100644 index 000000000..06557be56 --- /dev/null +++ b/cui/source/factory/cuiexp.cxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "dlgfact.hxx" +#include + +namespace cui +{ +static AbstractDialogFactory_Impl* GetFactory() +{ + static AbstractDialogFactory_Impl* pFactory = new AbstractDialogFactory_Impl; + return pFactory; +} +} + +extern "C" { +SAL_DLLPUBLIC_EXPORT VclAbstractDialogFactory* CreateDialogFactory() { return ::cui::GetFactory(); } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/cuiresmgr.cxx b/cui/source/factory/cuiresmgr.cxx new file mode 100644 index 000000000..2b58e5854 --- /dev/null +++ b/cui/source/factory/cuiresmgr.cxx @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +OUString CuiResId(TranslateId aKey) { return Translate::get(aKey, Translate::Create("cui")); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx new file mode 100644 index 000000000..fb61dafce --- /dev/null +++ b/cui/source/factory/dlgfact.cxx @@ -0,0 +1,1547 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +#include +#include "dlgfact.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::container; + +using ::com::sun::star::uno::Reference; + +using namespace svx; + +IMPL_ABSTDLG_CLASS(AbstractAdditionsDialog) +IMPL_ABSTDLG_CLASS(AbstractDiagramDialog) +IMPL_ABSTDLG_CLASS(AbstractFmInputRecordNoDialog) +IMPL_ABSTDLG_CLASS(AbstractFmSearchDialog) +IMPL_ABSTDLG_CLASS(AbstractFmShowColsDialog) +IMPL_ABSTDLG_CLASS(AbstractGalleryIdDialog) +IMPL_ABSTDLG_CLASS(AbstractGraphicFilterDialog) +IMPL_ABSTDLG_CLASS(AbstractHangulHanjaConversionDialog) +IMPL_ABSTDLG_CLASS(AbstractInsertObjectDialog) +IMPL_ABSTDLG_CLASS(AbstractLinksDialog) +IMPL_ABSTDLG_CLASS(AbstractPasswordToOpenModifyDialog) +IMPL_ABSTDLG_CLASS(AbstractQrCodeGenDialog) +IMPL_ABSTDLG_CLASS(AbstractScreenshotAnnotationDlg) +IMPL_ABSTDLG_CLASS(AbstractSignatureLineDialog) +IMPL_ABSTDLG_CLASS(AbstractSignSignatureLineDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxCharacterMapDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxHpLinkDlg) +IMPL_ABSTDLG_CLASS(AbstractSvxJSearchOptionsDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxMultiPathDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxNameDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxNewDictionaryDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxObjectTitleDescDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxPathSelectDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxPostItDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxSearchSimilarityDialog) +IMPL_ABSTDLG_CLASS(AbstractSvxZoomDialog) +IMPL_ABSTDLG_CLASS(AbstractTitleDialog) +IMPL_ABSTDLG_CLASS(AbstractURLDlg) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractPasteDialog,SfxDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractScriptSelectorDialog,SfxDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractSpellDialog,SfxDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxAreaTabDialog,SfxTabDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxCaptionDialog,SfxTabDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxTransformTabDialog,SfxTabDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(AbstractThesaurusDialog,SfxDialogController) +IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractControllerAsync,weld::DialogController) +IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractTabController,SfxTabDialogController) +IMPL_ABSTDLG_CLASS(CuiAbstractController) +IMPL_ABSTDLG_CLASS(CuiAbstractSingleTabController) + +short AbstractHyphenWordDialog_Impl::Execute() +{ +#if !ENABLE_WASM_STRIP_HUNSPELL + return m_xDlg->run(); +#else + return 0; +#endif +} + +const SfxItemSet* AbstractSvxCharacterMapDialog_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +void AbstractSvxCharacterMapDialog_Impl::SetText(const OUString& rStr) +{ + m_xDlg->set_title(rStr); +} + +void CuiAbstractTabController_Impl::SetCurPageId( const OString &rName ) +{ + m_xDlg->SetCurPageId( rName ); +} + +const SfxItemSet* CuiAbstractTabController_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +WhichRangesContainer CuiAbstractTabController_Impl::GetInputRanges(const SfxItemPool& pItem ) +{ + return m_xDlg->GetInputRanges( pItem ); +} + +void CuiAbstractTabController_Impl::SetInputSet( const SfxItemSet* pInSet ) +{ + m_xDlg->SetInputSet( pInSet ); +} + +//From class Window. +void CuiAbstractTabController_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + +std::vector CuiAbstractTabController_Impl::getAllPageUIXMLDescriptions() const +{ + return m_xDlg->getAllPageUIXMLDescriptions(); +} + +bool CuiAbstractTabController_Impl::selectPageByUIXMLDescription(const OString& rUIXMLDescription) +{ + return m_xDlg->selectPageByUIXMLDescription(rUIXMLDescription); +} + +BitmapEx CuiAbstractTabController_Impl::createScreenshot() const +{ + return m_xDlg->createScreenshot(); +} + +OString CuiAbstractTabController_Impl::GetScreenshotId() const +{ + return m_xDlg->GetScreenshotId(); +} + +const SfxItemSet* CuiAbstractSingleTabController_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +void CuiAbstractSingleTabController_Impl::SetText(const OUString& rStr) +{ + m_xDlg->set_title(rStr); +} + +void AbstractHangulHanjaConversionDialog_Impl::EndDialog(sal_Int32 nResult) +{ + m_xDlg->response(nResult); +} + +void AbstractHangulHanjaConversionDialog_Impl::EnableRubySupport( bool _bVal ) +{ + m_xDlg->EnableRubySupport(_bVal); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetByCharacter( bool _bByCharacter ) +{ + m_xDlg->SetByCharacter(_bByCharacter); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) +{ + m_xDlg->SetConversionDirectionState(_bTryBothDirections, _ePrimaryConversionDirection); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType ) +{ + m_xDlg->SetConversionFormat(_eType); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetOptionsChangedHdl( const Link& _rHdl ) +{ + m_xDlg->SetOptionsChangedHdl(_rHdl ); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreHdl( const Link& _rHdl ) +{ + m_xDlg->SetIgnoreHdl(_rHdl ); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreAllHdl(const Link& rHdl) +{ + m_xDlg->SetIgnoreAllHdl(rHdl); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetChangeHdl(const Link& rHdl) +{ + m_xDlg->SetChangeHdl(rHdl); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetChangeAllHdl( const Link& rHdl ) +{ + m_xDlg->SetChangeAllHdl(rHdl); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetClickByCharacterHdl( const Link& _rHdl ) +{ + m_xDlg->SetClickByCharacterHdl(_rHdl ); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormatChangedHdl(const Link& rHdl) +{ + m_xDlg->SetConversionFormatChangedHdl(rHdl); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetFindHdl( const Link& rHdl ) +{ + m_xDlg->SetFindHdl(rHdl); +} + +bool AbstractHangulHanjaConversionDialog_Impl::GetUseBothDirections( ) const +{ + return m_xDlg->GetUseBothDirections(); +} + +editeng::HangulHanjaConversion::ConversionDirection AbstractHangulHanjaConversionDialog_Impl::GetDirection( editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const +{ + return m_xDlg->GetDirection( _eDefaultDirection ); +} + +void AbstractHangulHanjaConversionDialog_Impl::SetCurrentString( + const OUString& _rNewString, + const css::uno::Sequence< OUString >& _rSuggestions, + bool _bOriginatesFromDocument + ) +{ + m_xDlg->SetCurrentString(_rNewString,_rSuggestions,_bOriginatesFromDocument); +} + +OUString AbstractHangulHanjaConversionDialog_Impl::GetCurrentString( ) const +{ + return m_xDlg->GetCurrentString(); +} + +editeng::HangulHanjaConversion::ConversionFormat AbstractHangulHanjaConversionDialog_Impl::GetConversionFormat( ) const +{ + return m_xDlg->GetConversionFormat(); +} + +void AbstractHangulHanjaConversionDialog_Impl::FocusSuggestion( ) +{ + m_xDlg->FocusSuggestion(); +} + +OUString AbstractHangulHanjaConversionDialog_Impl::GetCurrentSuggestion( ) const +{ + return m_xDlg->GetCurrentSuggestion(); +} + +OUString AbstractThesaurusDialog_Impl::GetWord() +{ + return m_xDlg->GetWord(); +}; + +Reference < css::embed::XEmbeddedObject > AbstractInsertObjectDialog_Impl::GetObject() +{ + return m_xDlg->GetObject(); +} + +bool AbstractInsertObjectDialog_Impl::IsCreateNew() +{ + return m_xDlg->IsCreateNew(); +} + +::Reference< css::io::XInputStream > AbstractInsertObjectDialog_Impl::GetIconIfIconified( OUString* pGraphicMediaType ) +{ + return m_xDlg->GetIconIfIconified( pGraphicMediaType ); +} + +void AbstractPasteDialog_Impl::Insert(SotClipboardFormatId nFormat, const OUString& rFormatName) +{ + m_xDlg->Insert(nFormat, rFormatName); +} + +void AbstractPasteDialog_Impl::InsertUno(const OUString& sCmd, const OUString& sLabel) +{ + m_xDlg->InsertUno(sCmd, sLabel); +} + +void AbstractPasteDialog_Impl::SetObjName(const SvGlobalName & rClass, const OUString& rObjName) +{ + m_xDlg->SetObjName(rClass, rObjName); +} + +void AbstractPasteDialog_Impl::PreGetFormat( const TransferableDataHelper& aHelper ) +{ + m_xDlg->PreGetFormat(aHelper); +} + +SotClipboardFormatId AbstractPasteDialog_Impl::GetFormatOnly() +{ + return m_xDlg->GetFormatOnly(); +} + +SotClipboardFormatId AbstractPasteDialog_Impl::GetFormat( const TransferableDataHelper& aHelper ) +{ + return m_xDlg->GetFormat(aHelper); +} + +void AbstractFmShowColsDialog_Impl::SetColumns(const ::Reference< css::container::XIndexContainer>& xCols) +{ + m_xDlg->SetColumns(xCols); +} + +void AbstractSvxZoomDialog_Impl::SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) +{ + m_xDlg->SetLimits( nMin, nMax ); +} + +void AbstractSvxZoomDialog_Impl::HideButton( ZoomButtonId nBtnId ) +{ + m_xDlg->HideButton( nBtnId ); +} + +const SfxItemSet* AbstractSvxZoomDialog_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +void AbstractSpellDialog_Impl::InvalidateDialog() +{ + m_xDlg->InvalidateDialog(); +} + +std::shared_ptr AbstractSpellDialog_Impl::GetController() +{ + return m_xDlg; +} + +SfxBindings& AbstractSpellDialog_Impl::GetBindings() +{ + return m_xDlg->GetBindings(); +} + +OUString AbstractTitleDialog_Impl::GetTitle() const +{ + return m_xDlg->GetTitle(); +} + +sal_uInt32 AbstractGalleryIdDialog_Impl::GetId() const +{ + return m_xDlg->GetId(); +} + +OUString AbstractURLDlg_Impl::GetURL() const +{ + return m_xDlg->GetURL(); +} + +OUString AbstractURLDlg_Impl::GetAltText() const +{ + return m_xDlg->GetAltText(); +} + +OUString AbstractURLDlg_Impl::GetDesc() const +{ + return m_xDlg->GetDesc(); +} + +OUString AbstractURLDlg_Impl::GetTarget() const +{ + return m_xDlg->GetTarget(); +} + +OUString AbstractURLDlg_Impl::GetName() const +{ + return m_xDlg->GetName(); +} + +sal_uInt16 AbstractSvxSearchSimilarityDialog_Impl::GetOther() +{ + return m_xDlg->GetOther(); +} + +sal_uInt16 AbstractSvxSearchSimilarityDialog_Impl::GetShorter() +{ + return m_xDlg->GetShorter(); +} + +sal_uInt16 AbstractSvxSearchSimilarityDialog_Impl::GetLonger() +{ + return m_xDlg->GetLonger(); +} + +bool AbstractSvxSearchSimilarityDialog_Impl::IsRelaxed() +{ + return m_xDlg->IsRelaxed(); +} + +// AbstractSvxTransformTabDialog implementations just forwards everything to the dialog +void AbstractSvxTransformTabDialog_Impl::SetCurPageId( const OString& rName ) +{ + m_xDlg->SetCurPageId( rName ); +} + +const SfxItemSet* AbstractSvxTransformTabDialog_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +WhichRangesContainer AbstractSvxTransformTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) +{ + return m_xDlg->GetInputRanges( pItem ); +} + +void AbstractSvxTransformTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) +{ + m_xDlg->SetInputSet( pInSet ); +} + +//From class Window. +void AbstractSvxTransformTabDialog_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + +void AbstractSvxTransformTabDialog_Impl::SetValidateFramePosLink( const Link& rLink ) +{ + m_xDlg->SetValidateFramePosLink( rLink ); +} + +// AbstractSvxCaptionDialog implementations just forwards everything to the dialog +void AbstractSvxCaptionDialog_Impl::SetCurPageId( const OString& rName ) +{ + m_xDlg->SetCurPageId(rName); +} + +const SfxItemSet* AbstractSvxCaptionDialog_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +WhichRangesContainer AbstractSvxCaptionDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) +{ + return m_xDlg->GetInputRanges( pItem ); +} + +void AbstractSvxCaptionDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) +{ + m_xDlg->SetInputSet( pInSet ); +} + +void AbstractSvxCaptionDialog_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + +void AbstractSvxCaptionDialog_Impl::SetValidateFramePosLink( const Link& rLink ) +{ + m_xDlg->SetValidateFramePosLink( rLink ); +} + +TransliterationFlags AbstractSvxJSearchOptionsDialog_Impl::GetTransliterationFlags() const +{ + return m_xDlg->GetTransliterationFlags(); +} + +void AbstractFmInputRecordNoDialog_Impl::SetValue(tools::Long nNew) +{ + m_xDlg->SetValue(nNew); +} + +tools::Long AbstractFmInputRecordNoDialog_Impl::GetValue() const +{ + return m_xDlg->GetValue(); +} + +::Reference< css::linguistic2::XDictionary > AbstractSvxNewDictionaryDialog_Impl::GetNewDictionary() +{ + return m_xDlg->GetNewDictionary(); +} + +void AbstractSvxNameDialog_Impl::GetName(OUString& rName) +{ + rName = m_xDlg->GetName(); +} + +void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const Link& rLink, bool bCheckImmediately ) +{ + aCheckNameHdl = rLink; + if( rLink.IsSet() ) + m_xDlg->SetCheckNameHdl( LINK(this, AbstractSvxNameDialog_Impl, CheckNameHdl), bCheckImmediately ); + else + m_xDlg->SetCheckNameHdl( Link(), bCheckImmediately ); +} + +void AbstractSvxNameDialog_Impl::SetCheckNameTooltipHdl( const Link& rLink) +{ + aCheckNameTooltipHdl = rLink; + if( rLink.IsSet() ) + m_xDlg->SetCheckNameTooltipHdl( LINK(this, AbstractSvxNameDialog_Impl, CheckNameTooltipHdl)); + else + m_xDlg->SetCheckNameTooltipHdl( Link()); +} + +void AbstractSvxNameDialog_Impl::SetEditHelpId(const OString& rHelpId) +{ + m_xDlg->SetEditHelpId(rHelpId); +} + +void AbstractSvxNameDialog_Impl::SetHelpId(const OString& rHelpId) +{ + m_xDlg->set_help_id(rHelpId); +} + +void AbstractSvxNameDialog_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + +IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, CheckNameHdl, SvxNameDialog&, bool) +{ + return aCheckNameHdl.Call(*this); +} + +IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, CheckNameTooltipHdl, SvxNameDialog&, OUString) +{ + return aCheckNameTooltipHdl.Call(*this); +} + +void AbstractSvxObjectNameDialog_Impl::GetName(OUString& rName) +{ + rName = m_xDlg->GetName(); +} + +void AbstractSvxObjectNameDialog_Impl::SetCheckNameHdl(const Link& rLink) +{ + aCheckNameHdl = rLink; + + if(rLink.IsSet()) + { + m_xDlg->SetCheckNameHdl(LINK(this, AbstractSvxObjectNameDialog_Impl, CheckNameHdl)); + } + else + { + m_xDlg->SetCheckNameHdl(Link()); + } +} + +IMPL_LINK_NOARG(AbstractSvxObjectNameDialog_Impl, CheckNameHdl, SvxObjectNameDialog&, bool) +{ + return aCheckNameHdl.Call(*this); +} + +void AbstractSvxObjectTitleDescDialog_Impl::GetTitle(OUString& rTitle) +{ + rTitle = m_xDlg->GetTitle(); +} + +void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(OUString& rDescription) +{ + rDescription = m_xDlg->GetDescription(); +} + +OUString AbstractSvxMultiPathDialog_Impl::GetPath() const +{ + return m_xDlg->GetPath(); +} + +void AbstractSvxMultiPathDialog_Impl::SetPath( const OUString& rPath ) +{ + m_xDlg->SetPath( rPath ); +} + +void AbstractSvxMultiPathDialog_Impl::SetTitle( const OUString& rNewTitle ) +{ + m_xDlg->SetTitle(rNewTitle); +} + +OUString AbstractSvxPathSelectDialog_Impl::GetPath() const +{ + return m_xDlg->GetPath(); +} + +void AbstractSvxPathSelectDialog_Impl::SetPath( const OUString& rPath ) +{ + m_xDlg->SetPath( rPath ); +} + +void AbstractSvxPathSelectDialog_Impl::SetTitle( const OUString& rNewTitle ) +{ + m_xDlg->SetTitle(rNewTitle); +} + +std::shared_ptr AbstractSvxHpLinkDlg_Impl::GetController() +{ + return m_xDlg; +} + +bool AbstractSvxHpLinkDlg_Impl::QueryClose() +{ + return m_xDlg->QueryClose(); +} + +void AbstractFmSearchDialog_Impl::SetFoundHandler(const Link& lnk) +{ + m_xDlg->SetFoundHandler(lnk); +} + +void AbstractFmSearchDialog_Impl::SetCanceledNotFoundHdl(const Link& lnk) +{ + m_xDlg->SetCanceledNotFoundHdl(lnk); +} + +void AbstractFmSearchDialog_Impl::SetActiveField(const OUString& strField) +{ + m_xDlg->SetActiveField(strField); +} + +Graphic AbstractGraphicFilterDialog_Impl::GetFilteredGraphic(const Graphic& rGraphic, double fScaleX, double fScaleY) +{ + return m_xDlg->GetFilteredGraphic(rGraphic, fScaleX, fScaleY); +} + +// AbstractSvxAreaTabDialog implementations just forwards everything to the dialog +void AbstractSvxAreaTabDialog_Impl::SetCurPageId( const OString& rName ) +{ + m_xDlg->SetCurPageId( rName ); +} + +const SfxItemSet* AbstractSvxAreaTabDialog_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +WhichRangesContainer AbstractSvxAreaTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) +{ + return m_xDlg->GetInputRanges( pItem ); +} + +void AbstractSvxAreaTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) +{ + m_xDlg->SetInputSet( pInSet ); +} + +void AbstractSvxAreaTabDialog_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + +void AbstractSvxPostItDialog_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + +const SfxItemSet* AbstractSvxPostItDialog_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +void AbstractSvxPostItDialog_Impl::EnableTravel(bool bNext, bool bPrev) +{ + m_xDlg->EnableTravel( bNext, bPrev ); +} + +OUString AbstractSvxPostItDialog_Impl::GetNote() +{ + return m_xDlg->GetNote(); +} + +void AbstractSvxPostItDialog_Impl::SetNote(const OUString& rTxt) +{ + m_xDlg->SetNote( rTxt ); +} + +void AbstractSvxPostItDialog_Impl::ShowLastAuthor(const OUString& rAuthor, const OUString& rDate) +{ + m_xDlg->ShowLastAuthor( rAuthor, rDate ); +} + +void AbstractSvxPostItDialog_Impl::DontChangeAuthor() +{ + m_xDlg->DontChangeAuthor(); +} + +void AbstractSvxPostItDialog_Impl::HideAuthor() +{ + m_xDlg->HideAuthor(); +} + +void AbstractSvxPostItDialog_Impl::SetNextHdl( const Link& rLink ) +{ + aNextHdl = rLink; + if( rLink.IsSet() ) + m_xDlg->SetNextHdl( LINK(this, AbstractSvxPostItDialog_Impl, NextHdl ) ); + else + m_xDlg->SetNextHdl( Link() ); +} + +void AbstractSvxPostItDialog_Impl::SetPrevHdl( const Link& rLink ) +{ + aPrevHdl = rLink; + if( rLink.IsSet() ) + m_xDlg->SetPrevHdl( LINK(this, AbstractSvxPostItDialog_Impl, PrevHdl ) ); + else + m_xDlg->SetPrevHdl( Link() ); +} + +IMPL_LINK_NOARG(AbstractSvxPostItDialog_Impl, NextHdl, SvxPostItDialog&, void) +{ + aNextHdl.Call(*this); +} + +IMPL_LINK_NOARG(AbstractSvxPostItDialog_Impl, PrevHdl, SvxPostItDialog&, void) +{ + aPrevHdl.Call(*this); +} + +std::shared_ptr AbstractSvxPostItDialog_Impl::GetDialog() +{ + return m_xDlg->GetDialog(); +} + +OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToOpen() const +{ + return m_xDlg->GetPasswordToOpen(); +} + +OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToModify() const +{ + return m_xDlg->GetPasswordToModify(); +} + +bool AbstractPasswordToOpenModifyDialog_Impl::IsRecommendToOpenReadonly() const +{ + return m_xDlg->IsRecommendToOpenReadonly(); +} + +// Create dialogs with simplest interface +VclPtr AbstractDialogFactory_Impl::CreateVclDialog(weld::Window* pParent, sal_uInt32 nResId) +{ + std::unique_ptr xDlg; + switch ( nResId ) + { + case SID_OPTIONS_TREEDIALOG : + case SID_OPTIONS_DATABASES : + case SID_LANGUAGE_OPTIONS : + { + bool bActivateLastSelection = false; + if (nResId == SID_OPTIONS_TREEDIALOG) + bActivateLastSelection = true; + Reference< frame::XFrame > xFrame; + xDlg = std::make_unique(pParent, xFrame, bActivateLastSelection); + if (nResId == SID_OPTIONS_DATABASES) + { + xDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS); + } + else if (nResId == SID_LANGUAGE_OPTIONS) + { + //open the tab page "tools/options/languages" + xDlg->ActivatePage(OFA_TP_LANGUAGES_FOR_SET_DOCUMENT_LANGUAGE); + } + } + break; + default: + break; + } + + if (xDlg) + return VclPtr::Create(std::move(xDlg)); + return nullptr; +} + +VclPtr AbstractDialogFactory_Impl::CreateFrameDialog(weld::Window* pParent, const Reference< frame::XFrame >& rxFrame, + sal_uInt32 nResId, const OUString& rParameter ) +{ + std::unique_ptr xDlg; + if (SID_OPTIONS_TREEDIALOG == nResId || SID_OPTIONS_DATABASES == nResId) + { + // only activate last page if we don't want to activate a special page + bool bActivateLastSelection = ( nResId != SID_OPTIONS_DATABASES && rParameter.isEmpty() ); + xDlg = std::make_unique(pParent, rxFrame, bActivateLastSelection); + if ( nResId == SID_OPTIONS_DATABASES ) + xDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS); + else if ( !rParameter.isEmpty() ) + xDlg->ActivatePage( rParameter ); + } + + if (xDlg) + return VclPtr::Create(std::move(xDlg)); + return nullptr; +} + +// TabDialog outside the drawing layer +VclPtr AbstractDialogFactory_Impl::CreateAutoCorrTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet) +{ + return VclPtr::Create(std::make_shared(pParent, pAttrSet)); +} + +VclPtr AbstractDialogFactory_Impl::CreateCustomizeTabDialog(weld::Window* pParent, + const SfxItemSet* pAttrSet, + const Reference< frame::XFrame >& xViewFrame ) +{ + auto xDlg1 = std::make_shared(pParent, pAttrSet); + xDlg1->SetFrame(xViewFrame); + return VclPtr::Create(std::move(xDlg1)); +} + +// TabDialog that use functionality of the drawing layer +VclPtr AbstractDialogFactory_Impl::CreateTextTabDialog(weld::Window* pParent, + const SfxItemSet* pAttrSet, + SdrView* pView) +{ + return VclPtr::Create(std::make_shared(pParent, pAttrSet, pView)); +} + +// TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog +VclPtr AbstractDialogFactory_Impl::CreateCaptionDialog(weld::Window* pParent, + const SdrView* pView, + SvxAnchorIds nAnchorTypes) +{ + return VclPtr::Create(std::make_shared(pParent, pView, nAnchorTypes)); +} + +VclPtr AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(weld::Widget* pParent) +{ + return VclPtr::Create(std::make_unique(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateThesaurusDialog(weld::Widget* pParent, + css::uno::Reference xThesaurus, + const OUString &rWord, LanguageType nLanguage) +{ + return VclPtr::Create(std::make_shared(pParent, xThesaurus, rWord, nLanguage)); +} + +VclPtr AbstractDialogFactory_Impl::CreateHyphenWordDialog(weld::Widget* pParent, + const OUString &rWord, LanguageType nLang, + css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen, + SvxSpellWrapper* pWrapper) +{ +#if !ENABLE_WASM_STRIP_EXTRA + return VclPtr::Create(std::make_unique(rWord, nLang, pParent, xHyphen, pWrapper)); +#else + (void) pParent; + (void) rWord; + (void) nLang; + (void) xHyphen; + (void) pWrapper; + return nullptr; +#endif +} + +VclPtr AbstractDialogFactory_Impl::CreateFmShowColsDialog(weld::Window* pParent) +{ + return VclPtr::Create(std::make_unique(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) +{ + return VclPtr::Create(std::make_unique(pParent, rCoreSet)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxSpellDialog( + weld::Window* pParent, + SfxBindings* pBindings, + svx::SpellDialogChildWindow* pSpellChildWindow) +{ + return VclPtr::Create(std::make_shared(pSpellChildWindow, pParent, pBindings)); +} + +VclPtr AbstractDialogFactory_Impl::CreateActualizeProgressDialog(weld::Widget* pParent, + GalleryTheme* pThm) +{ + return VclPtr::Create(std::make_unique(pParent, pThm)); +} + +void AbstractDialogFactory_Impl::ShowAsyncScriptErrorDialog(weld::Window* pParent, const css::uno::Any& rException) +{ + return SvxScriptErrorDialog::ShowAsyncErrorDialog(pParent, rException); +} + +VclPtr AbstractDialogFactory_Impl::CreateScriptSelectorDialog(weld::Window* pParent, + const Reference& rxFrame) +{ + return VclPtr::Create(std::make_shared(pParent, rxFrame)); +} + +OUString AbstractScriptSelectorDialog_Impl::GetScriptURL() const +{ + return m_xDlg->GetScriptURL(); +} + +void AbstractScriptSelectorDialog_Impl::SetRunLabel() +{ + m_xDlg->SetRunLabel(); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog(weld::Window* pParent, + const OUString& rLanguage) +{ + return VclPtr::Create(std::make_unique(pParent, rLanguage)); +} + +VclPtr AbstractDialogFactory_Impl::CreateTitleDialog(weld::Widget* pParent, + const OUString& rOldText) +{ + return VclPtr::Create(std::make_unique(pParent, rOldText)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGalleryIdDialog(weld::Widget* pParent, + GalleryTheme* pThm) +{ + return VclPtr::Create(std::make_unique(pParent, pThm)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGalleryThemePropertiesDialog(weld::Widget* pParent, + ExchangeData* pData, + SfxItemSet* pItemSet) +{ + return VclPtr::Create(std::make_shared( + pParent, pData, pItemSet)); +} + +VclPtr AbstractDialogFactory_Impl::CreateURLDialog(weld::Widget* pParent, + const OUString& rURL, const OUString& rAltText, const OUString& rDescription, + const OUString& rTarget, const OUString& rName, + TargetList& rTargetList ) +{ + return VclPtr::Create(std::make_unique(pParent, rURL, rAltText, rDescription, + rTarget, rName, rTargetList)); + +} + +VclPtr AbstractDialogFactory_Impl::CreateTabItemDialog(weld::Window* pParent, + const SfxItemSet& rSet) +{ + return VclPtr::Create(std::make_shared( + pParent, rSet)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog(weld::Window* pParent, + SearchAttrItemList& rLst, + const WhichRangesContainer& pWhRanges ) +{ + return VclPtr::Create(std::make_unique(pParent, rLst, pWhRanges)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxSearchSimilarityDialog(weld::Window* pParent, + bool bRelax, + sal_uInt16 nOther, + sal_uInt16 nShorter, + sal_uInt16 nLonger) +{ + return VclPtr::Create(std::make_unique(pParent, bRelax, nOther, nShorter, nLonger)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg( + weld::Window* pParent, + const SfxItemSet& rCoreSet, + bool bEnableDrawingLayerFillStyles) +{ + return VclPtr::Create(std::make_shared( + pParent, + rCoreSet, + /*bEnableSelector*/true, + bEnableDrawingLayerFillStyles)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxTransformTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + const SdrView* pView, + SvxAnchorIds nAnchorTypes) +{ + return VclPtr::Create(std::make_shared(pParent, pAttr,pView, nAnchorTypes)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSchTransformTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + const SdrView* pSdrView, + bool bSizeTabPage) +{ + auto pDlg = std::make_shared(pParent, pAttr, pSdrView, + bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize); + pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" ); + pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" ); + return VclPtr::Create(std::move(pDlg)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxJSearchOptionsDialog(weld::Window* pParent, + const SfxItemSet& rOptionsSet, + TransliterationFlags nInitialFlags) +{ + return VclPtr::Create(std::make_unique(pParent, rOptionsSet, nInitialFlags)); +} + +VclPtr AbstractDialogFactory_Impl::CreateFmInputRecordNoDialog(weld::Window* pParent) +{ + return VclPtr::Create(std::make_unique(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxNewDictionaryDialog(weld::Window* pParent) +{ + return VclPtr::Create(std::make_unique(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) +{ + return VclPtr::Create(std::make_unique(pParent, rName)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxNameDialog(weld::Window* pParent, + const OUString& rName, const OUString& rDesc) +{ + return VclPtr::Create(std::make_unique(pParent, rName, rDesc)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) +{ + return VclPtr::Create(std::make_unique(pParent, rName)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) +{ + return VclPtr::Create(std::make_unique(pParent, rTitle, rDescription)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(weld::Window* pParent) +{ + return VclPtr::Create(std::make_unique(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxPathSelectDialog(weld::Window* pParent) +{ + return VclPtr::Create(std::make_unique(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxHpLinkDlg(SfxChildWindow* pChild, SfxBindings* pBindings, weld::Window* pParent) +{ + return VclPtr::Create(std::make_shared(pBindings, pChild, pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateFmSearchDialog(weld::Window* pParent, + const OUString& strInitialText, + const std::vector< OUString >& _rContexts, + sal_Int16 nInitialContext, + const Link& lnkContextSupplier) +{ + return VclPtr::Create(std::make_unique(pParent, + strInitialText, _rContexts, nInitialContext, lnkContextSupplier)); + +} + +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterEmboss(weld::Window* pParent, + const Graphic& rGraphic) +{ + return VclPtr::Create(std::make_unique(pParent, rGraphic, RectPoint::MM)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterPoster(weld::Window* pParent, + const Graphic& rGraphic) +{ + return VclPtr::Create(std::make_unique(pParent, rGraphic, 16)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterSepia(weld::Window* pParent, + const Graphic& rGraphic) +{ + return VclPtr::Create(std::make_unique(pParent, rGraphic, 10)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(weld::Window* pParent, + const Graphic& rGraphic, double nRadius) +{ + return VclPtr::Create(std::make_unique(pParent, rGraphic, nRadius)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterSolarize(weld::Window* pParent, + const Graphic& rGraphic) +{ + return VclPtr::Create(std::make_unique(pParent, rGraphic, 128, false /*bInvert*/)); +} + +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterMosaic(weld::Window* pParent, + const Graphic& rGraphic) +{ + return VclPtr::Create(std::make_unique(pParent, rGraphic, 4, 4, false /*bEnhanceEdges*/)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxAreaTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + SdrModel* pModel, + bool bShadow, + bool bSlideBackground) +{ + return VclPtr::Create( + std::make_shared(pParent, pAttr, pModel, bShadow, bSlideBackground)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog + SdrModel* pModel, + const SdrObject* pObj , + bool bHasObj) +{ + return VclPtr::Create(std::make_shared(pParent, pAttr, pModel, pObj,bHasObj)); +} + +VclPtr AbstractDialogFactory_Impl::CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, + const Reference< XFrame >& rDocumentFrame) +{ + return VclPtr::Create(std::make_unique(pParent, &rAttr, rDocumentFrame)); +} + +VclPtr AbstractDialogFactory_Impl::CreateEventConfigDialog(weld::Widget* pParent, + const SfxItemSet& rAttr, + const Reference< XFrame >& rDocumentFrame) +{ + return VclPtr::Create(std::make_unique(pParent, rDocumentFrame, rAttr)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSfxDialog(weld::Window* pParent, + const SfxItemSet& rAttr, + const SdrView* pView, + sal_uInt32 nResId) +{ + switch ( nResId ) + { + case RID_SVXPAGE_MEASURE: + return VclPtr::Create(std::make_unique(pParent, rAttr, pView)); + case RID_SVXPAGE_CONNECTION: + return VclPtr::Create(std::make_unique(pParent, rAttr, pView)); + case RID_SFXPAGE_DBREGISTER: + return VclPtr::Create(std::make_unique(pParent, rAttr)); + } + + return nullptr; +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxPostItDialog(weld::Widget* pParent, + const SfxItemSet& rCoreSet, + bool bPrevNext) +{ + return VclPtr::Create(std::make_unique(pParent, rCoreSet, bPrevNext)); +} + +namespace { + +class SvxMacroAssignDialog_Impl : public VclAbstractDialog +{ +public: + SvxMacroAssignDialog_Impl( weld::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode, + const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent ) + :m_aItems( SfxGetpApp()->GetPool(), svl::Items ) + { + m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) ); + m_xDlg.reset(new SvxMacroAssignDlg(_pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent)); + } + + virtual short Execute() override; + +private: + SfxItemSet m_aItems; + std::unique_ptr m_xDlg; +}; + +IMPL_ABSTDLG_CLASS(SvxMacroAssignDialog) +} + + +VclPtr AbstractDialogFactory_Impl::CreateSvxMacroAssignDlg( + weld::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode, + const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent ) +{ + return VclPtr::Create(_pParent, _rxDocumentFrame, _bUnoDialogMode, _rxEvents, _nInitiallySelectedEvent); +} + +// Factories for TabPages +CreateTabPage AbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nId ) +{ + switch ( nId ) + { + case RID_SW_TP_BACKGROUND : + case RID_SVXPAGE_BKG : + return SvxBkgTabPage::Create; + case RID_SVXPAGE_TEXTANIMATION : + return SvxTextAnimationPage::Create; + case RID_SVXPAGE_TRANSPARENCE : + return SvxTransparenceTabPage::Create; + case RID_SVXPAGE_AREA : + return SvxAreaTabPage::Create; + case RID_SVXPAGE_SHADOW : + return SvxShadowTabPage::Create; + case RID_SVXPAGE_LINE : + return SvxLineTabPage::Create; + case RID_SVXPAGE_CONNECTION : + return SvxConnectionPage::Create; + case RID_SVXPAGE_MEASURE : + return SvxMeasurePage::Create; + case RID_SFXPAGE_GENERAL : + return SvxGeneralTabPage::Create; + case RID_SVXPAGE_PICK_SINGLE_NUM : + return SvxSingleNumPickTabPage::Create; + case RID_SVXPAGE_PICK_BMP : + return SvxBitmapPickTabPage::Create; + case RID_SVXPAGE_PICK_BULLET : + return SvxBulletPickTabPage::Create; + case RID_SVXPAGE_NUM_OPTIONS : + return SvxNumOptionsTabPage::Create; + case RID_SVXPAGE_PICK_NUM : + return SvxNumPickTabPage::Create; + case RID_SVXPAGE_NUM_POSITION : + return SvxNumPositionTabPage::Create; + case RID_SVXPAGE_PARA_ASIAN : + return SvxAsianTabPage::Create; + case RID_SVXPAGE_EXT_PARAGRAPH : + return SvxExtParagraphTabPage::Create; + case RID_SVXPAGE_ALIGN_PARAGRAPH : + return SvxParaAlignTabPage::Create; + case RID_SVXPAGE_STD_PARAGRAPH : + return SvxStdParagraphTabPage::Create; + case RID_SVXPAGE_TABULATOR : + return SvxTabulatorTabPage::Create; + case RID_SVXPAGE_TEXTATTR : + return SvxTextAttrPage::Create; + case RID_SVXPAGE_ALIGNMENT : + return svx::AlignmentTabPage::Create; + case RID_SVXPAGE_BORDER : + return SvxBorderTabPage::Create; + case RID_SVXPAGE_CHAR_NAME : + return SvxCharNamePage::Create; + case RID_SVXPAGE_CHAR_EFFECTS : + return SvxCharEffectsPage::Create; + case RID_SVXPAGE_CHAR_POSITION : + return SvxCharPositionPage::Create; + case RID_SVXPAGE_CHAR_TWOLINES : + return SvxCharTwoLinesPage::Create; + case RID_SVXPAGE_NUMBERFORMAT : + return SvxNumberFormatTabPage::Create; + case RID_SVXPAGE_PAGE : + return SvxPageDescPage::Create; + case RID_SVXPAGE_GRFCROP : + return SvxGrfCropPage::Create; + case RID_SVXPAGE_MACROASSIGN : + return SfxMacroTabPage::Create; + case RID_SVXPAGE_TEXTCOLUMNS: + return SvxTextColumnsPage::Create; + case RID_SVXPAGE_THEME: + return SvxThemePage::Create; + default: + break; + } + + return nullptr; +} + +DialogGetRanges AbstractDialogFactory_Impl::GetDialogGetRangesFunc() +{ + return SvxPostItDialog::GetRanges; +} + +GetTabPageRanges AbstractDialogFactory_Impl::GetTabPageRangesFunc( sal_uInt16 nId ) +{ + switch ( nId ) + { + case RID_SVXPAGE_TEXTANIMATION : + return SvxTextAnimationPage::GetRanges; + case RID_SVXPAGE_TRANSPARENCE : + return SvxTransparenceTabPage::GetRanges; + case RID_SVXPAGE_AREA : + return SvxAreaTabPage::GetRanges; + case RID_SVXPAGE_SHADOW : + return SvxShadowTabPage::GetRanges; + case RID_SVXPAGE_LINE : + return SvxLineTabPage::GetRanges; + case RID_SVXPAGE_CONNECTION : + return SvxConnectionPage::GetRanges; + case RID_SVXPAGE_MEASURE : + return SvxMeasurePage::GetRanges; + case RID_SVXPAGE_PARA_ASIAN : + return SvxAsianTabPage::GetRanges; + case RID_SVXPAGE_EXT_PARAGRAPH : + return SvxExtParagraphTabPage::GetRanges; + case RID_SVXPAGE_ALIGN_PARAGRAPH : + return SvxParaAlignTabPage::GetRanges; + case RID_SVXPAGE_STD_PARAGRAPH : + return SvxStdParagraphTabPage::GetRanges; + case RID_SVXPAGE_TABULATOR : + return SvxTabulatorTabPage::GetRanges; + case RID_SVXPAGE_TEXTATTR : + return SvxTextAttrPage::GetRanges; + case RID_SVXPAGE_ALIGNMENT : + return svx::AlignmentTabPage::GetRanges; + case RID_SW_TP_BACKGROUND : + case RID_SVXPAGE_BKG: + return SvxBkgTabPage::GetRanges; + case RID_SVXPAGE_BORDER : + return SvxBorderTabPage::GetRanges; + case RID_SVXPAGE_CHAR_NAME : + return SvxCharNamePage::GetRanges; + case RID_SVXPAGE_CHAR_EFFECTS : + return SvxCharEffectsPage::GetRanges; + case RID_SVXPAGE_CHAR_POSITION : + return SvxCharPositionPage::GetRanges; + case RID_SVXPAGE_CHAR_TWOLINES : + return SvxCharTwoLinesPage::GetRanges; + case RID_SVXPAGE_NUMBERFORMAT : + return SvxNumberFormatTabPage::GetRanges; + case RID_SVXPAGE_PAGE : + return SvxPageDescPage::GetRanges; + case RID_SVXPAGE_ASIAN_LAYOUT: + return SvxAsianLayoutPage::GetRanges; + case RID_SVXPAGE_TEXTCOLUMNS: + return SvxTextColumnsPage::GetRanges; + case RID_SVXPAGE_THEME: + return SvxThemePage::GetRanges; + default: + break; + } + + return nullptr; +} + +VclPtr AbstractDialogFactory_Impl::CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommand, + const Reference & xStor, const SvObjectServerList* pList) +{ + std::unique_ptr pDlg; + if ( rCommand == ".uno:InsertObject" ) + pDlg.reset(new SvInsertOleDlg(pParent, xStor, pList)); + else if ( rCommand == ".uno:InsertObjectFloatingFrame" ) + pDlg.reset(new SfxInsertFloatingFrameDialog(pParent, xStor)); + + if ( pDlg ) + { + pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) ); + return VclPtr::Create( std::move(pDlg) ); + } + return nullptr; +} + +VclPtr AbstractDialogFactory_Impl::CreateEditObjectDialog(weld::Window* pParent, const OUString& rCommand, + const Reference& xObj) +{ + if ( rCommand == ".uno:InsertObjectFloatingFrame" ) + { + auto pDlg = std::make_unique(pParent, xObj); + pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) ); + return VclPtr::Create( std::move(pDlg) ); + } + return nullptr; +} + +VclPtr AbstractDialogFactory_Impl::CreatePasteDialog(weld::Window* pParent) +{ + return VclPtr::Create(std::make_shared(pParent)); +} + +VclPtr AbstractDialogFactory_Impl::CreateLinksDialog(weld::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML, sfx2::SvBaseLink* p) +{ + auto xLinkDlg(std::make_unique(pParent, pMgr, bHTML)); + if (p) + xLinkDlg->SetActLink(p); + return VclPtr::Create(std::move(xLinkDlg)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel) +{ + return VclPtr::Create(std::make_shared(pParent, pAttr, rModel)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, tools::Long nMaxVertical) +{ + return VclPtr::Create( std::make_shared(pParent, bIsTableVertical, nMaxVertical, 99 )); +} + +std::shared_ptr AbstractDialogFactory_Impl::CreateSvxNewTableDialog(weld::Window* pParent) +{ + return std::make_shared(pParent); +} + +VclPtr AbstractDialogFactory_Impl::CreateOptionsDialog(weld::Window* pParent, const OUString& rExtensionId) +{ + return VclPtr::Create(std::make_unique(pParent, rExtensionId)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) +{ + return VclPtr::Create(pParent, bCol, rHelpId); +} + +VclPtr AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog( + weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) +{ + return VclPtr::Create(std::make_unique(pParent, nMaxPasswdLen, bIsPasswordToModify)); +} + +VclPtr AbstractDialogFactory_Impl::CreateScreenshotAnnotationDlg(weld::Dialog& rParentDialog) +{ + return VclPtr::Create(std::make_unique(rParentDialog)); +} + +VclPtr AbstractDialogFactory_Impl::CreateSignatureLineDialog( + weld::Window* pParent, const Reference xModel, bool bEditExisting) +{ + return VclPtr::Create( + std::make_unique(pParent, xModel, bEditExisting)); +} + +VclPtr +AbstractDialogFactory_Impl::CreateSignSignatureLineDialog(weld::Window* pParent, + const Reference xModel) +{ + return VclPtr::Create( + std::make_unique(pParent, xModel)); +} + +VclPtr AbstractDialogFactory_Impl::CreateQrCodeGenDialog( + weld::Window* pParent, const Reference xModel, bool bEditExisting) +{ + return VclPtr::Create( + std::make_unique(pParent, xModel, bEditExisting)); +} + +VclPtr AbstractDialogFactory_Impl::CreateAdditionsDialog( + weld::Window* pParent, const OUString& sAdditionsTag) +{ +#if HAVE_FEATURE_EXTENSIONS + return VclPtr::Create( + std::make_unique(pParent, sAdditionsTag)); +#else + (void) pParent; + (void) sAdditionsTag; + return nullptr; +#endif +} + +VclPtr +AbstractDialogFactory_Impl::CreateAboutDialog(weld::Window* pParent) +{ + return VclPtr::Create( + std::make_shared(pParent)); +} + +VclPtr +AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent) +{ +#if !ENABLE_WASM_STRIP_PINGUSER + return VclPtr::Create( + std::make_shared(pParent)); +#else + (void) pParent; + return nullptr; +#endif +} + +VclPtr +AbstractDialogFactory_Impl::CreateToolbarmodeDialog(weld::Window* pParent) +{ + return VclPtr::Create( + std::make_unique(pParent)); +} + +VclPtr +AbstractDialogFactory_Impl::CreateDiagramDialog( + weld::Window* pParent, + SdrObjGroup& rDiagram) +{ + return VclPtr::Create( + std::make_unique(pParent, rDiagram)); +} + +#ifdef _WIN32 +VclPtr +AbstractDialogFactory_Impl::CreateFileExtCheckDialog(weld::Window* pParent, const OUString& sTitle, + const OUString& sMsg) +{ + return VclPtr::Create( + std::make_unique(pParent, sTitle, sMsg)); +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx new file mode 100644 index 000000000..079af32b4 --- /dev/null +++ b/cui/source/factory/dlgfact.hxx @@ -0,0 +1,621 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#pragma once + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DECL_ABSTDLG_CLASS_(Class,Base,Dialog,StdPtr) \ +class Class##_Impl final : public Base \ +{ \ + StdPtr m_xDlg; \ +public: \ + explicit Class##_Impl(StdPtr p) : m_xDlg(std::move(p)) {} \ + virtual short Execute() override; + +#define DECL_ABSTDLG_CLASS_UNIQUE(Class,Base,Dialog) \ +DECL_ABSTDLG_CLASS_(Class,Base,Dialog,std::unique_ptr) + +#define DECL_ABSTDLG_CLASS_SHARED(Class,Base,Dialog) \ +DECL_ABSTDLG_CLASS_(Class,Base,Dialog,std::shared_ptr) + +#define IMPL_ABSTDLG_CLASS(Class) \ +short Class##_Impl::Execute() \ +{ \ + return m_xDlg->run(); \ +} + +#define DECL_ABSTDLG_CLASS(Class,Dialog) \ +DECL_ABSTDLG_CLASS_UNIQUE(Class,Class,Dialog) + +// Async AKA std::shared_ptr + +#define DECL_ABSTDLG_CLASS_SHARED_ASYNC(Class,Base,Dialog) \ +DECL_ABSTDLG_CLASS_SHARED(Class,Base,Dialog) \ + virtual bool StartExecuteAsync(AsyncContext &rCtx) override; + +#define DECL_ABSTDLG_CLASS_ASYNC(Class,Dialog) \ +DECL_ABSTDLG_CLASS_SHARED_ASYNC(Class,Class,Dialog) + +#define IMPL_ABSTDLG_CLASS_ASYNC(Class,Dialog) \ +short Class##_Impl::Execute() \ +{ \ + return m_xDlg->run(); \ +} \ +bool Class##_Impl::StartExecuteAsync(AsyncContext &rCtx) \ +{ \ + return Dialog::runAsync(m_xDlg, rCtx.maEndDialogFn); \ +} + +// CuiAbstractController_Impl +DECL_ABSTDLG_CLASS_UNIQUE(CuiAbstractController, VclAbstractDialog, weld::DialogController) +}; + +// CuiAbstractControllerAsync_Impl +DECL_ABSTDLG_CLASS_SHARED_ASYNC(CuiAbstractControllerAsync, VclAbstractDialog, weld::DialogController) +}; + +// CuiAbstractSingleTabController_Impl +DECL_ABSTDLG_CLASS_UNIQUE(CuiAbstractSingleTabController, SfxAbstractDialog, SfxSingleTabDialogController) + virtual const SfxItemSet* GetOutputItemSet() const override; + //From class Window. + virtual void SetText( const OUString& rStr ) override; +}; + +// CuiAbstractTabController_Impl +DECL_ABSTDLG_CLASS_SHARED_ASYNC(CuiAbstractTabController, SfxAbstractTabDialog, SfxTabDialogController) + virtual void SetCurPageId( const OString &rName ) override; + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; + virtual void SetInputSet( const SfxItemSet* pInSet ) override; + virtual void SetText( const OUString& rStr ) override; + + // screenshotting + virtual std::vector getAllPageUIXMLDescriptions() const override; + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; +}; + +// AbstractHangulHanjaConversionDialog_Impl +DECL_ABSTDLG_CLASS_UNIQUE(AbstractHangulHanjaConversionDialog,AbstractHangulHanjaConversionDialog,svx::HangulHanjaConversionDialog) + virtual void EndDialog(sal_Int32 nResult) override; + virtual void EnableRubySupport( bool _bVal ) override; + virtual void SetByCharacter( bool _bByCharacter ) override ; + virtual void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) override; + virtual void SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType ) override; + virtual void SetOptionsChangedHdl( const Link& _rHdl ) override; + virtual void SetIgnoreHdl( const Link& _rHdl ) override; + virtual void SetIgnoreAllHdl( const Link& _rHdl ) override ; + virtual void SetChangeHdl( const Link& _rHdl ) override ; + virtual void SetChangeAllHdl( const Link& rHdl ) override ; + virtual void SetClickByCharacterHdl( const Link& rHdl ) override ; + virtual void SetConversionFormatChangedHdl( const Link& _rHdl ) override ; + virtual void SetFindHdl( const Link& _rHdl ) override; + virtual bool GetUseBothDirections( ) const override; + virtual editeng::HangulHanjaConversion::ConversionDirection + GetDirection( editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const override; + virtual void SetCurrentString( + const OUString& _rNewString, + const css::uno::Sequence< OUString >& _rSuggestions, + bool _bOriginatesFromDocument = true + ) override; + virtual OUString GetCurrentString( ) const override ; + virtual editeng::HangulHanjaConversion::ConversionFormat + GetConversionFormat( ) const override ; + virtual void FocusSuggestion( ) override; + virtual OUString GetCurrentSuggestion( ) const override; +}; + +// AbstractThesaurusDialog_Impl +DECL_ABSTDLG_CLASS_ASYNC(AbstractThesaurusDialog,SvxThesaurusDialog) + virtual OUString GetWord() override; +}; + +// AbstractHyphenWordDialog_Impl +DECL_ABSTDLG_CLASS(AbstractHyphenWordDialog,SvxHyphenWordDialog) +}; + +// AbstractFmShowColsDialog_Impl +DECL_ABSTDLG_CLASS(AbstractFmShowColsDialog,FmShowColsDialog) + virtual void SetColumns(const css::uno::Reference< css::container::XIndexContainer>& xCols) override; +}; + +// AbstractSvxZoomDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxZoomDialog,SvxZoomDialog) + virtual void SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) override; + virtual void HideButton( ZoomButtonId nBtnId ) override; + virtual const SfxItemSet* GetOutputItemSet() const override ; +}; + +// AbstractSpellDialog_Impl +DECL_ABSTDLG_CLASS_SHARED_ASYNC(AbstractSpellDialog, AbstractSpellDialog, svx::SpellDialog) + virtual void InvalidateDialog() override; + virtual std::shared_ptr GetController() override; + virtual SfxBindings& GetBindings() override; +}; + +// AbstractTitleDialog_Impl +DECL_ABSTDLG_CLASS(AbstractTitleDialog,TitleDialog) + virtual OUString GetTitle() const override ; + +}; + +// AbstractScriptSelectorDialog_Impl +DECL_ABSTDLG_CLASS_ASYNC(AbstractScriptSelectorDialog,SvxScriptSelectorDialog) + virtual OUString GetScriptURL() const override; + virtual void SetRunLabel() override; +}; + +// AbstractGalleryIdDialog_Impl +DECL_ABSTDLG_CLASS(AbstractGalleryIdDialog,GalleryIdDialog) + virtual sal_uInt32 GetId() const override; +}; + +// AbstractURLDlg_Impl +DECL_ABSTDLG_CLASS(AbstractURLDlg, URLDlg) + virtual OUString GetURL() const override; + virtual OUString GetAltText() const override; + virtual OUString GetDesc() const override; + virtual OUString GetTarget() const override; + virtual OUString GetName() const override; +}; + +// AbstractSvxSearchSimilarityDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxSearchSimilarityDialog,SvxSearchSimilarityDialog) + virtual sal_uInt16 GetOther() override; + virtual sal_uInt16 GetShorter() override; + virtual sal_uInt16 GetLonger() override; + virtual bool IsRelaxed() override; +}; + +// AbstractSvxJSearchOptionsDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxJSearchOptionsDialog,SvxJSearchOptionsDialog) + virtual TransliterationFlags GetTransliterationFlags() const override; +}; + +// AbstractSvxTransformTabDialog_Impl +DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxTransformTabDialog,SvxTransformTabDialog) + virtual void SetValidateFramePosLink( const Link& rLink ) override; + virtual void SetCurPageId( const OString& rName ) override; + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; + virtual void SetInputSet( const SfxItemSet* pInSet ) override; + virtual void SetText( const OUString& rStr ) override; +}; + +// AbstractSvxCaptionDialog_Impl +DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxCaptionDialog,SvxCaptionTabDialog) + virtual void SetValidateFramePosLink( const Link& rLink ) override; + virtual void SetCurPageId( const OString& rName ) override; + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; + virtual void SetInputSet( const SfxItemSet* pInSet ) override; + virtual void SetText( const OUString& rStr ) override; +}; + +// AbstractFmInputRecordNoDialog_Impl +DECL_ABSTDLG_CLASS(AbstractFmInputRecordNoDialog,FmInputRecordNoDialog) + virtual void SetValue(tools::Long nNew) override ; + virtual tools::Long GetValue() const override ; +}; + +// AbstractSvxNewDictionaryDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxNewDictionaryDialog,SvxNewDictionaryDialog) + virtual css::uno::Reference< css::linguistic2::XDictionary > GetNewDictionary() override; +}; + +// AbstractSvxNameDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxNameDialog,SvxNameDialog) + virtual void GetName( OUString& rName ) override ; + virtual void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) override ; + virtual void SetCheckNameTooltipHdl( const Link& rLink ) override ; + virtual void SetEditHelpId(const OString&) override ; + //from class Window + virtual void SetHelpId( const OString& ) override ; + virtual void SetText( const OUString& rStr ) override ; + +private: + Link aCheckNameHdl; + Link aCheckNameTooltipHdl; + DECL_LINK(CheckNameHdl, SvxNameDialog&, bool); + DECL_LINK(CheckNameTooltipHdl, SvxNameDialog&, OUString); +}; + +class SvxObjectNameDialog; +class SvxObjectTitleDescDialog; + +// AbstractSvxObjectNameDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog,SvxObjectNameDialog) + virtual void GetName(OUString& rName) override ; + virtual void SetCheckNameHdl(const Link& rLink) override; + +private: + Link aCheckNameHdl; + DECL_LINK(CheckNameHdl, SvxObjectNameDialog&, bool); +}; + +// AbstractSvxObjectTitleDescDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxObjectTitleDescDialog,SvxObjectTitleDescDialog) + virtual void GetTitle(OUString& rName) override; + virtual void GetDescription(OUString& rName) override; +}; + +// AbstractSvxMultiPathDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxMultiPathDialog,SvxMultiPathDialog) + virtual OUString GetPath() const override; + virtual void SetPath( const OUString& rPath ) override; + virtual void SetTitle( const OUString& rNewTitle ) override; +}; + +// AbstractSvxPathSelectDialog_Impl +DECL_ABSTDLG_CLASS_UNIQUE(AbstractSvxPathSelectDialog,AbstractSvxMultiPathDialog,SvxPathSelectDialog) + virtual OUString GetPath() const override; + virtual void SetPath( const OUString& rPath ) override; + virtual void SetTitle( const OUString& rNewTitle ) override; +}; + +// AbstractSvxHpLinkDlg_Impl +DECL_ABSTDLG_CLASS_SHARED(AbstractSvxHpLinkDlg,AbstractSvxHpLinkDlg,SvxHpLinkDlg) + virtual std::shared_ptr GetController() override; + virtual bool QueryClose() override; +}; + +// AbstractFmSearchDialog_Impl +struct FmFoundRecordInformation; +DECL_ABSTDLG_CLASS(AbstractFmSearchDialog,FmSearchDialog) + virtual void SetFoundHandler(const Link& lnk) override ; + virtual void SetCanceledNotFoundHdl(const Link& lnk) override; + virtual void SetActiveField(const OUString& strField) override; +}; + +// AbstractGraphicFilterDialog_Impl +DECL_ABSTDLG_CLASS(AbstractGraphicFilterDialog,GraphicFilterDialog) + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; +}; + +// AbstractSvxAreaTabDialog_Impl +DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxAreaTabDialog,SvxAreaTabDialog) + virtual void SetCurPageId(const OString& rName) override; + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; + virtual void SetInputSet(const SfxItemSet* pInSet) override; + virtual void SetText(const OUString& rStr) override; +}; + +// AbstractInsertObjectDialog_Impl +DECL_ABSTDLG_CLASS_UNIQUE(AbstractInsertObjectDialog,SfxAbstractInsertObjectDialog,InsertObjectDialog_Impl) + virtual css::uno::Reference < css::embed::XEmbeddedObject > GetObject() override; + virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType ) override; + virtual bool IsCreateNew() override; +}; + +// AbstractPasteDialog_Impl +DECL_ABSTDLG_CLASS_SHARED_ASYNC(AbstractPasteDialog,SfxAbstractPasteDialog,SvPasteObjectDialog) + virtual void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName ) override; + virtual void InsertUno( const OUString & sCmd, const OUString& sLabel ) override; + virtual void SetObjName( const SvGlobalName & rClass, const OUString & rObjName ) override; + virtual void PreGetFormat( const TransferableDataHelper& aHelper ) override; + virtual SotClipboardFormatId GetFormatOnly() override; + virtual SotClipboardFormatId GetFormat( const TransferableDataHelper& aHelper ) override; +}; + +// AbstractLinksDialog_Impl +DECL_ABSTDLG_CLASS_UNIQUE(AbstractLinksDialog,SfxAbstractLinksDialog,SvBaseLinksDlg) +}; + +// AbstractSvxPostItDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSvxPostItDialog,SvxPostItDialog) + virtual void SetText( const OUString& rStr ) override; //From class Window + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual void SetPrevHdl( const Link& rLink ) override; + virtual void SetNextHdl( const Link& rLink ) override; + virtual void EnableTravel(bool bNext, bool bPrev) override; + virtual OUString GetNote() override; + virtual void SetNote(const OUString& rTxt) override; + virtual void ShowLastAuthor(const OUString& rAuthor, const OUString& rDate) override; + virtual void DontChangeAuthor() override; + virtual void HideAuthor() override; + virtual std::shared_ptr GetDialog() override; +private: + Link aNextHdl; + Link aPrevHdl; + DECL_LINK(NextHdl, SvxPostItDialog&, void); + DECL_LINK(PrevHdl, SvxPostItDialog&, void); +}; + +// AbstractPasswordToOpenModifyDialog_Impl +DECL_ABSTDLG_CLASS(AbstractPasswordToOpenModifyDialog,PasswordToOpenModifyDialog) + virtual OUString GetPasswordToOpen() const override; + virtual OUString GetPasswordToModify() const override; + virtual bool IsRecommendToOpenReadonly() const override; +}; + +// AbstractSvxCharacterMapDialog_Impl +DECL_ABSTDLG_CLASS_UNIQUE(AbstractSvxCharacterMapDialog,SfxAbstractDialog,SvxCharacterMap) + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual void SetText(const OUString& rStr) override; +}; + +// AbstractScreenshotAnnotationDlg_Impl +DECL_ABSTDLG_CLASS(AbstractScreenshotAnnotationDlg,ScreenshotAnnotationDlg) +}; + +// AbstractSignatureLineDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSignatureLineDialog,SignatureLineDialog) +}; + +// AbstractQrCodeGenDialog_Impl +DECL_ABSTDLG_CLASS(AbstractQrCodeGenDialog,QrCodeGenDialog) +}; + +// AbstractSignSignatureLineDialog_Impl +DECL_ABSTDLG_CLASS(AbstractSignSignatureLineDialog,SignSignatureLineDialog) +}; + +// AbstractAdditionsDialog_Impl +DECL_ABSTDLG_CLASS(AbstractAdditionsDialog,weld::GenericDialogController) +}; + +// AbstractDiagramDialog_Impl +DECL_ABSTDLG_CLASS(AbstractDiagramDialog,DiagramDialog) +}; + +//AbstractDialogFactory_Impl implementations +class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory +{ +public: + virtual VclPtr CreateVclDialog(weld::Window* pParent, sal_uInt32 nResId) override; + + virtual VclPtr CreateSfxDialog( weld::Window* pParent, + const SfxItemSet& rAttr, + const SdrView* pView, + sal_uInt32 nResId ) override; + virtual VclPtr CreateCharMapDialog(weld::Window* pParent, + const SfxItemSet& rAttr, + const css::uno::Reference< css::frame::XFrame >& rFrame) override; + virtual VclPtr CreateEventConfigDialog(weld::Widget* pParent, + const SfxItemSet& rAttr, + const css::uno::Reference< css::frame::XFrame >& rFrame) override; + virtual VclPtr CreateFrameDialog(weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& rxFrame, + sal_uInt32 nResId, + const OUString& rParameter ) override; + virtual VclPtr CreateAutoCorrTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet) override; + virtual VclPtr CreateCustomizeTabDialog(weld::Window* pParent, + const SfxItemSet* pAttrSet, + const css::uno::Reference< css::frame::XFrame >& xViewFrame ) override; + virtual VclPtr CreateTextTabDialog( weld::Window* pParent, + const SfxItemSet* pAttrSet, + SdrView* pView ) override; + virtual VclPtr CreateTabItemDialog(weld::Window* pParent, const SfxItemSet& rSet) override; + virtual VclPtr + CreateCaptionDialog(weld::Window* pParent, + const SdrView* pView, + SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override; + virtual VclPtr + CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommand, + const css::uno::Reference < css::embed::XStorage >& xStor, + const SvObjectServerList* pList ) override; + virtual VclPtr CreateEditObjectDialog(weld::Window* pParent, const OUString& rCommand, + const css::uno::Reference < css::embed::XEmbeddedObject >& xObj ) override; + virtual VclPtr CreatePasteDialog(weld::Window* pParent) override; + virtual VclPtr CreateLinksDialog(weld::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML = false, sfx2::SvBaseLink* p=nullptr) override; + + virtual VclPtr CreateHangulHanjaConversionDialog(weld::Widget* pParent) override; + virtual VclPtr CreateThesaurusDialog(weld::Widget*, + css::uno::Reference xThesaurus, + const OUString &rWord, LanguageType nLanguage) override; + + virtual VclPtr CreateHyphenWordDialog(weld::Widget*, + const OUString &rWord, LanguageType nLang, + css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen, + SvxSpellWrapper* pWrapper) override; + + virtual VclPtr CreateFmShowColsDialog(weld::Window* pParent) override; + virtual VclPtr CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) override; + // add for SvxBorderBackgroundDlg + virtual VclPtr CreateSvxBorderBackgroundDlg( + weld::Window* pParent, + const SfxItemSet& rCoreSet, + bool bEnableDrawingLayerFillStyles) override; + + virtual VclPtr CreateSvxTransformTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + const SdrView* pView, + SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override ; + virtual VclPtr CreateSchTransformTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + const SdrView* pSdrView, + bool bSizeTabPage) override; + virtual VclPtr CreateSvxSpellDialog( + weld::Window* pParent, + SfxBindings* pBindings, + svx::SpellDialogChildWindow* pSpellChildWindow ) override; + + virtual VclPtr CreateActualizeProgressDialog(weld::Widget* pParent, GalleryTheme* pThm) override; + virtual VclPtr CreateTitleDialog(weld::Widget* pParent, const OUString& rOldText) override; + virtual VclPtr CreateGalleryIdDialog(weld::Widget* pParent, + GalleryTheme* pThm) override; + virtual VclPtr CreateGalleryThemePropertiesDialog(weld::Widget* pParent, + ExchangeData* pData, + SfxItemSet* pItemSet) override; + + virtual VclPtr CreateURLDialog(weld::Widget* pParent, + const OUString& rURL, const OUString& rAltText, const OUString& rDescription, + const OUString& rTarget, const OUString& rName, + TargetList& rTargetList ) override; + + virtual VclPtr CreateSvxSearchAttributeDialog(weld::Window* pParent, + SearchAttrItemList& rLst, + const WhichRangesContainer& pWhRanges) override; + virtual VclPtr CreateSvxSearchSimilarityDialog( weld::Window* pParent, + bool bRelax, + sal_uInt16 nOther, + sal_uInt16 nShorter, + sal_uInt16 nLonger) override; + virtual VclPtr CreateSvxJSearchOptionsDialog(weld::Window* pParent, + const SfxItemSet& rOptionsSet, + TransliterationFlags nInitialFlags) override; + virtual VclPtr CreateFmInputRecordNoDialog(weld::Window* pParent) override; + virtual VclPtr CreateSvxNewDictionaryDialog(weld::Window* pParent) override; + virtual VclPtr CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) override; + virtual VclPtr CreateSvxNameDialog(weld::Window* pParent, + const OUString& rName, const OUString& rDesc) override; + // #i68101# + virtual VclPtr CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) override; + virtual VclPtr CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) override; + virtual VclPtr CreateSvxMultiPathDialog(weld::Window* pParent) override; + virtual VclPtr CreateSvxPathSelectDialog(weld::Window* pParent) override; + virtual VclPtr CreateSvxHpLinkDlg(SfxChildWindow* pChild, SfxBindings* pBindings, weld::Window* pParent) override; + virtual VclPtr CreateFmSearchDialog(weld::Window* pParent, + const OUString& strInitialText, + const std::vector< OUString >& _rContexts, + sal_Int16 nInitialContext, + const Link& lnkContextSupplier) override; + virtual VclPtr CreateGraphicFilterEmboss(weld::Window* pParent, + const Graphic& rGraphic) override; + virtual VclPtr CreateGraphicFilterPoster(weld::Window* pParent, + const Graphic& rGraphic) override; + virtual VclPtr CreateGraphicFilterSepia(weld::Window* pParent, + const Graphic& rGraphic) override; + virtual VclPtr CreateGraphicFilterSmooth(weld::Window* pParent, + const Graphic& rGraphic, double nRadius) override; + virtual VclPtr CreateGraphicFilterSolarize(weld::Window* pParent, + const Graphic& rGraphic) override; + virtual VclPtr CreateGraphicFilterMosaic(weld::Window* pParent, + const Graphic& rGraphic) override; + virtual VclPtr CreateSvxAreaTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + SdrModel* pModel, + bool bShadow, + bool bSlideBackground) override; + virtual VclPtr CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, + SdrModel* pModel, + const SdrObject* pObj, + bool bHasObj ) override; + virtual VclPtr CreateSvxPostItDialog(weld::Widget* pParent, + const SfxItemSet& rCoreSet, + bool bPrevNext = false) override; + + // For TabPage + virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) override; + + virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ) override; + virtual DialogGetRanges GetDialogGetRangesFunc() override; + virtual VclPtr CreateSvxScriptOrgDialog(weld::Window* pParent, const OUString& rLanguage) override; + + virtual VclPtr CreateScriptSelectorDialog(weld::Window* pParent, + const css::uno::Reference< css::frame::XFrame >& rxFrame) override; + + virtual void ShowAsyncScriptErrorDialog(weld::Window* pParent, const css::uno::Any& rException) override; + + virtual VclPtr CreateSvxMacroAssignDlg( + weld::Window* _pParent, + const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame, + const bool _bUnoDialogMode, + const css::uno::Reference< css::container::XNameReplace >& _rxEvents, + const sal_uInt16 _nInitiallySelectedEvent + ) override; + + virtual VclPtr CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel) override; + + virtual VclPtr CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, tools::Long nMaxVertical) override; + + virtual std::shared_ptr CreateSvxNewTableDialog(weld::Window* pParent) override ; + + virtual VclPtr CreateOptionsDialog( + weld::Window* pParent, const OUString& rExtensionId ) override; + + virtual VclPtr CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) override; + + virtual VclPtr CreatePasswordToOpenModifyDialog(weld::Window* pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; + + virtual VclPtr CreateScreenshotAnnotationDlg(weld::Dialog& rParentDialog) override; + + virtual VclPtr + CreateSignatureLineDialog(weld::Window* pParent, + const css::uno::Reference xModel, bool bEditExisting) override; + + virtual VclPtr + CreateSignSignatureLineDialog(weld::Window* pParent, + const css::uno::Reference xModel) override; + + virtual VclPtr + CreateQrCodeGenDialog(weld::Window* pParent, + const css::uno::Reference xModel, bool bEditExisting) override; + + virtual VclPtr + CreateAdditionsDialog(weld::Window* pParent, const OUString& sAdditionsTag) override; + + virtual VclPtr CreateAboutDialog(weld::Window* pParent) override; + + virtual VclPtr CreateTipOfTheDayDialog(weld::Window* pParent) override; + + virtual VclPtr CreateToolbarmodeDialog(weld::Window* pParent) override; + + virtual VclPtr CreateDiagramDialog( + weld::Window* pParent, + SdrObjGroup& rDiagram) override; + +#ifdef _WIN32 + virtual VclPtr CreateFileExtCheckDialog(weld::Window* pParent, + const OUString& sTitle, + const OUString& sMsg) override; +#endif +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx new file mode 100644 index 000000000..87f3105a0 --- /dev/null +++ b/cui/source/factory/init.cxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +// hook to call special character dialog for edits +// caution: needs C-Linkage since dynamically loaded via symbol name +extern "C" +{ +SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(weld::Widget* i_pParent, const vcl::Font& i_rFont, OUString& o_rResult) +{ + bool bRet = false; + SvxCharacterMap aDlg(i_pParent, nullptr, nullptr); + aDlg.DisableFontSelection(); + aDlg.SetCharFont(i_rFont); + if (aDlg.run() == RET_OK) + { + sal_UCS4 cChar = aDlg.GetChar(); + // using the new UCS4 constructor + OUString aOUStr( &cChar, 1 ); + o_rResult = aOUStr; + bRet = true; + } + return bRet; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3