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 : : #ifndef _CUI_TAB_LINE_HXX
29 : : #define _CUI_TAB_LINE_HXX
30 : :
31 : : #include <vector>
32 : : #include <svx/tabline.hxx>
33 : :
34 : : class SvxLineTabDialog : public SfxTabDialog
35 : : {
36 : : private:
37 : : SdrModel* pDrawModel;
38 : : const SdrObject* pObj;
39 : :
40 : : const SfxItemSet& rOutAttrs;
41 : :
42 : : XColorListRef pColorList;
43 : : XColorListRef mpNewColorList;
44 : : XDashListRef pDashList;
45 : : XDashListRef pNewDashList;
46 : : XLineEndListRef pLineEndList;
47 : : XLineEndListRef pNewLineEndList;
48 : : sal_Bool bObjSelected;
49 : :
50 : : ChangeType nLineEndListState;
51 : : ChangeType nDashListState;
52 : : ChangeType mnColorListState;
53 : :
54 : : sal_uInt16 nPageType;
55 : : sal_uInt16 nDlgType;
56 : : sal_uInt16 nPosDashLb;
57 : : sal_uInt16 nPosLineEndLb;
58 : : sal_uInt16 mnPos;
59 : : sal_Bool mbAreaTP;
60 : :
61 : : virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
62 : :
63 : : protected:
64 : : virtual short Ok();
65 : : #ifdef _SVX_TABLINE_CXX
66 : : DECL_LINK( CancelHdlImpl, void * );
67 : : void SavePalettes();
68 : : #endif
69 : :
70 : : public:
71 : : SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr,
72 : : SdrModel* pModel, const SdrObject* pObj = NULL,
73 : : sal_Bool bHasObj = sal_True );
74 : : ~SvxLineTabDialog();
75 : :
76 : 0 : void SetNewDashList( XDashListRef pInLst)
77 : 0 : { pNewDashList = pInLst; }
78 : 0 : XDashListRef GetNewDashList() const { return pNewDashList; }
79 : : XDashListRef GetDashList() const { return pDashList; }
80 : :
81 : 0 : void SetNewLineEndList( XLineEndListRef pInLst)
82 : 0 : { pNewLineEndList = pInLst; }
83 : 0 : XLineEndListRef GetNewLineEndList() const { return pNewLineEndList; }
84 : : XLineEndListRef GetLineEndList() const { return pLineEndList; }
85 : :
86 : 0 : void SetNewColorList( XColorListRef pColTab ) { mpNewColorList = pColTab; }
87 : 0 : XColorListRef GetNewColorList() const { return mpNewColorList; }
88 : 0 : XColorListRef GetColorList() const { return pColorList; }
89 : : };
90 : :
91 : : /*************************************************************************/
92 : :
93 : : struct SvxBmpItemInfo;
94 : : typedef ::std::vector< SvxBmpItemInfo* > SvxBmpItemInfoList;
95 : :
96 : : class SvxLineTabPage : public SvxTabPage
97 : : {
98 : : using TabPage::ActivatePage;
99 : : using TabPage::DeactivatePage;
100 : : private:
101 : : FixedLine aFlLine;
102 : : FixedText aFtLineStyle;
103 : : LineLB aLbLineStyle;
104 : : FixedText aFtColor;
105 : : ColorLB aLbColor;
106 : : FixedText aFtLineWidth;
107 : : MetricField aMtrLineWidth;
108 : : FixedText aFtTransparent;
109 : : MetricField aMtrTransparent;
110 : : FixedLine aFlLineEnds;
111 : : LineEndLB aLbStartStyle;
112 : : MetricField aMtrStartWidth;
113 : : TriStateBox aTsbCenterStart;
114 : : FixedText aFtLineEndsStyle;
115 : : LineEndLB aLbEndStyle;
116 : : FixedText aFtLineEndsWidth;
117 : : MetricField aMtrEndWidth;
118 : : TriStateBox aTsbCenterEnd;
119 : : CheckBox aCbxSynchronize;
120 : : FixedLine aFLSeparator;
121 : : SvxXLinePreview aCtlPreview;
122 : :
123 : : // #116827#
124 : : FixedLine maFLEdgeStyle;
125 : : FixedText maFTEdgeStyle;
126 : : LineEndLB maLBEdgeStyle;
127 : :
128 : : //#58425# symbols on a line (e. g. StarChart) ->
129 : : /** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview.
130 : : The list position is to be used cyclic. */
131 : : SdrObjList* pSymbolList;
132 : : bool bNewSize;
133 : : /// a graphic to be displayed in the preview in case that an automatic symbol is choosen
134 : : Graphic aAutoSymbolGraphic;
135 : : long nNumMenuGalleryItems;
136 : : long nSymbolType;
137 : : /// attributes for the shown symbols; only necessary if not equal to line properties
138 : : SfxItemSet* pSymbolAttr;
139 : : FixedLine aFlSymbol;
140 : : MenuButton aSymbolMB;
141 : : FixedText aSymbolWidthFT;
142 : : MetricField aSymbolWidthMF;
143 : : FixedText aSymbolHeightFT;
144 : : MetricField aSymbolHeightMF;
145 : : CheckBox aSymbolRatioCB;
146 : : std::vector<rtl::OUString> aGrfNames;
147 : : SvxBmpItemInfoList aGrfBrushItems;
148 : : sal_Bool bLastWidthModified;
149 : : Size aSymbolLastSize;
150 : : Graphic aSymbolGraphic;
151 : : Size aSymbolSize;
152 : : sal_Bool bSymbols;
153 : :
154 : : const SfxItemSet& rOutAttrs;
155 : : RECT_POINT eRP;
156 : : sal_Bool bObjSelected;
157 : :
158 : : XOutdevItemPool* pXPool;
159 : : XLineStyleItem aXLStyle;
160 : : XLineWidthItem aXWidth;
161 : : XLineDashItem aXDash;
162 : : XLineColorItem aXColor;
163 : : XLineAttrSetItem aXLineAttr;
164 : : SfxItemSet& rXLSet;
165 : :
166 : : XColorListRef pColorList;
167 : : XDashListRef pDashList;
168 : : XLineEndListRef pLineEndList;
169 : :
170 : : ChangeType* pnLineEndListState;
171 : : ChangeType* pnDashListState;
172 : : ChangeType* pnColorListState;
173 : : sal_uInt16 nPageType;
174 : : sal_uInt16 nDlgType;
175 : : sal_uInt16* pPosDashLb;
176 : : sal_uInt16* pPosLineEndLb;
177 : :
178 : : SfxMapUnit ePoolUnit;
179 : :
180 : : // #63083#
181 : : sal_Int32 nActLineWidth;
182 : :
183 : : // handler for gallery popup menu button + size
184 : : DECL_LINK( GraphicHdl_Impl, MenuButton * );
185 : : DECL_LINK( MenuCreateHdl_Impl, MenuButton * );
186 : : DECL_STATIC_LINK( SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
187 : : DECL_LINK( SizeHdl_Impl, MetricField * );
188 : : DECL_LINK( RatioHdl_Impl, CheckBox * );
189 : :
190 : : #ifdef _SVX_TPLINE_CXX
191 : : DECL_LINK( ClickInvisibleHdl_Impl, void * );
192 : : DECL_LINK( ChangeStartHdl_Impl, void * );
193 : : DECL_LINK( ChangeEndHdl_Impl, void * );
194 : : DECL_LINK( ChangePreviewHdl_Impl, void * );
195 : : DECL_LINK( ChangeTransparentHdl_Impl, void * );
196 : :
197 : : // #116827#
198 : : DECL_LINK( ChangeEdgeStyleHdl_Impl, void * );
199 : :
200 : : sal_Bool FillXLSet_Impl();
201 : : #endif
202 : :
203 : : void InitSymbols(MenuButton* pButton);
204 : : void SymbolSelected(MenuButton* pButton);
205 : : void FillListboxes();
206 : : public:
207 : :
208 : : void ShowSymbolControls(sal_Bool bOn);
209 : :
210 : : SvxLineTabPage( Window* pParent, const SfxItemSet& rInAttrs );
211 : : virtual ~SvxLineTabPage();
212 : :
213 : : void Construct();
214 : :
215 : : static SfxTabPage* Create( Window*, const SfxItemSet& );
216 : : static sal_uInt16* GetRanges();
217 : :
218 : : virtual sal_Bool FillItemSet( SfxItemSet& );
219 : : virtual void Reset( const SfxItemSet& );
220 : :
221 : : virtual void ActivatePage( const SfxItemSet& rSet );
222 : : virtual int DeactivatePage( SfxItemSet* pSet );
223 : :
224 : : virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
225 : :
226 : : virtual void FillUserData();
227 : :
228 : 0 : void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
229 : 0 : void SetDashList( XDashListRef pDshLst ) { pDashList = pDshLst; }
230 : 0 : void SetLineEndList( XLineEndListRef pLneEndLst) { pLineEndList = pLneEndLst; }
231 : 0 : void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
232 : :
233 : 0 : void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
234 : 0 : void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
235 : 0 : void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
236 : 0 : void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
237 : :
238 : 0 : void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
239 : 0 : void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
240 : 0 : void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
241 : :
242 : : virtual void PageCreated (SfxAllItemSet aSet);
243 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
244 : : };
245 : :
246 : : /*************************************************************************/
247 : :
248 [ # # ][ # # ]: 0 : class SvxLineDefTabPage : public SfxTabPage
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
249 : : {
250 : : using TabPage::ActivatePage;
251 : : using TabPage::DeactivatePage;
252 : : private:
253 : : FixedLine aFlDefinition;
254 : : FixedText aFTLinestyle;
255 : : LineLB aLbLineStyles;
256 : : FixedText aFtType;
257 : : ListBox aLbType1;
258 : : ListBox aLbType2;
259 : : FixedText aFtNumber;
260 : : NumericField aNumFldNumber1;
261 : : NumericField aNumFldNumber2;
262 : : FixedText aFtLength;
263 : : MetricField aMtrLength1;
264 : : MetricField aMtrLength2;
265 : : FixedText aFtDistance;
266 : : MetricField aMtrDistance;
267 : : CheckBox aCbxSynchronize;
268 : : PushButton aBtnAdd;
269 : : PushButton aBtnModify;
270 : : PushButton aBtnDelete;
271 : : ImageButton aBtnLoad;
272 : : ImageButton aBtnSave;
273 : : SvxXLinePreview aCtlPreview;
274 : :
275 : : const SfxItemSet& rOutAttrs;
276 : : XDash aDash;
277 : : sal_Bool bObjSelected;
278 : :
279 : : XOutdevItemPool* pXPool;
280 : : XLineStyleItem aXLStyle;
281 : : XLineWidthItem aXWidth;
282 : : XLineDashItem aXDash;
283 : : XLineColorItem aXColor;
284 : : XLineAttrSetItem aXLineAttr;
285 : : SfxItemSet& rXLSet;
286 : :
287 : : XDashListRef pDashList;
288 : :
289 : : ChangeType* pnDashListState;
290 : : sal_uInt16* pPageType;
291 : : sal_uInt16* pDlgType;
292 : : sal_uInt16* pPosDashLb;
293 : :
294 : : SfxMapUnit ePoolUnit;
295 : : FieldUnit eFUnit;
296 : :
297 : : #ifdef _SVX_TPLNEDEF_CXX
298 : : void FillDash_Impl();
299 : : void FillDialog_Impl();
300 : :
301 : : DECL_LINK( ClickAddHdl_Impl, void * );
302 : : DECL_LINK( ClickModifyHdl_Impl, void * );
303 : : DECL_LINK( ClickDeleteHdl_Impl, void * );
304 : : DECL_LINK( SelectLinestyleHdl_Impl, void * );
305 : : DECL_LINK( ChangePreviewHdl_Impl, void * );
306 : : DECL_LINK( ChangeNumber1Hdl_Impl, void * );
307 : : DECL_LINK( ChangeNumber2Hdl_Impl, void * );
308 : : DECL_LINK( ClickLoadHdl_Impl, void * );
309 : : DECL_LINK( ClickSaveHdl_Impl, void * );
310 : : DECL_LINK( ChangeMetricHdl_Impl, void * );
311 : : DECL_LINK( SelectTypeHdl_Impl, void * );
312 : :
313 : : void CheckChanges_Impl();
314 : : #endif
315 : :
316 : : public:
317 : : SvxLineDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
318 : :
319 : : void Construct();
320 : :
321 : : static SfxTabPage* Create( Window*, const SfxItemSet& );
322 : : virtual sal_Bool FillItemSet( SfxItemSet& );
323 : : virtual void Reset( const SfxItemSet & );
324 : :
325 : : virtual void ActivatePage( const SfxItemSet& rSet );
326 : : virtual int DeactivatePage( SfxItemSet* pSet );
327 : :
328 : 0 : void SetDashList( XDashListRef pDshLst ) { pDashList = pDshLst; }
329 : 0 : void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
330 : :
331 : 0 : void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
332 : 0 : void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
333 : 0 : void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
334 : :
335 : 0 : void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
336 : :
337 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
338 : : };
339 : :
340 : : /*************************************************************************/
341 : :
342 : : class SvxLineEndDefTabPage : public SfxTabPage
343 : : {
344 : : using TabPage::ActivatePage;
345 : : using TabPage::DeactivatePage;
346 : :
347 : : private:
348 : : FixedLine aFlTip;
349 : : FixedText aFTTitle;
350 : : Edit aEdtName;
351 : : FixedText aFTLineEndStyle;
352 : : LineEndLB aLbLineEnds;
353 : : PushButton aBtnAdd;
354 : : PushButton aBtnModify;
355 : : PushButton aBtnDelete;
356 : : ImageButton aBtnLoad;
357 : : ImageButton aBtnSave;
358 : : FixedInfo aFiTip;
359 : : SvxXLinePreview aCtlPreview;
360 : :
361 : : const SfxItemSet& rOutAttrs;
362 : : const SdrObject* pPolyObj;
363 : : sal_Bool bObjSelected;
364 : :
365 : : XOutdevItemPool* pXPool;
366 : : XLineStyleItem aXLStyle;
367 : : XLineWidthItem aXWidth;
368 : : XLineColorItem aXColor;
369 : : XLineAttrSetItem aXLineAttr;
370 : : SfxItemSet& rXLSet;
371 : :
372 : : XLineEndListRef pLineEndList;
373 : :
374 : : ChangeType* pnLineEndListState;
375 : : sal_uInt16* pPageType;
376 : : sal_uInt16* pDlgType;
377 : : sal_uInt16* pPosLineEndLb;
378 : :
379 : : #ifdef _SVX_TPLNEEND_CXX
380 : : DECL_LINK( ClickAddHdl_Impl, void * );
381 : : DECL_LINK( ClickModifyHdl_Impl, void * );
382 : : DECL_LINK( ClickDeleteHdl_Impl, void * );
383 : : DECL_LINK( ClickLoadHdl_Impl, void * );
384 : : DECL_LINK( ClickSaveHdl_Impl, void * );
385 : : DECL_LINK( SelectLineEndHdl_Impl, void * );
386 : : long ChangePreviewHdl_Impl( void* p );
387 : :
388 : : void CheckChanges_Impl();
389 : : #endif
390 : :
391 : : public:
392 : : SvxLineEndDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
393 : : ~SvxLineEndDefTabPage();
394 : :
395 : : void Construct();
396 : :
397 : : static SfxTabPage* Create( Window*, const SfxItemSet& );
398 : : virtual sal_Bool FillItemSet( SfxItemSet& );
399 : : virtual void Reset( const SfxItemSet & );
400 : :
401 : : virtual void ActivatePage( const SfxItemSet& rSet );
402 : : virtual int DeactivatePage( SfxItemSet* pSet );
403 : :
404 : 0 : void SetLineEndList( XLineEndListRef pInList ) { pLineEndList = pInList; }
405 : 0 : void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
406 : 0 : void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
407 : :
408 : 0 : void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
409 : 0 : void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
410 : 0 : void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
411 : :
412 : 0 : void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
413 : :
414 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
415 : : };
416 : :
417 : : #endif // _CUI_TAB_LINE_HXX
418 : :
419 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|