LibreOffice Module sd (master) 1
tabtempl.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <editeng/flstitem.hxx>
21
22#include <svx/svxids.hrc>
23
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>
32
33#include <tabtempl.hxx>
34#include <svx/flagsdef.hxx>
35
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())
55{
56 // fill Listbox and set Select-Handler
57
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);
73 AddTabPage("asiantypo", RID_SVXPAGE_PARA_ASIAN);
74 else
75 RemoveTabPage("asiantypo");
76}
77
78void SdTabTemplateDlg::PageCreated(const OUString& rId, SfxTabPage &rPage)
79{
80 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
81 if (rId == "line")
82 {
83 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
84 aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
85 aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
86 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
87 rPage.PageCreated(aSet);
88 }
89 else if (rId == "area")
90 {
91 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
92 aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
93 aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
94 aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
95 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
96 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
97 aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
98 aSet.Put (SvxPatternListItem(pPatternList,SID_PATTERN_LIST));
99 rPage.PageCreated(aSet);
100 }
101 else if (rId == "shadowing")
102 {
103 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
104 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
105 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
106 rPage.PageCreated(aSet);
107 }
108 else if (rId == "transparency")
109 {
110 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
111 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
112 rPage.PageCreated(aSet);
113 }
114 else if (rId == "font")
115 {
116 SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(
117 rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) );
118
119 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
120 rPage.PageCreated(aSet);
121 }
122 else if (rId == "fonteffect")
123 {
124 rPage.PageCreated(aSet);
125 }
126 else if (rId == "background")
127 {
128 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
129 rPage.PageCreated(aSet);
130 }
131 else if (rId == "text")
132 {
133 rPage.PageCreated(aSet);
134 }
135 else if (rId == "dimensioning")
136 {
137 aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
138 rPage.PageCreated(aSet);
139 }
140 else if (rId == "connector")
141 {
142 aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
143 rPage.PageCreated(aSet);
144 }
145}
146
148{
149 SfxItemSet* pInputSet = GetInputSetImpl();
150
151 if( pInputSet )
152 {
153 pInputSet->ClearItem();
154 pInputSet->SetParent( GetStyleSheet().GetItemSet().GetParent() );
155 }
156 else
158}
159
160/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxObjectShell & rDocShell
Definition: tabtempl.hxx:35
SdrView * pSdrView
Definition: tabtempl.hxx:36
virtual void RefreshInputSet() override
Definition: tabtempl.cxx:147
XDashListRef pDashList
Definition: tabtempl.hxx:43
XBitmapListRef pBitmapList
Definition: tabtempl.hxx:41
XGradientListRef pGradientList
Definition: tabtempl.hxx:39
XPatternListRef pPatternList
Definition: tabtempl.hxx:42
SdTabTemplateDlg(weld::Window *pParent, const SfxObjectShell *pDocShell, SfxStyleSheetBase &rStyleBase, SdrModel const *pModel, SdrView *pView)
Constructor of the Tab dialog: appends pages to the dialog.
Definition: tabtempl.cxx:39
XColorListRef pColorList
Definition: tabtempl.hxx:38
XLineEndListRef pLineEndList
Definition: tabtempl.hxx:44
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: tabtempl.cxx:78
XHatchListRef pHatchingList
Definition: tabtempl.hxx:40
void SetParent(const SfxItemSet *pNew)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
SfxStyleSheetBase & GetStyleSheet()
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void SetInputSet(const SfxItemSet *pInSet)
void RemoveTabPage(const OUString &rName)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
const FontList * GetFontList() const
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
bool IsAsianTypographyEnabled()