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