Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #ifdef SD_DLLIMPLEMENTATION
31 : : #undef SD_DLLIMPLEMENTATION
32 : : #endif
33 : :
34 : : #include <editeng/flstitem.hxx>
35 : :
36 : : #include <svx/svxids.hrc>
37 : :
38 : : #include <svx/drawitem.hxx>
39 : : #include <svl/intitem.hxx>
40 : : #include <svx/ofaitem.hxx>
41 : : #include <svx/svxgrahicitem.hxx>
42 : : #include <svx/svdmodel.hxx>
43 : : #include <svl/cjkoptions.hxx>
44 : :
45 : :
46 : : #include <svx/dialogs.hrc>
47 : :
48 : : #include <svx/svxdlg.hxx>
49 : : #include <svx/tabline.hxx>
50 : : #include <svl/style.hxx>
51 : : #include <svx/xtable.hxx>
52 : :
53 : : #include "DrawDocShell.hxx"
54 : : #include "tabtempl.hxx"
55 : : #include "tabtempl.hrc"
56 : : #include "sdresid.hxx"
57 : : #include "dlg_char.hxx"
58 : : #include "paragr.hxx"
59 : : #include <svx/flagsdef.hxx>
60 : :
61 : : /*************************************************************************
62 : : |*
63 : : |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
64 : : |*
65 : : \************************************************************************/
66 : :
67 : 0 : SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent,
68 : : const SfxObjectShell* pDocShell,
69 : : SfxStyleSheetBase& rStyleBase,
70 : : SdrModel* pModel,
71 : : SdrView* pView ) :
72 : : SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ),
73 : : rDocShell ( *pDocShell ),
74 : : pSdrView ( pView ),
75 : : pColorList ( pModel->GetColorList() ),
76 : : pGradientList ( pModel->GetGradientList() ),
77 : : pHatchingList ( pModel->GetHatchList() ),
78 : : pBitmapList ( pModel->GetBitmapList() ),
79 : : pDashList ( pModel->GetDashList() ),
80 : 0 : pLineEndList ( pModel->GetLineEndList() )
81 : : {
82 : 0 : FreeResource();
83 : :
84 : : // Listbox fuellen und Select-Handler ueberladen
85 : :
86 : 0 : AddTabPage( RID_SVXPAGE_LINE);
87 : 0 : AddTabPage( RID_SVXPAGE_AREA);
88 : 0 : AddTabPage( RID_SVXPAGE_SHADOW);
89 : 0 : AddTabPage( RID_SVXPAGE_TRANSPARENCE);
90 : 0 : AddTabPage( RID_SVXPAGE_CHAR_NAME );
91 : 0 : AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
92 : 0 : AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
93 : 0 : AddTabPage( RID_SVXPAGE_TEXTATTR );
94 : 0 : AddTabPage( RID_SVXPAGE_TEXTANIMATION );
95 : 0 : AddTabPage( RID_SVXPAGE_MEASURE);
96 : 0 : AddTabPage( RID_SVXPAGE_CONNECTION);
97 : 0 : AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
98 : 0 : AddTabPage( RID_SVXPAGE_TABULATOR );
99 : 0 : SvtCJKOptions aCJKOptions;
100 : 0 : if( aCJKOptions.IsAsianTypographyEnabled() )
101 : 0 : AddTabPage( RID_SVXPAGE_PARA_ASIAN );
102 : : else
103 : 0 : RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
104 : :
105 : 0 : nDlgType = 1;
106 : 0 : nPageType = 0;
107 : 0 : nPos = 0;
108 : :
109 : 0 : nColorTableState = CT_NONE;
110 : 0 : nBitmapListState = CT_NONE;
111 : 0 : nGradientListState = CT_NONE;
112 : 0 : nHatchingListState = CT_NONE;
113 : 0 : }
114 : :
115 : : // -----------------------------------------------------------------------
116 : :
117 : 0 : SdTabTemplateDlg::~SdTabTemplateDlg()
118 : : {
119 : 0 : }
120 : :
121 : : // -----------------------------------------------------------------------
122 : :
123 : 0 : void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
124 : : {
125 : 0 : SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
126 : 0 : switch( nId )
127 : : {
128 : : case RID_SVXPAGE_LINE:
129 : 0 : aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
130 : 0 : aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
131 : 0 : aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
132 : 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
133 : 0 : rPage.PageCreated(aSet);
134 : 0 : break;
135 : :
136 : : case RID_SVXPAGE_AREA:
137 : 0 : aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
138 : 0 : aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
139 : 0 : aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
140 : 0 : aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
141 : 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
142 : 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
143 : 0 : aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos));
144 : 0 : rPage.PageCreated(aSet);
145 : :
146 : :
147 : 0 : break;
148 : :
149 : : case RID_SVXPAGE_SHADOW:
150 : 0 : aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
151 : 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
152 : 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
153 : 0 : rPage.PageCreated(aSet);
154 : 0 : break;
155 : :
156 : : case RID_SVXPAGE_TRANSPARENCE:
157 : 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
158 : 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
159 : 0 : rPage.PageCreated(aSet);
160 : 0 : break;
161 : :
162 : : case RID_SVXPAGE_CHAR_NAME:
163 : : {
164 : : SvxFontListItem aItem(*( (const SvxFontListItem*)
165 : 0 : ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
166 : :
167 : 0 : aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
168 : 0 : rPage.PageCreated(aSet);
169 : : }
170 : 0 : break;
171 : :
172 : : case RID_SVXPAGE_CHAR_EFFECTS:
173 : 0 : aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
174 : 0 : rPage.PageCreated(aSet);
175 : 0 : break;
176 : :
177 : : case RID_SVXPAGE_STD_PARAGRAPH:
178 : 0 : break;
179 : :
180 : : case RID_SVXPAGE_TEXTATTR:
181 : : {
182 : 0 : aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView));
183 : 0 : rPage.PageCreated(aSet);
184 : : }
185 : 0 : break;
186 : :
187 : : case RID_SVXPAGE_TEXTANIMATION:
188 : 0 : break;
189 : :
190 : : case RID_SVXPAGE_MEASURE:
191 : 0 : aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
192 : 0 : rPage.PageCreated(aSet);
193 : 0 : break;
194 : :
195 : : case RID_SVXPAGE_CONNECTION:
196 : : {
197 : 0 : aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
198 : 0 : rPage.PageCreated(aSet);
199 : : }
200 : 0 : break;
201 : 0 : }
202 : 0 : }
203 : :
204 : : // -----------------------------------------------------------------------
205 : :
206 : 0 : const SfxItemSet* SdTabTemplateDlg::GetRefreshedSet()
207 : : {
208 : 0 : SfxItemSet* pRet = GetInputSetImpl();
209 : :
210 : 0 : if( pRet )
211 : : {
212 : 0 : pRet->ClearItem();
213 : 0 : pRet->SetParent( GetStyleSheet().GetItemSet().GetParent() );
214 : : }
215 : : else
216 : 0 : pRet = new SfxItemSet( GetStyleSheet().GetItemSet() );
217 : :
218 : 0 : return pRet;
219 : : }
220 : :
221 : :
222 : :
223 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|