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