bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / dlg / tabtempl.cxx
bloba730fb91c8deace0bf0bc4ec94b9ec3fade969d7
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 <editeng/flstitem.hxx>
22 #include <svx/svxids.hrc>
24 #include <svx/drawitem.hxx>
25 #include <svl/intitem.hxx>
26 #include <svx/ofaitem.hxx>
27 #include <svx/svdmodel.hxx>
28 #include <svl/cjkoptions.hxx>
29 #include <sfx2/objsh.hxx>
30 #include <svx/dialogs.hrc>
31 #include <svl/style.hxx>
33 #include <tabtempl.hxx>
34 #include <svx/flagsdef.hxx>
36 /**
37 * Constructor of the Tab dialog: appends pages to the dialog
39 SdTabTemplateDlg::SdTabTemplateDlg(weld::Window* pParent,
40 const SfxObjectShell* pDocShell,
41 SfxStyleSheetBase& rStyleBase,
42 SdrModel const * pModel,
43 SdrView* pView)
44 : SfxStyleDialogController(pParent, "modules/simpress/ui/templatedialog.ui",
45 "TemplateDialog", rStyleBase)
46 , rDocShell(*pDocShell)
47 , pSdrView(pView)
48 , pColorList(pModel->GetColorList())
49 , pGradientList(pModel->GetGradientList())
50 , pHatchingList(pModel->GetHatchList())
51 , pBitmapList(pModel->GetBitmapList())
52 , pPatternList(pModel->GetPatternList())
53 , pDashList(pModel->GetDashList())
54 , pLineEndList(pModel->GetLineEndList())
56 // fill Listbox and set Select-Handler
58 AddTabPage("line", RID_SVXPAGE_LINE);
59 AddTabPage("area", RID_SVXPAGE_AREA);
60 AddTabPage("shadowing", RID_SVXPAGE_SHADOW);
61 AddTabPage("transparency", RID_SVXPAGE_TRANSPARENCE);
62 AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
63 AddTabPage("fonteffect", RID_SVXPAGE_CHAR_EFFECTS);
64 AddTabPage("background", RID_SVXPAGE_BKG);
65 AddTabPage("indents", RID_SVXPAGE_STD_PARAGRAPH);
66 AddTabPage("text", RID_SVXPAGE_TEXTATTR);
67 AddTabPage("animation", RID_SVXPAGE_TEXTANIMATION);
68 AddTabPage("dimensioning", RID_SVXPAGE_MEASURE);
69 AddTabPage("connector", RID_SVXPAGE_CONNECTION);
70 AddTabPage("alignment", RID_SVXPAGE_ALIGN_PARAGRAPH);
71 AddTabPage("tabs", RID_SVXPAGE_TABULATOR);
72 SvtCJKOptions aCJKOptions;
73 if( aCJKOptions.IsAsianTypographyEnabled() )
74 AddTabPage("asiantypo", RID_SVXPAGE_PARA_ASIAN);
75 else
76 RemoveTabPage("asiantypo");
79 void SdTabTemplateDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
81 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
82 if (rId == "line")
84 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
85 aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
86 aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
87 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
88 rPage.PageCreated(aSet);
90 else if (rId == "area")
92 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
93 aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
94 aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
95 aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
96 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
97 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
98 aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
99 aSet.Put (SvxPatternListItem(pPatternList,SID_PATTERN_LIST));
100 rPage.PageCreated(aSet);
102 else if (rId == "shadowing")
104 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
105 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
106 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
107 rPage.PageCreated(aSet);
109 else if (rId == "transparency")
111 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
112 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
113 rPage.PageCreated(aSet);
115 else if (rId == "font")
117 SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(
118 rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) );
120 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
121 rPage.PageCreated(aSet);
123 else if (rId == "fonteffect")
125 rPage.PageCreated(aSet);
127 else if (rId == "background")
129 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
130 rPage.PageCreated(aSet);
132 else if (rId == "text")
134 rPage.PageCreated(aSet);
136 else if (rId == "dimensioning")
138 aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
139 rPage.PageCreated(aSet);
141 else if (rId == "connector")
143 aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
144 rPage.PageCreated(aSet);
148 void SdTabTemplateDlg::RefreshInputSet()
150 SfxItemSet* pInputSet = GetInputSetImpl();
152 if( pInputSet )
154 pInputSet->ClearItem();
155 pInputSet->SetParent( GetStyleSheet().GetItemSet().GetParent() );
157 else
158 SetInputSet(&GetStyleSheet().GetItemSet());
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */