bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / dlg / dlgpage.cxx
blobeffc2e4501df22686a6e2744925b7ff3fe9d6fec
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 <svl/intitem.hxx>
21 #include <svx/dialogs.hrc>
22 #include <svx/svxids.hrc>
23 #include <svx/drawitem.hxx>
24 #include <i18nutil/paper.hxx>
25 #include <sfx2/objsh.hxx>
26 #include <sfx2/sfxdlg.hxx>
28 #include <dlgpage.hxx>
30 #include <svl/aeitem.hxx>
31 #include <svx/flagsdef.hxx>
33 /**
34 * Constructor of tab dialog: appends pages to the dialog
36 SdPageDlg::SdPageDlg(SfxObjectShell const * pDocSh, weld::Window* pParent, const SfxItemSet* pAttr, bool bAreaPage)
37 : SfxTabDialogController(pParent, "modules/sdraw/ui/drawpagedialog.ui", "DrawPageDialog", pAttr)
38 , mpDocShell(pDocSh)
40 SvxColorListItem const * pColorListItem = mpDocShell->GetItem( SID_COLOR_TABLE );
41 SvxGradientListItem const * pGradientListItem = mpDocShell->GetItem( SID_GRADIENT_LIST );
42 SvxBitmapListItem const * pBitmapListItem = mpDocShell->GetItem( SID_BITMAP_LIST );
43 SvxPatternListItem const * pPatternListItem = mpDocShell->GetItem( SID_PATTERN_LIST );
44 SvxHatchListItem const * pHatchListItem = mpDocShell->GetItem( SID_HATCH_LIST );
46 mpColorList = pColorListItem->GetColorList();
47 mpGradientList = pGradientListItem->GetGradientList();
48 mpHatchingList = pHatchListItem->GetHatchList();
49 mpBitmapList = pBitmapListItem->GetBitmapList();
50 mpPatternList = pPatternListItem->GetPatternList();
52 SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
54 AddTabPage("RID_SVXPAGE_PAGE", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PAGE), nullptr);
55 AddTabPage("RID_SVXPAGE_AREA", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_AREA), nullptr);
56 AddTabPage("RID_SVXPAGE_TRANSPARENCE", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TRANSPARENCE), nullptr);
58 if (!bAreaPage) // I have to add the page before I remove it !
60 RemoveTabPage("RID_SVXPAGE_AREA");
61 RemoveTabPage("RID_SVXPAGE_TRANSPARENCE");
65 void SdPageDlg::PageCreated(const OString& rId, SfxTabPage& rPage)
67 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
68 if (rId == "RID_SVXPAGE_PAGE")
70 aSet.Put (SfxAllEnumItem(sal_uInt16(SID_ENUM_PAGE_MODE), SVX_PAGE_MODE_PRESENTATION));
71 aSet.Put (SfxAllEnumItem(sal_uInt16(SID_PAPER_START), PAPER_A0));
72 aSet.Put (SfxAllEnumItem(sal_uInt16(SID_PAPER_END), PAPER_E));
73 rPage.PageCreated(aSet);
75 else if (rId == "RID_SVXPAGE_AREA")
77 aSet.Put (SvxColorListItem(mpColorList,SID_COLOR_TABLE));
78 aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
79 aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
80 aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST));
81 aSet.Put (SvxPatternListItem(mpPatternList,SID_PATTERN_LIST));
82 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
83 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
84 aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
85 rPage.PageCreated(aSet);
87 else if (rId == "RID_SVXPAGE_TRANSPARENCE")
89 aSet.Put(SfxUInt16Item(SID_PAGE_TYPE,0));
90 aSet.Put(SfxUInt16Item(SID_DLG_TYPE,1));
91 rPage.PageCreated(aSet);
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */