Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / dlg / sddlgfact.cxx
blob5481d7533e38fd8c21d8aee6c5add201c066615a
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 <sfx2/objsh.hxx>
21 #include "sddlgfact.hxx"
22 #include <BreakDlg.hxx>
23 #include <copydlg.hxx>
24 #include <custsdlg.hxx>
25 #include <dlg_char.hxx>
26 #include <dlgpage.hxx>
27 #include <dlgfield.hxx>
28 #include <dlgsnap.hxx>
29 #include <layeroptionsdlg.hxx>
30 #include <ins_paste.hxx>
31 #include <inspagob.hxx>
32 #include <morphdlg.hxx>
33 #include <OutlineBulletDlg.hxx>
34 #include <paragr.hxx>
35 #include <present.hxx>
36 #include "RemoteDialog.hxx"
37 #include <prltempl.hxx>
38 #include <sdpreslt.hxx>
39 #include <tabtempl.hxx>
40 #include <tpaction.hxx>
41 #include <vectdlg.hxx>
42 #include <tpoption.hxx>
43 #include <prntopts.hxx>
44 #include <pubdlg.hxx>
45 #include <masterlayoutdlg.hxx>
46 #include <headerfooterdlg.hxx>
47 #include "PhotoAlbumDialog.hxx"
49 IMPL_ABSTDLG_BASE(SdVclAbstractDialog_Impl);
51 short SdAbstractGenericDialog_Impl::Execute()
53 return m_xDlg->run();
56 IMPL_ABSTDLG_BASE(AbstractCopyDlg_Impl);
58 short AbstractSdCustomShowDlg_Impl::Execute()
60 return m_xDlg->run();
63 IMPL_ABSTDLG_BASE(SdAbstractTabDialog_Impl);
64 IMPL_ABSTDLG_BASE(SdPresLayoutTemplateDlg_Impl);
66 short AbstractSdModifyFieldDlg_Impl::Execute()
68 return m_xDlg->run();
71 short AbstractSdSnapLineDlg_Impl::Execute()
73 return m_xDlg->run();
76 short AbstractSdInsertLayerDlg_Impl::Execute()
78 return m_xDlg->run();
81 IMPL_ABSTDLG_BASE(AbstractSdInsertPagesObjsDlg_Impl);
83 short AbstractMorphDlg_Impl::Execute()
85 return m_xDlg->run();
88 short AbstractSdStartPresDlg_Impl::Execute()
90 return m_xDlg->run();
93 IMPL_ABSTDLG_BASE(AbstractSdPresLayoutDlg_Impl);
94 IMPL_ABSTDLG_BASE(SdAbstractSfxDialog_Impl);
96 short AbstractSdVectorizeDlg_Impl::Execute()
98 return m_xDlg->run();
101 IMPL_ABSTDLG_BASE(AbstractSdPublishingDlg_Impl);
102 IMPL_ABSTDLG_BASE(AbstractHeaderFooterDialog_Impl);
103 IMPL_ABSTDLG_BASE(AbstractBulletDialog_Impl);
105 AbstractBreakDlg_Impl::AbstractBreakDlg_Impl(::sd::BreakDlg* pDlg)
106 : m_xDlg(pDlg)
110 short AbstractBreakDlg_Impl::Execute()
112 return m_xDlg->execute();
115 AbstractMasterLayoutDialog_Impl::AbstractMasterLayoutDialog_Impl(::sd::MasterLayoutDialog* pDlg)
116 : m_xDlg(pDlg)
120 short AbstractMasterLayoutDialog_Impl::Execute()
122 return m_xDlg->execute();
125 void AbstractCopyDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
127 pDlg->GetAttr( rOutAttrs );
130 bool AbstractSdCustomShowDlg_Impl::IsModified() const
132 return m_xDlg->IsModified();
135 bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const
137 return m_xDlg->IsCustomShow();
140 void SdAbstractTabDialog_Impl::SetCurPageId( const OString& rName )
142 pDlg->SetCurPageId( rName );
145 const SfxItemSet* SdAbstractTabDialog_Impl::GetOutputItemSet() const
147 return pDlg->GetOutputItemSet();
150 const sal_uInt16* SdAbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
152 return pDlg->GetInputRanges( pItem );
155 void SdAbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
157 pDlg->SetInputSet( pInSet );
160 //From class Window.
161 void SdAbstractTabDialog_Impl::SetText( const OUString& rStr )
163 pDlg->SetText( rStr );
166 void AbstractBulletDialog_Impl::SetCurPageId( const OString& rName )
168 static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetCurPageId( rName );
171 const SfxItemSet* AbstractBulletDialog_Impl::GetOutputItemSet() const
173 return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetOutputItemSet();
176 const sal_uInt16* AbstractBulletDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
178 return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetInputRanges( pItem );
181 void AbstractBulletDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
183 static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetInputSet( pInSet );
186 void AbstractBulletDialog_Impl::SetText( const OUString& rStr )
188 static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetText( rStr );
191 void SdPresLayoutTemplateDlg_Impl::SetCurPageId( const OString& rName )
193 pDlg->SetCurPageId( rName );
196 const SfxItemSet* SdPresLayoutTemplateDlg_Impl::GetOutputItemSet() const
198 return pDlg->GetOutputItemSet();
201 const sal_uInt16* SdPresLayoutTemplateDlg_Impl::GetInputRanges(const SfxItemPool& pItem )
203 return pDlg->GetInputRanges( pItem );
206 void SdPresLayoutTemplateDlg_Impl::SetInputSet( const SfxItemSet* pInSet )
208 pDlg->SetInputSet( pInSet );
211 void SdPresLayoutTemplateDlg_Impl::SetText( const OUString& rStr )
213 pDlg->SetText( rStr );
216 SvxFieldData* AbstractSdModifyFieldDlg_Impl::GetField()
218 return m_xDlg->GetField();
221 SfxItemSet AbstractSdModifyFieldDlg_Impl::GetItemSet()
223 return m_xDlg->GetItemSet();
226 void AbstractSdSnapLineDlg_Impl::GetAttr(SfxItemSet& rOutAttrs)
228 m_xDlg->GetAttr(rOutAttrs);
231 void AbstractSdSnapLineDlg_Impl::HideRadioGroup()
233 m_xDlg->HideRadioGroup();
236 void AbstractSdSnapLineDlg_Impl::HideDeleteBtn()
238 m_xDlg->HideDeleteBtn();
241 void AbstractSdSnapLineDlg_Impl::SetInputFields(bool bEnableX, bool bEnableY)
243 m_xDlg->SetInputFields(bEnableX, bEnableY);
246 void AbstractSdSnapLineDlg_Impl::SetText( const OUString& rStr )
248 m_xDlg->set_title(rStr);
251 void AbstractSdInsertLayerDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
253 m_xDlg->GetAttr(rOutAttrs);
256 void AbstractSdInsertLayerDlg_Impl::SetHelpId( const OString& rHelpId )
258 m_xDlg->set_help_id(rHelpId);
261 std::vector<OUString> AbstractSdInsertPagesObjsDlg_Impl::GetList(const sal_uInt16 nType)
263 return pDlg->GetList(nType);
266 bool AbstractSdInsertPagesObjsDlg_Impl::IsLink()
268 return pDlg->IsLink();
271 bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const
273 return pDlg->IsRemoveUnnessesaryMasterPages();
276 void AbstractMorphDlg_Impl::SaveSettings() const
278 m_xDlg->SaveSettings();
281 sal_uInt16 AbstractMorphDlg_Impl::GetFadeSteps() const
283 return m_xDlg->GetFadeSteps();
286 bool AbstractMorphDlg_Impl::IsAttributeFade() const
288 return m_xDlg->IsAttributeFade();
291 bool AbstractMorphDlg_Impl::IsOrientationFade() const
293 return m_xDlg->IsOrientationFade();
296 void AbstractSdStartPresDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
298 m_xDlg->GetAttr( rOutAttrs );
301 void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
303 pDlg->GetAttr( rOutAttrs );
306 const SfxItemSet* SdAbstractSfxDialog_Impl::GetOutputItemSet() const
308 return pDlg->GetOutputItemSet();
311 void SdAbstractSfxDialog_Impl::SetText( const OUString& rStr )
313 pDlg->SetText( rStr );
316 const GDIMetaFile& AbstractSdVectorizeDlg_Impl::GetGDIMetaFile() const
318 return m_xDlg->GetGDIMetaFile();
321 void AbstractSdPublishingDlg_Impl::GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams )
323 pDlg->GetParameterSequence( rParams );
326 //-------------- SdAbstractDialogFactory implementation--------------
328 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateBreakDlg(
329 weld::Window* pParent,
330 ::sd::DrawView* pDrView,
331 ::sd::DrawDocShell* pShell,
332 sal_uLong nSumActionCount,
333 sal_uLong nObjCount )
335 return VclPtr<AbstractBreakDlg_Impl>::Create(new ::sd::BreakDlg(pParent, pDrView, pShell, nSumActionCount, nObjCount));
338 VclPtr<AbstractCopyDlg> SdAbstractDialogFactory_Impl::CreateCopyDlg(vcl::Window* pParent,
339 const SfxItemSet& rInAttrs,
340 ::sd::View* pView )
342 return VclPtr<AbstractCopyDlg_Impl>::Create( VclPtr<::sd::CopyDlg>::Create( pParent, rInAttrs, pView ) );
345 VclPtr<AbstractSdCustomShowDlg> SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg(weld::Window* pParent, SdDrawDocument& rDrawDoc )
347 return VclPtr<AbstractSdCustomShowDlg_Impl>::Create(new SdCustomShowDlg(pParent, rDrawDoc));
350 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell )
352 return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdCharDlg>::Create(pParent, pAttr, pDocShell) );
355 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabPageDialog(vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage )
357 return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdPageDlg>::Create( pDocShell, pParent, pAttr, bAreaPage ) );
360 VclPtr<AbstractSdModifyFieldDlg> SdAbstractDialogFactory_Impl::CreateSdModifyFieldDlg(weld::Window* pParent, const SvxFieldData* pInField, const SfxItemSet& rSet)
362 return VclPtr<AbstractSdModifyFieldDlg_Impl>::Create(new SdModifyFieldDlg(pParent, pInField, rSet));
365 VclPtr<AbstractSdSnapLineDlg> SdAbstractDialogFactory_Impl::CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView)
367 return VclPtr<AbstractSdSnapLineDlg_Impl>::Create(new SdSnapLineDlg(pParent, rInAttrs, pView));
370 VclPtr<AbstractSdInsertLayerDlg> SdAbstractDialogFactory_Impl::CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr)
372 return VclPtr<AbstractSdInsertLayerDlg_Impl>::Create(new SdInsertLayerDlg(pParent, rInAttrs, bDeletable, aStr));
375 VclPtr<AbstractSdInsertPagesObjsDlg> SdAbstractDialogFactory_Impl::CreateSdInsertPagesObjsDlg( vcl::Window* pParent, const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName )
377 return VclPtr<AbstractSdInsertPagesObjsDlg_Impl>::Create( VclPtr<SdInsertPagesObjsDlg>::Create( pParent, pDoc, pSfxMedium, rFileName ) );
380 VclPtr<AbstractMorphDlg> SdAbstractDialogFactory_Impl::CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
382 return VclPtr<AbstractMorphDlg_Impl>::Create(new ::sd::MorphDlg(pParent, pObj1, pObj2));
385 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
387 return VclPtr<AbstractBulletDialog_Impl>::Create( VclPtr<::sd::OutlineBulletDlg>::Create( pParent, pAttr, pView ) );
390 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr )
392 return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdParagraphDlg>::Create( pParent, pAttr ) );
395 VclPtr<AbstractSdStartPresDlg> SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg(weld::Window* pParent,
396 const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList)
398 return VclPtr<AbstractSdStartPresDlg_Impl>::Create(new SdStartPresentationDlg(pParent, rInAttrs, rPageNames, pCSList));
401 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pParent )
403 return VclPtr<SdVclAbstractDialog_Impl>::Create( VclPtr<::sd::RemoteDialog>::Create( pParent ) );
406 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
408 return VclPtr<SdPresLayoutTemplateDlg_Impl>::Create( VclPtr<SdPresLayoutTemplateDlg>::Create( pDocSh, pParent, bBackgroundDlg, rStyleBase, ePO, pSSPool ) );
411 VclPtr<AbstractSdPresLayoutDlg> SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs)
413 return VclPtr<AbstractSdPresLayoutDlg_Impl>::Create( VclPtr<SdPresLayoutDlg>::Create( pDocShell, nullptr, rInAttrs ) );
416 VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView )
418 return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdTabTemplateDlg>::Create( pParent, pDocShell, rStyleBase, pModel, pView ) );
421 VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
423 return VclPtr<SdAbstractSfxDialog_Impl>::Create( VclPtr<SdActionDlg>::Create( pParent, pAttr, pView ) );
426 VclPtr<AbstractSdVectorizeDlg> SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell)
428 return VclPtr<AbstractSdVectorizeDlg_Impl>::Create(new SdVectorizeDlg(pParent, rBmp, pDocShell));
431 VclPtr<AbstractSdPublishingDlg> SdAbstractDialogFactory_Impl::CreateSdPublishingDlg( vcl::Window* pParent, DocumentType eDocType)
433 return VclPtr<AbstractSdPublishingDlg_Impl>::Create( VclPtr<SdPublishingDlg>::Create( pParent, eDocType ) );
436 // Factories for TabPages
437 CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsContentsTabPageCreatorFunc()
439 return SdTpOptionsContents::Create;
442 CreateTabPage SdAbstractDialogFactory_Impl::GetSdPrintOptionsTabPageCreatorFunc()
444 return SdPrintOptions::Create;
447 CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsMiscTabPageCreatorFunc()
449 return SdTpOptionsMisc::Create;
452 CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsSnapTabPageCreatorFunc()
454 return SdTpOptionsSnap::Create;
457 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage)
459 return VclPtr<AbstractMasterLayoutDialog_Impl>::Create(new ::sd::MasterLayoutDialog(pParent, pDoc, pCurrentPage));
462 VclPtr<AbstractHeaderFooterDialog> SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
463 vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
465 return VclPtr<AbstractHeaderFooterDialog_Impl>::Create( VclPtr<::sd::HeaderFooterDialog>::Create( pViewShell, pParent, pDoc, pCurrentPage ));
468 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog(weld::Window* pParent, SdDrawDocument* pDoc)
470 return VclPtr<SdAbstractGenericDialog_Impl>::Create(new sd::SdPhotoAlbumDialog(pParent, pDoc));
473 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */