1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _CUI_TAB_LINE_HXX
21 #define _CUI_TAB_LINE_HXX
24 #include <svx/tabline.hxx>
26 class SvxLineTabDialog
: public SfxTabDialog
30 const SdrObject
* pObj
;
32 const SfxItemSet
& rOutAttrs
;
34 XColorListRef pColorList
;
35 XColorListRef mpNewColorList
;
36 XDashListRef pDashList
;
37 XDashListRef pNewDashList
;
38 XLineEndListRef pLineEndList
;
39 XLineEndListRef pNewLineEndList
;
40 sal_Bool bObjSelected
;
42 ChangeType nLineEndListState
;
43 ChangeType nDashListState
;
44 ChangeType mnColorListState
;
48 sal_uInt16 nPosDashLb
;
49 sal_uInt16 nPosLineEndLb
;
52 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
);
56 #ifdef _SVX_TABLINE_CXX
57 DECL_LINK( CancelHdlImpl
, void * );
62 SvxLineTabDialog( Window
* pParent
, const SfxItemSet
* pAttr
,
63 SdrModel
* pModel
, const SdrObject
* pObj
= NULL
,
64 sal_Bool bHasObj
= sal_True
);
67 void SetNewDashList( XDashListRef pInLst
)
68 { pNewDashList
= pInLst
; }
69 XDashListRef
GetNewDashList() const { return pNewDashList
; }
70 XDashListRef
GetDashList() const { return pDashList
; }
72 void SetNewLineEndList( XLineEndListRef pInLst
)
73 { pNewLineEndList
= pInLst
; }
74 XLineEndListRef
GetNewLineEndList() const { return pNewLineEndList
; }
75 XLineEndListRef
GetLineEndList() const { return pLineEndList
; }
77 void SetNewColorList( XColorListRef pColTab
) { mpNewColorList
= pColTab
; }
78 XColorListRef
GetNewColorList() const { return mpNewColorList
; }
79 XColorListRef
GetColorList() const { return pColorList
; }
82 /*************************************************************************/
84 struct SvxBmpItemInfo
;
85 typedef ::std::vector
< SvxBmpItemInfo
* > SvxBmpItemInfoList
;
87 class SvxLineTabPage
: public SvxTabPage
89 using TabPage::ActivatePage
;
90 using TabPage::DeactivatePage
;
93 FixedText aFtLineStyle
;
97 FixedText aFtLineWidth
;
98 MetricField aMtrLineWidth
;
99 FixedText aFtTransparent
;
100 MetricField aMtrTransparent
;
101 FixedLine aFlLineEnds
;
102 LineEndLB aLbStartStyle
;
103 MetricField aMtrStartWidth
;
104 TriStateBox aTsbCenterStart
;
105 FixedText aFtLineEndsStyle
;
106 LineEndLB aLbEndStyle
;
107 FixedText aFtLineEndsWidth
;
108 MetricField aMtrEndWidth
;
109 TriStateBox aTsbCenterEnd
;
110 CheckBox aCbxSynchronize
;
111 FixedLine aFLSeparator
;
112 SvxXLinePreview aCtlPreview
;
115 FixedLine maFLEdgeStyle
;
116 FixedText maFTEdgeStyle
;
117 LineEndLB maLBEdgeStyle
;
120 FixedText maFTCapStyle
;
121 LineEndLB maLBCapStyle
;
123 //#58425# symbols on a line (e. g. StarChart) ->
124 /** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview.
125 The list position is to be used cyclic. */
126 SdrObjList
* pSymbolList
;
128 /// a graphic to be displayed in the preview in case that an automatic symbol is choosen
129 Graphic aAutoSymbolGraphic
;
130 long nNumMenuGalleryItems
;
132 /// attributes for the shown symbols; only necessary if not equal to line properties
133 SfxItemSet
* pSymbolAttr
;
135 MenuButton aSymbolMB
;
136 FixedText aSymbolWidthFT
;
137 MetricField aSymbolWidthMF
;
138 FixedText aSymbolHeightFT
;
139 MetricField aSymbolHeightMF
;
140 CheckBox aSymbolRatioCB
;
141 std::vector
<rtl::OUString
> aGrfNames
;
142 SvxBmpItemInfoList aGrfBrushItems
;
143 sal_Bool bLastWidthModified
;
144 Size aSymbolLastSize
;
145 Graphic aSymbolGraphic
;
149 const SfxItemSet
& rOutAttrs
;
151 sal_Bool bObjSelected
;
153 XOutdevItemPool
* pXPool
;
154 XLineStyleItem aXLStyle
;
155 XLineWidthItem aXWidth
;
156 XLineDashItem aXDash
;
157 XLineColorItem aXColor
;
158 XLineAttrSetItem aXLineAttr
;
161 XColorListRef pColorList
;
162 XDashListRef pDashList
;
163 XLineEndListRef pLineEndList
;
165 ChangeType
* pnLineEndListState
;
166 ChangeType
* pnDashListState
;
167 ChangeType
* pnColorListState
;
168 sal_uInt16 nPageType
;
170 sal_uInt16
* pPosDashLb
;
171 sal_uInt16
* pPosLineEndLb
;
173 SfxMapUnit ePoolUnit
;
176 sal_Int32 nActLineWidth
;
178 // handler for gallery popup menu button + size
179 DECL_LINK( GraphicHdl_Impl
, MenuButton
* );
180 DECL_LINK( MenuCreateHdl_Impl
, MenuButton
* );
181 DECL_STATIC_LINK( SvxLineTabPage
, GraphicArrivedHdl_Impl
, SvxBrushItem
* );
182 DECL_LINK( SizeHdl_Impl
, MetricField
* );
183 DECL_LINK( RatioHdl_Impl
, CheckBox
* );
185 #ifdef _SVX_TPLINE_CXX
186 DECL_LINK( ClickInvisibleHdl_Impl
, void * );
187 DECL_LINK( ChangeStartHdl_Impl
, void * );
188 DECL_LINK( ChangeEndHdl_Impl
, void * );
189 DECL_LINK( ChangePreviewHdl_Impl
, void * );
190 DECL_LINK( ChangeTransparentHdl_Impl
, void * );
193 DECL_LINK( ChangeEdgeStyleHdl_Impl
, void * );
196 DECL_LINK ( ChangeCapStyleHdl_Impl
, void * );
198 sal_Bool
FillXLSet_Impl();
201 void InitSymbols(MenuButton
* pButton
);
202 void SymbolSelected(MenuButton
* pButton
);
203 void FillListboxes();
206 void ShowSymbolControls(sal_Bool bOn
);
208 SvxLineTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
209 virtual ~SvxLineTabPage();
213 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
214 static sal_uInt16
* GetRanges();
216 virtual sal_Bool
FillItemSet( SfxItemSet
& );
217 virtual void Reset( const SfxItemSet
& );
219 virtual void ActivatePage( const SfxItemSet
& rSet
);
220 virtual int DeactivatePage( SfxItemSet
* pSet
);
222 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
224 virtual void FillUserData();
226 void SetColorList( XColorListRef pColTab
) { pColorList
= pColTab
; }
227 void SetDashList( XDashListRef pDshLst
) { pDashList
= pDshLst
; }
228 void SetLineEndList( XLineEndListRef pLneEndLst
) { pLineEndList
= pLneEndLst
; }
229 void SetObjSelected( sal_Bool bHasObj
) { bObjSelected
= bHasObj
; }
231 void SetPageType( sal_uInt16 nInType
) { nPageType
= nInType
; }
232 void SetDlgType( sal_uInt16 nInType
) { nDlgType
= nInType
; }
233 void SetPosDashLb( sal_uInt16
* pInPos
) { pPosDashLb
= pInPos
; }
234 void SetPosLineEndLb( sal_uInt16
* pInPos
) { pPosLineEndLb
= pInPos
; }
236 void SetLineEndChgd( ChangeType
* pIn
) { pnLineEndListState
= pIn
; }
237 void SetDashChgd( ChangeType
* pIn
) { pnDashListState
= pIn
; }
238 void SetColorChgd( ChangeType
* pIn
) { pnColorListState
= pIn
; }
240 virtual void PageCreated (SfxAllItemSet aSet
);
241 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
244 /*************************************************************************/
246 class SvxLineDefTabPage
: public SfxTabPage
248 using TabPage::ActivatePage
;
249 using TabPage::DeactivatePage
;
251 FixedLine aFlDefinition
;
252 FixedText aFTLinestyle
;
253 LineLB aLbLineStyles
;
258 NumericField aNumFldNumber1
;
259 NumericField aNumFldNumber2
;
261 MetricField aMtrLength1
;
262 MetricField aMtrLength2
;
263 FixedText aFtDistance
;
264 MetricField aMtrDistance
;
265 CheckBox aCbxSynchronize
;
267 PushButton aBtnModify
;
268 PushButton aBtnDelete
;
269 ImageButton aBtnLoad
;
270 ImageButton aBtnSave
;
271 SvxXLinePreview aCtlPreview
;
273 const SfxItemSet
& rOutAttrs
;
275 sal_Bool bObjSelected
;
277 XOutdevItemPool
* pXPool
;
278 XLineStyleItem aXLStyle
;
279 XLineWidthItem aXWidth
;
280 XLineDashItem aXDash
;
281 XLineColorItem aXColor
;
282 XLineAttrSetItem aXLineAttr
;
285 XDashListRef pDashList
;
287 ChangeType
* pnDashListState
;
288 sal_uInt16
* pPageType
;
289 sal_uInt16
* pDlgType
;
290 sal_uInt16
* pPosDashLb
;
292 SfxMapUnit ePoolUnit
;
295 #ifdef _SVX_TPLNEDEF_CXX
296 void FillDash_Impl();
297 void FillDialog_Impl();
299 DECL_LINK( ClickAddHdl_Impl
, void * );
300 DECL_LINK( ClickModifyHdl_Impl
, void * );
301 DECL_LINK( ClickDeleteHdl_Impl
, void * );
302 DECL_LINK( SelectLinestyleHdl_Impl
, void * );
303 DECL_LINK( ChangePreviewHdl_Impl
, void * );
304 DECL_LINK( ChangeNumber1Hdl_Impl
, void * );
305 DECL_LINK( ChangeNumber2Hdl_Impl
, void * );
306 DECL_LINK( ClickLoadHdl_Impl
, void * );
307 DECL_LINK( ClickSaveHdl_Impl
, void * );
308 DECL_LINK( ChangeMetricHdl_Impl
, void * );
309 DECL_LINK( SelectTypeHdl_Impl
, void * );
311 void CheckChanges_Impl();
315 SvxLineDefTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
319 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
320 virtual sal_Bool
FillItemSet( SfxItemSet
& );
321 virtual void Reset( const SfxItemSet
& );
323 virtual void ActivatePage( const SfxItemSet
& rSet
);
324 virtual int DeactivatePage( SfxItemSet
* pSet
);
326 void SetDashList( XDashListRef pDshLst
) { pDashList
= pDshLst
; }
327 void SetObjSelected( sal_Bool bHasObj
) { bObjSelected
= bHasObj
; }
329 void SetPageType( sal_uInt16
* pInType
) { pPageType
= pInType
; }
330 void SetDlgType( sal_uInt16
* pInType
) { pDlgType
= pInType
; }
331 void SetPosDashLb( sal_uInt16
* pInPos
) { pPosDashLb
= pInPos
; }
333 void SetDashChgd( ChangeType
* pIn
) { pnDashListState
= pIn
; }
335 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
338 /*************************************************************************/
340 class SvxLineEndDefTabPage
: public SfxTabPage
342 using TabPage::ActivatePage
;
343 using TabPage::DeactivatePage
;
349 FixedText aFTLineEndStyle
;
350 LineEndLB aLbLineEnds
;
352 PushButton aBtnModify
;
353 PushButton aBtnDelete
;
354 ImageButton aBtnLoad
;
355 ImageButton aBtnSave
;
357 SvxXLinePreview aCtlPreview
;
359 const SfxItemSet
& rOutAttrs
;
360 const SdrObject
* pPolyObj
;
361 sal_Bool bObjSelected
;
363 XOutdevItemPool
* pXPool
;
364 XLineStyleItem aXLStyle
;
365 XLineWidthItem aXWidth
;
366 XLineColorItem aXColor
;
367 XLineAttrSetItem aXLineAttr
;
370 XLineEndListRef pLineEndList
;
372 ChangeType
* pnLineEndListState
;
373 sal_uInt16
* pPageType
;
374 sal_uInt16
* pDlgType
;
375 sal_uInt16
* pPosLineEndLb
;
377 #ifdef _SVX_TPLNEEND_CXX
378 DECL_LINK( ClickAddHdl_Impl
, void * );
379 DECL_LINK( ClickModifyHdl_Impl
, void * );
380 DECL_LINK( ClickDeleteHdl_Impl
, void * );
381 DECL_LINK( ClickLoadHdl_Impl
, void * );
382 DECL_LINK( ClickSaveHdl_Impl
, void * );
383 DECL_LINK( SelectLineEndHdl_Impl
, void * );
384 long ChangePreviewHdl_Impl( void* p
);
386 void CheckChanges_Impl();
390 SvxLineEndDefTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
391 ~SvxLineEndDefTabPage();
395 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
396 virtual sal_Bool
FillItemSet( SfxItemSet
& );
397 virtual void Reset( const SfxItemSet
& );
399 virtual void ActivatePage( const SfxItemSet
& rSet
);
400 virtual int DeactivatePage( SfxItemSet
* pSet
);
402 void SetLineEndList( XLineEndListRef pInList
) { pLineEndList
= pInList
; }
403 void SetPolyObj( const SdrObject
* pObj
) { pPolyObj
= pObj
; }
404 void SetObjSelected( sal_Bool bHasObj
) { bObjSelected
= bHasObj
; }
406 void SetPageType( sal_uInt16
* pInType
) { pPageType
= pInType
; }
407 void SetDlgType( sal_uInt16
* pInType
) { pDlgType
= pInType
; }
408 void SetPosLineEndLb( sal_uInt16
* pInPos
) { pPosLineEndLb
= pInPos
; }
410 void SetLineEndChgd( ChangeType
* pIn
) { pnLineEndListState
= pIn
; }
412 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
415 #endif // _CUI_TAB_LINE_HXX
417 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */