bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / dlg / sddlgfact.cxx
blob05353b7bcecd431a279d5bddd193a939d3353018
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "sddlgfact.hxx"
21 #include <BreakDlg.hxx>
22 #include <copydlg.hxx>
23 #include <custsdlg.hxx>
24 #include <dlg_char.hxx>
25 #include <dlgpage.hxx>
26 #include <dlgfield.hxx>
27 #include <dlgsnap.hxx>
28 #include <layeroptionsdlg.hxx>
29 #include <inspagob.hxx>
30 #include <morphdlg.hxx>
31 #include <OutlineBulletDlg.hxx>
32 #include <paragr.hxx>
33 #include <present.hxx>
34 #include "RemoteDialog.hxx"
35 #include <prltempl.hxx>
36 #include <sdpreslt.hxx>
37 #include <tabtempl.hxx>
38 #include <tpaction.hxx>
39 #include <vectdlg.hxx>
40 #include <tpoption.hxx>
41 #include <prntopts.hxx>
42 #include <pubdlg.hxx>
43 #include <masterlayoutdlg.hxx>
44 #include <headerfooterdlg.hxx>
45 #include "PhotoAlbumDialog.hxx"
47 IMPL_ABSTDLG_BASE(SdVclAbstractDialog_Impl);
49 short AbstractSvxBulletAndPositionDlg_Impl::Execute()
51 return m_xDlg->run();
54 short SdAbstractGenericDialog_Impl::Execute()
56 return m_xDlg->run();
59 const SfxItemSet* AbstractSvxBulletAndPositionDlg_Impl::GetOutputItemSet( SfxItemSet* pSet ) const
61 return m_xDlg->GetOutputItemSet( pSet );
64 bool AbstractSvxBulletAndPositionDlg_Impl::IsApplyToMaster()
66 return m_xDlg->IsApplyToMaster();
69 bool AbstractSvxBulletAndPositionDlg_Impl::IsSlideScope()
71 return m_xDlg->IsSlideScope();
74 short AbstractCopyDlg_Impl::Execute()
76 return m_xDlg->run();
79 short AbstractSdCustomShowDlg_Impl::Execute()
81 return m_xDlg->run();
84 short SdPresLayoutTemplateDlg_Impl::Execute()
86 return m_xDlg->run();
89 bool SdPresLayoutTemplateDlg_Impl::StartExecuteAsync(AsyncContext &rCtx)
91 return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
94 short AbstractSdModifyFieldDlg_Impl::Execute()
96 return m_xDlg->run();
99 short AbstractSdSnapLineDlg_Impl::Execute()
101 return m_xDlg->run();
104 short AbstractSdInsertLayerDlg_Impl::Execute()
106 return m_xDlg->run();
109 short AbstractSdInsertPagesObjsDlg_Impl::Execute()
111 return m_xDlg->run();
114 short AbstractMorphDlg_Impl::Execute()
116 return m_xDlg->run();
119 short AbstractSdStartPresDlg_Impl::Execute()
121 return m_xDlg->run();
124 short AbstractSdPresLayoutDlg_Impl::Execute()
126 return m_xDlg->run();
129 short SdAbstractSfxDialog_Impl::Execute()
131 return m_xDlg->run();
134 short AbstractSdVectorizeDlg_Impl::Execute()
136 return m_xDlg->run();
139 IMPL_ABSTDLG_BASE(AbstractSdPublishingDlg_Impl);
140 IMPL_ABSTDLG_BASE(AbstractHeaderFooterDialog_Impl);
142 short AbstractBulletDialog_Impl::Execute()
144 return m_xDlg->run();
147 bool AbstractBulletDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
149 return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
152 AbstractBreakDlg_Impl::AbstractBreakDlg_Impl(std::unique_ptr<::sd::BreakDlg> pDlg)
153 : m_xDlg(std::move(pDlg))
157 short AbstractBreakDlg_Impl::Execute()
159 return m_xDlg->run();
162 AbstractMasterLayoutDialog_Impl::AbstractMasterLayoutDialog_Impl(std::unique_ptr<::sd::MasterLayoutDialog> pDlg)
163 : m_xDlg(std::move(pDlg))
167 short AbstractMasterLayoutDialog_Impl::Execute()
169 return m_xDlg->run();
172 void AbstractCopyDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
174 m_xDlg->GetAttr( rOutAttrs );
177 bool AbstractSdCustomShowDlg_Impl::IsModified() const
179 return m_xDlg->IsModified();
182 bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const
184 return m_xDlg->IsCustomShow();
187 short SdAbstractTabController_Impl::Execute()
189 return m_xDlg->run();
192 void SdAbstractTabController_Impl::SetCurPageId( const OString &rName )
194 m_xDlg->SetCurPageId( rName );
197 const SfxItemSet* SdAbstractTabController_Impl::GetOutputItemSet() const
199 return m_xDlg->GetOutputItemSet();
202 const sal_uInt16* SdAbstractTabController_Impl::GetInputRanges(const SfxItemPool& pItem )
204 return m_xDlg->GetInputRanges( pItem );
207 void SdAbstractTabController_Impl::SetInputSet( const SfxItemSet* pInSet )
209 m_xDlg->SetInputSet( pInSet );
212 bool SdAbstractTabController_Impl::StartExecuteAsync(AsyncContext &rCtx)
214 return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
217 //From class Window.
218 void SdAbstractTabController_Impl::SetText( const OUString& rStr )
220 m_xDlg->set_title(rStr);
223 void AbstractBulletDialog_Impl::SetCurPageId( const OString& rName )
225 m_xDlg->SetCurPageId( rName );
228 const SfxItemSet* AbstractBulletDialog_Impl::GetOutputItemSet() const
230 return static_cast< ::sd::OutlineBulletDlg*>(m_xDlg.get())->GetBulletOutputItemSet();
233 const sal_uInt16* AbstractBulletDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
235 return m_xDlg->GetInputRanges(pItem);
238 void AbstractBulletDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
240 m_xDlg->SetInputSet(pInSet);
243 void AbstractBulletDialog_Impl::SetText( const OUString& rStr )
245 m_xDlg->set_title(rStr);
248 void SdPresLayoutTemplateDlg_Impl::SetCurPageId( const OString& rName )
250 m_xDlg->SetCurPageId( rName );
253 const SfxItemSet* SdPresLayoutTemplateDlg_Impl::GetOutputItemSet() const
255 return m_xDlg->GetOutputItemSet();
258 const sal_uInt16* SdPresLayoutTemplateDlg_Impl::GetInputRanges(const SfxItemPool& pItem )
260 return m_xDlg->GetInputRanges( pItem );
263 void SdPresLayoutTemplateDlg_Impl::SetInputSet( const SfxItemSet* pInSet )
265 m_xDlg->SetInputSet( pInSet );
268 void SdPresLayoutTemplateDlg_Impl::SetText( const OUString& rStr )
270 m_xDlg->set_title(rStr);
273 SvxFieldData* AbstractSdModifyFieldDlg_Impl::GetField()
275 return m_xDlg->GetField();
278 SfxItemSet AbstractSdModifyFieldDlg_Impl::GetItemSet()
280 return m_xDlg->GetItemSet();
283 void AbstractSdSnapLineDlg_Impl::GetAttr(SfxItemSet& rOutAttrs)
285 m_xDlg->GetAttr(rOutAttrs);
288 void AbstractSdSnapLineDlg_Impl::HideRadioGroup()
290 m_xDlg->HideRadioGroup();
293 void AbstractSdSnapLineDlg_Impl::HideDeleteBtn()
295 m_xDlg->HideDeleteBtn();
298 void AbstractSdSnapLineDlg_Impl::SetInputFields(bool bEnableX, bool bEnableY)
300 m_xDlg->SetInputFields(bEnableX, bEnableY);
303 void AbstractSdSnapLineDlg_Impl::SetText( const OUString& rStr )
305 m_xDlg->set_title(rStr);
308 void AbstractSdInsertLayerDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
310 m_xDlg->GetAttr(rOutAttrs);
313 void AbstractSdInsertLayerDlg_Impl::SetHelpId( const OString& rHelpId )
315 m_xDlg->set_help_id(rHelpId);
318 std::vector<OUString> AbstractSdInsertPagesObjsDlg_Impl::GetList(const sal_uInt16 nType)
320 return m_xDlg->GetList(nType);
323 bool AbstractSdInsertPagesObjsDlg_Impl::IsLink()
325 return m_xDlg->IsLink();
328 bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const
330 return m_xDlg->IsRemoveUnnessesaryMasterPages();
333 void AbstractMorphDlg_Impl::SaveSettings() const
335 m_xDlg->SaveSettings();
338 sal_uInt16 AbstractMorphDlg_Impl::GetFadeSteps() const
340 return m_xDlg->GetFadeSteps();
343 bool AbstractMorphDlg_Impl::IsAttributeFade() const
345 return m_xDlg->IsAttributeFade();
348 bool AbstractMorphDlg_Impl::IsOrientationFade() const
350 return m_xDlg->IsOrientationFade();
353 void AbstractSdStartPresDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
355 m_xDlg->GetAttr(rOutAttrs);
358 void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
360 m_xDlg->GetAttr(rOutAttrs);
363 const SfxItemSet* SdAbstractSfxDialog_Impl::GetOutputItemSet() const
365 return m_xDlg->GetOutputItemSet();
368 void SdAbstractSfxDialog_Impl::SetText( const OUString& rStr )
370 m_xDlg->set_title(rStr);
373 const GDIMetaFile& AbstractSdVectorizeDlg_Impl::GetGDIMetaFile() const
375 return m_xDlg->GetGDIMetaFile();
378 void AbstractSdPublishingDlg_Impl::GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams )
380 pDlg->GetParameterSequence( rParams );
383 //-------------- SdAbstractDialogFactory implementation--------------
385 VclPtr<AbstractSvxBulletAndPositionDlg> SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView)
387 return VclPtr<AbstractSvxBulletAndPositionDlg_Impl>::Create(std::make_unique<SvxBulletAndPositionDlg>(pParent, *pAttr, pView));
390 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateBreakDlg(
391 weld::Window* pParent,
392 ::sd::DrawView* pDrView,
393 ::sd::DrawDocShell* pShell,
394 sal_uLong nSumActionCount,
395 sal_uLong nObjCount )
397 return VclPtr<AbstractBreakDlg_Impl>::Create(std::make_unique<::sd::BreakDlg>(pParent, pDrView, pShell, nSumActionCount, nObjCount));
400 VclPtr<AbstractCopyDlg> SdAbstractDialogFactory_Impl::CreateCopyDlg(weld::Window* pParent,
401 const SfxItemSet& rInAttrs,
402 ::sd::View* pView )
404 return VclPtr<AbstractCopyDlg_Impl>::Create(std::make_unique<::sd::CopyDlg>(pParent, rInAttrs, pView));
407 VclPtr<AbstractSdCustomShowDlg> SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg(weld::Window* pParent, SdDrawDocument& rDrawDoc )
409 return VclPtr<AbstractSdCustomShowDlg_Impl>::Create(std::make_unique<SdCustomShowDlg>(pParent, rDrawDoc));
412 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(weld::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell)
414 return VclPtr<SdAbstractTabController_Impl>::Create(std::make_unique<SdCharDlg>(pParent, pAttr, pDocShell));
417 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage )
419 return VclPtr<SdAbstractTabController_Impl>::Create(std::make_unique<SdPageDlg>(pDocShell, pParent, pAttr, bAreaPage));
422 VclPtr<AbstractSdModifyFieldDlg> SdAbstractDialogFactory_Impl::CreateSdModifyFieldDlg(weld::Window* pParent, const SvxFieldData* pInField, const SfxItemSet& rSet)
424 return VclPtr<AbstractSdModifyFieldDlg_Impl>::Create(std::make_unique<SdModifyFieldDlg>(pParent, pInField, rSet));
427 VclPtr<AbstractSdSnapLineDlg> SdAbstractDialogFactory_Impl::CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView)
429 return VclPtr<AbstractSdSnapLineDlg_Impl>::Create(std::make_unique<SdSnapLineDlg>(pParent, rInAttrs, pView));
432 VclPtr<AbstractSdInsertLayerDlg> SdAbstractDialogFactory_Impl::CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr)
434 return VclPtr<AbstractSdInsertLayerDlg_Impl>::Create(std::make_unique<SdInsertLayerDlg>(pParent, rInAttrs, bDeletable, aStr));
437 VclPtr<AbstractSdInsertPagesObjsDlg> SdAbstractDialogFactory_Impl::CreateSdInsertPagesObjsDlg(weld::Window* pParent, const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName)
439 return VclPtr<AbstractSdInsertPagesObjsDlg_Impl>::Create(std::make_unique<SdInsertPagesObjsDlg>(pParent, pDoc, pSfxMedium, rFileName));
442 VclPtr<AbstractMorphDlg> SdAbstractDialogFactory_Impl::CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
444 return VclPtr<AbstractMorphDlg_Impl>::Create(std::make_unique<::sd::MorphDlg>(pParent, pObj1, pObj2));
447 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView)
449 return VclPtr<AbstractBulletDialog_Impl>::Create(std::make_unique<::sd::OutlineBulletDlg>(pParent, pAttr, pView));
452 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg(weld::Window* pParent, const SfxItemSet* pAttr )
454 return VclPtr<SdAbstractTabController_Impl>::Create(std::make_unique<SdParagraphDlg>(pParent, pAttr));
457 VclPtr<AbstractSdStartPresDlg> SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg(weld::Window* pParent,
458 const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList)
460 return VclPtr<AbstractSdStartPresDlg_Impl>::Create(std::make_unique<SdStartPresentationDlg>(pParent, rInAttrs, rPageNames, pCSList));
463 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pParent )
465 return VclPtr<SdVclAbstractDialog_Impl>::Create( VclPtr<::sd::RemoteDialog>::Create( pParent ) );
468 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool)
470 return VclPtr<SdPresLayoutTemplateDlg_Impl>::Create(std::make_unique<SdPresLayoutTemplateDlg>(pDocSh, pParent, bBackgroundDlg, rStyleBase, ePO, pSSPool));
473 VclPtr<AbstractSdPresLayoutDlg> SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs)
475 return VclPtr<AbstractSdPresLayoutDlg_Impl>::Create(std::make_unique<SdPresLayoutDlg>(pDocShell, pParent, rInAttrs));
478 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView)
480 return VclPtr<SdAbstractTabController_Impl>::Create(std::make_unique<SdTabTemplateDlg>(pParent, pDocShell, rStyleBase, pModel, pView));
483 VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
485 return VclPtr<SdAbstractSfxDialog_Impl>::Create(std::make_unique<SdActionDlg>(pParent, pAttr, pView));
488 VclPtr<AbstractSdVectorizeDlg> SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell)
490 return VclPtr<AbstractSdVectorizeDlg_Impl>::Create(std::make_unique<SdVectorizeDlg>(pParent, rBmp, pDocShell));
493 VclPtr<AbstractSdPublishingDlg> SdAbstractDialogFactory_Impl::CreateSdPublishingDlg( vcl::Window* pParent, DocumentType eDocType)
495 return VclPtr<AbstractSdPublishingDlg_Impl>::Create( VclPtr<SdPublishingDlg>::Create( pParent, eDocType ) );
498 // Factories for TabPages
499 CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsContentsTabPageCreatorFunc()
501 return SdTpOptionsContents::Create;
504 CreateTabPage SdAbstractDialogFactory_Impl::GetSdPrintOptionsTabPageCreatorFunc()
506 return SdPrintOptions::Create;
509 CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsMiscTabPageCreatorFunc()
511 return SdTpOptionsMisc::Create;
514 CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsSnapTabPageCreatorFunc()
516 return SdTpOptionsSnap::Create;
519 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage)
521 return VclPtr<AbstractMasterLayoutDialog_Impl>::Create(std::make_unique<::sd::MasterLayoutDialog>(pParent, pDoc, pCurrentPage));
524 VclPtr<AbstractHeaderFooterDialog> SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
525 vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
527 return VclPtr<AbstractHeaderFooterDialog_Impl>::Create( VclPtr<::sd::HeaderFooterDialog>::Create( pViewShell, pParent, pDoc, pCurrentPage ));
530 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog(weld::Window* pParent, SdDrawDocument* pDoc)
532 return VclPtr<SdAbstractGenericDialog_Impl>::Create(std::make_unique<sd::SdPhotoAlbumDialog>(pParent, pDoc));
535 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */