Line data Source code
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/svxgrahicitem.hxx>
28 : #include <svx/svdmodel.hxx>
29 : #include <svl/cjkoptions.hxx>
30 :
31 :
32 : #include <svx/dialogs.hrc>
33 :
34 : #include <svx/svxdlg.hxx>
35 : #include <svx/tabline.hxx>
36 : #include <svl/style.hxx>
37 : #include <svx/xtable.hxx>
38 :
39 : #include "DrawDocShell.hxx"
40 : #include "tabtempl.hxx"
41 : #include "tabtempl.hrc"
42 : #include "sdresid.hxx"
43 : #include "dlg_char.hxx"
44 : #include "paragr.hxx"
45 : #include <svx/flagsdef.hxx>
46 :
47 : /**
48 : * Constructor of the Tab dialog: appends pages to the dialog
49 : */
50 0 : SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent,
51 : const SfxObjectShell* pDocShell,
52 : SfxStyleSheetBase& rStyleBase,
53 : SdrModel* pModel,
54 : SdrView* pView ) :
55 : SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ),
56 : rDocShell ( *pDocShell ),
57 : pSdrView ( pView ),
58 : pColorList ( pModel->GetColorList() ),
59 : pGradientList ( pModel->GetGradientList() ),
60 : pHatchingList ( pModel->GetHatchList() ),
61 : pBitmapList ( pModel->GetBitmapList() ),
62 : pDashList ( pModel->GetDashList() ),
63 0 : pLineEndList ( pModel->GetLineEndList() )
64 : {
65 0 : FreeResource();
66 :
67 : // fill Listbox and overload Select-Handler
68 :
69 0 : AddTabPage( RID_SVXPAGE_LINE);
70 0 : AddTabPage( RID_SVXPAGE_AREA);
71 0 : AddTabPage( RID_SVXPAGE_SHADOW);
72 0 : AddTabPage( RID_SVXPAGE_TRANSPARENCE);
73 0 : AddTabPage( RID_SVXPAGE_CHAR_NAME );
74 0 : AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
75 0 : AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
76 0 : AddTabPage( RID_SVXPAGE_TEXTATTR );
77 0 : AddTabPage( RID_SVXPAGE_TEXTANIMATION );
78 0 : AddTabPage( RID_SVXPAGE_MEASURE);
79 0 : AddTabPage( RID_SVXPAGE_CONNECTION);
80 0 : AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
81 0 : AddTabPage( RID_SVXPAGE_TABULATOR );
82 0 : SvtCJKOptions aCJKOptions;
83 0 : if( aCJKOptions.IsAsianTypographyEnabled() )
84 0 : AddTabPage( RID_SVXPAGE_PARA_ASIAN );
85 : else
86 0 : RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
87 :
88 0 : nDlgType = 1;
89 0 : nPageType = 0;
90 0 : nPos = 0;
91 :
92 0 : nColorTableState = CT_NONE;
93 0 : nBitmapListState = CT_NONE;
94 0 : nGradientListState = CT_NONE;
95 0 : nHatchingListState = CT_NONE;
96 0 : }
97 :
98 : // -----------------------------------------------------------------------
99 :
100 0 : SdTabTemplateDlg::~SdTabTemplateDlg()
101 : {
102 0 : }
103 :
104 : // -----------------------------------------------------------------------
105 :
106 0 : void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
107 : {
108 0 : SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
109 0 : switch( nId )
110 : {
111 : case RID_SVXPAGE_LINE:
112 0 : aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
113 0 : aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
114 0 : aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
115 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
116 0 : rPage.PageCreated(aSet);
117 0 : break;
118 :
119 : case RID_SVXPAGE_AREA:
120 0 : aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
121 0 : aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
122 0 : aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
123 0 : aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
124 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
125 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
126 0 : aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos));
127 0 : rPage.PageCreated(aSet);
128 :
129 :
130 0 : break;
131 :
132 : case RID_SVXPAGE_SHADOW:
133 0 : aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
134 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
135 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
136 0 : rPage.PageCreated(aSet);
137 0 : break;
138 :
139 : case RID_SVXPAGE_TRANSPARENCE:
140 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
141 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
142 0 : rPage.PageCreated(aSet);
143 0 : break;
144 :
145 : case RID_SVXPAGE_CHAR_NAME:
146 : {
147 : SvxFontListItem aItem(*( (const SvxFontListItem*)
148 0 : ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
149 :
150 0 : aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
151 0 : rPage.PageCreated(aSet);
152 : }
153 0 : break;
154 :
155 : case RID_SVXPAGE_CHAR_EFFECTS:
156 0 : aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
157 0 : rPage.PageCreated(aSet);
158 0 : break;
159 :
160 : case RID_SVXPAGE_STD_PARAGRAPH:
161 0 : break;
162 :
163 : case RID_SVXPAGE_TEXTATTR:
164 : {
165 0 : aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView));
166 0 : rPage.PageCreated(aSet);
167 : }
168 0 : break;
169 :
170 : case RID_SVXPAGE_TEXTANIMATION:
171 0 : break;
172 :
173 : case RID_SVXPAGE_MEASURE:
174 0 : aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
175 0 : rPage.PageCreated(aSet);
176 0 : break;
177 :
178 : case RID_SVXPAGE_CONNECTION:
179 : {
180 0 : aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
181 0 : rPage.PageCreated(aSet);
182 : }
183 0 : break;
184 0 : }
185 0 : }
186 :
187 : // -----------------------------------------------------------------------
188 :
189 0 : const SfxItemSet* SdTabTemplateDlg::GetRefreshedSet()
190 : {
191 0 : SfxItemSet* pRet = GetInputSetImpl();
192 :
193 0 : if( pRet )
194 : {
195 0 : pRet->ClearItem();
196 0 : pRet->SetParent( GetStyleSheet().GetItemSet().GetParent() );
197 : }
198 : else
199 0 : pRet = new SfxItemSet( GetStyleSheet().GetItemSet() );
200 :
201 0 : return pRet;
202 0 : }
203 :
204 :
205 :
206 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|