1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cuitabline.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CUI_TAB_LINE_HXX
31 #define _CUI_TAB_LINE_HXX
33 // include ---------------------------------------------------------------
34 #include <svx/tabline.hxx>
35 /*************************************************************************
37 |* Transform-Tab-Dialog
39 \************************************************************************/
41 class SvxLineTabDialog
: public SfxTabDialog
45 const SdrObject
* pObj
;
47 const SfxItemSet
& rOutAttrs
;
49 XColorTable
* pColorTab
;
50 XColorTable
* mpNewColorTab
;
52 XDashList
* pNewDashList
;
53 XLineEndList
* pLineEndList
;
54 XLineEndList
* pNewLineEndList
;
57 ChangeType nLineEndListState
;
58 ChangeType nDashListState
;
59 ChangeType mnColorTableState
;
67 BOOL mbDeleteColorTable
;
69 virtual void PageCreated( USHORT nId
, SfxTabPage
&rPage
);
73 #ifdef _SVX_TABLINE_CXX
74 DECL_LINK( CancelHdlImpl
, void * );
79 SvxLineTabDialog( Window
* pParent
, const SfxItemSet
* pAttr
,
80 SdrModel
* pModel
, const SdrObject
* pObj
= NULL
,
81 BOOL bHasObj
= TRUE
);
84 void SetNewDashList( XDashList
* pInLst
)
85 { pNewDashList
= pInLst
; }
86 XDashList
* GetNewDashList() const { return pNewDashList
; }
87 const XDashList
* GetDashList() const { return pDashList
; }
89 void SetNewLineEndList( XLineEndList
* pInLst
)
90 { pNewLineEndList
= pInLst
; }
91 XLineEndList
* GetNewLineEndList() const { return pNewLineEndList
; }
92 const XLineEndList
* GetLineEndList() const { return pLineEndList
; }
94 void SetNewColorTable( XColorTable
* pColTab
) { mpNewColorTab
= pColTab
; }
95 XColorTable
* GetNewColorTable() const { return mpNewColorTab
; }
96 const XColorTable
* GetColorTable() const { return pColorTab
; }
99 /*************************************************************************
103 \************************************************************************/
105 class SvxLineTabPage
: public SvxTabPage
107 using TabPage::ActivatePage
;
108 using TabPage::DeactivatePage
;
110 FixedText aFtLineStyle
;
114 FixedText aFtLineWidth
;
115 MetricField aMtrLineWidth
;
116 FixedText aFtTransparent
;
117 MetricField aMtrTransparent
;
119 FixedText aFtLineEndsStyle
;
120 LineEndLB aLbStartStyle
;
121 FixedText aFtLineEndsWidth
;
122 MetricField aMtrStartWidth
;
123 TriStateBox aTsbCenterStart
;
124 LineEndLB aLbEndStyle
;
125 MetricField aMtrEndWidth
;
126 TriStateBox aTsbCenterEnd
;
127 CheckBox aCbxSynchronize
;
128 FixedLine aFlLineEnds
;
129 SvxXLinePreview aCtlPreview
;
130 FixedLine aFLSeparator
;
133 FixedLine maFLEdgeStyle
;
134 FixedText maFTEdgeStyle
;
135 LineEndLB maLBEdgeStyle
;
137 //#58425# Symbole auf einer Linie (z.B. StarChart) ->
138 SdrObjList
* pSymbolList
; //a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview. The list position is to be used cyclic.
140 Graphic aAutoSymbolGraphic
; //a graphic to be displayed in the preview in case that an automatic symbol is choosen
141 long nNumMenuGalleryItems
;
143 SfxItemSet
* pSymbolAttr
; //attributes for the shown symbols; only necessary if not equal to line properties
145 MenuButton aSymbolMB
;
146 FixedText aSymbolWidthFT
;
147 MetricField aSymbolWidthMF
;
148 FixedText aSymbolHeightFT
;
149 MetricField aSymbolHeightMF
;
150 CheckBox aSymbolRatioCB
;
153 String sNumCharFmtName
;
154 BOOL bLastWidthModified
;
155 Size aSymbolLastSize
;
156 Graphic aSymbolGraphic
;
160 const SfxItemSet
& rOutAttrs
;
164 XOutdevItemPool
* pXPool
;
165 XLineStyleItem aXLStyle
;
166 XLineWidthItem aXWidth
;
167 XLineDashItem aXDash
;
168 XLineColorItem aXColor
;
169 XLineAttrSetItem aXLineAttr
;
172 XColorTable
* pColorTab
;
173 XDashList
* pDashList
;
174 XLineEndList
* pLineEndList
;
176 ChangeType
* pnLineEndListState
;
177 ChangeType
* pnDashListState
;
178 ChangeType
* pnColorTableState
;
179 UINT16 nPageType
; //add CHINA001
180 UINT16 nDlgType
; //add CHINA001
182 USHORT
* pPosLineEndLb
;
184 SfxMapUnit ePoolUnit
;
189 //Handler für Gallery-Popup-Menue-Button + Size
190 DECL_LINK( GraphicHdl_Impl
, MenuButton
* );
191 DECL_LINK( MenuCreateHdl_Impl
, MenuButton
* );
192 DECL_STATIC_LINK( SvxLineTabPage
, GraphicArrivedHdl_Impl
, SvxBrushItem
* );
193 DECL_LINK( SizeHdl_Impl
, MetricField
* );
194 DECL_LINK( RatioHdl_Impl
, CheckBox
* );
197 #ifdef _SVX_TPLINE_CXX
198 DECL_LINK( ClickInvisibleHdl_Impl
, void * );
199 DECL_LINK( ChangeStartHdl_Impl
, void * );
200 DECL_LINK( ChangeEndHdl_Impl
, void * );
201 DECL_LINK( ChangePreviewHdl_Impl
, void * );
202 DECL_LINK( ChangeTransparentHdl_Impl
, void * );
205 DECL_LINK( ChangeEdgeStyleHdl_Impl
, void * );
207 BOOL
FillXLSet_Impl();
210 void FillListboxes();
213 void ShowSymbolControls(BOOL bOn
);
215 SvxLineTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
216 virtual ~SvxLineTabPage();
221 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
222 static USHORT
* GetRanges();
224 virtual BOOL
FillItemSet( SfxItemSet
& );
225 virtual void Reset( const SfxItemSet
& );
227 virtual void ActivatePage( const SfxItemSet
& rSet
);
228 virtual int DeactivatePage( SfxItemSet
* pSet
);
230 virtual void PointChanged( Window
* pWindow
, RECT_POINT eRP
);
232 virtual void FillUserData();
234 void SetColorTable( XColorTable
* pColTab
) { pColorTab
= pColTab
; }
235 void SetDashList( XDashList
* pDshLst
) { pDashList
= pDshLst
; }
236 void SetLineEndList( XLineEndList
* pLneEndLst
) { pLineEndList
= pLneEndLst
; }
237 void SetObjSelected( BOOL bHasObj
) { bObjSelected
= bHasObj
; }
239 void SetPageType( UINT16 nInType
) { nPageType
= nInType
; }//CHINA001 void SetPageType( USHORT* pInType ) { pPageType = pInType; }
240 void SetDlgType( UINT16 nInType
) { nDlgType
= nInType
; } //CHINA001 void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
241 void SetPosDashLb( USHORT
* pInPos
) { pPosDashLb
= pInPos
; }
242 void SetPosLineEndLb( USHORT
* pInPos
) { pPosLineEndLb
= pInPos
; }
244 void SetLineEndChgd( ChangeType
* pIn
) { pnLineEndListState
= pIn
; }
245 void SetDashChgd( ChangeType
* pIn
) { pnDashListState
= pIn
; }
246 void SetColorChgd( ChangeType
* pIn
) { pnColorTableState
= pIn
; }
248 virtual void PageCreated (SfxAllItemSet aSet
); //add CHINA001
249 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
252 /*************************************************************************
254 |* Linien-Definitions-Tab-Page
256 \************************************************************************/
258 class SvxLineDefTabPage
: public SfxTabPage
260 using TabPage::ActivatePage
;
261 using TabPage::DeactivatePage
;
263 FixedLine aFlDefinition
;
264 FixedText aFTLinestyle
;
265 LineLB aLbLineStyles
;
270 NumericField aNumFldNumber1
;
271 NumericField aNumFldNumber2
;
273 MetricField aMtrLength1
;
274 MetricField aMtrLength2
;
275 FixedText aFtDistance
;
276 MetricField aMtrDistance
;
277 CheckBox aCbxSynchronize
;
279 PushButton aBtnModify
;
280 PushButton aBtnDelete
;
281 ImageButton aBtnLoad
;
282 ImageButton aBtnSave
;
283 SvxXLinePreview aCtlPreview
;
285 const SfxItemSet
& rOutAttrs
;
289 XOutdevItemPool
* pXPool
;
290 XLineStyleItem aXLStyle
;
291 XLineWidthItem aXWidth
;
292 XLineDashItem aXDash
;
293 XLineColorItem aXColor
;
294 XLineAttrSetItem aXLineAttr
;
297 XDashList
* pDashList
;
299 ChangeType
* pnDashListState
;
304 SfxMapUnit ePoolUnit
;
307 #ifdef _SVX_TPLNEDEF_CXX
308 void FillDash_Impl();
309 void FillDialog_Impl();
311 DECL_LINK( ClickAddHdl_Impl
, void * );
312 DECL_LINK( ClickModifyHdl_Impl
, void * );
313 DECL_LINK( ClickDeleteHdl_Impl
, void * );
314 DECL_LINK( SelectLinestyleHdl_Impl
, void * );
315 DECL_LINK( ChangePreviewHdl_Impl
, void * );
316 DECL_LINK( ChangeNumber1Hdl_Impl
, void * );
317 DECL_LINK( ChangeNumber2Hdl_Impl
, void * );
318 DECL_LINK( ClickLoadHdl_Impl
, void * );
319 DECL_LINK( ClickSaveHdl_Impl
, void * );
320 DECL_LINK( ChangeMetricHdl_Impl
, void * );
321 DECL_LINK( SelectTypeHdl_Impl
, void * );
323 void CheckChanges_Impl();
327 SvxLineDefTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
331 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
332 virtual BOOL
FillItemSet( SfxItemSet
& );
333 virtual void Reset( const SfxItemSet
& );
335 virtual void ActivatePage( const SfxItemSet
& rSet
);
336 virtual int DeactivatePage( SfxItemSet
* pSet
);
338 void SetDashList( XDashList
* pDshLst
) { pDashList
= pDshLst
; }
339 void SetObjSelected( BOOL bHasObj
) { bObjSelected
= bHasObj
; }
341 void SetPageType( USHORT
* pInType
) { pPageType
= pInType
; }
342 void SetDlgType( USHORT
* pInType
) { pDlgType
= pInType
; }
343 void SetPosDashLb( USHORT
* pInPos
) { pPosDashLb
= pInPos
; }
345 void SetDashChgd( ChangeType
* pIn
) { pnDashListState
= pIn
; }
347 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
350 /*************************************************************************
352 |* Linienenden-Definitions-Tab-Page
354 \************************************************************************/
356 class SvxLineEndDefTabPage
: public SfxTabPage
358 using TabPage::ActivatePage
;
359 using TabPage::DeactivatePage
;
365 FixedText aFTLineEndStyle
;
366 LineEndLB aLbLineEnds
;
368 PushButton aBtnModify
;
369 PushButton aBtnDelete
;
370 ImageButton aBtnLoad
;
371 ImageButton aBtnSave
;
373 SvxXLinePreview aCtlPreview
;
375 const SfxItemSet
& rOutAttrs
;
376 const SdrObject
* pPolyObj
;
379 XOutdevItemPool
* pXPool
;
380 XLineStyleItem aXLStyle
;
381 XLineWidthItem aXWidth
;
382 XLineColorItem aXColor
;
383 XLineAttrSetItem aXLineAttr
;
386 XLineEndList
* pLineEndList
;
388 ChangeType
* pnLineEndListState
;
391 USHORT
* pPosLineEndLb
;
393 #ifdef _SVX_TPLNEEND_CXX
394 DECL_LINK( ClickAddHdl_Impl
, void * );
395 DECL_LINK( ClickModifyHdl_Impl
, void * );
396 DECL_LINK( ClickDeleteHdl_Impl
, void * );
397 DECL_LINK( ClickLoadHdl_Impl
, void * );
398 DECL_LINK( ClickSaveHdl_Impl
, void * );
399 DECL_LINK( SelectLineEndHdl_Impl
, void * );
400 long ChangePreviewHdl_Impl( void* p
);
402 void CheckChanges_Impl();
406 SvxLineEndDefTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
407 ~SvxLineEndDefTabPage();
411 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
412 virtual BOOL
FillItemSet( SfxItemSet
& );
413 virtual void Reset( const SfxItemSet
& );
415 virtual void ActivatePage( const SfxItemSet
& rSet
);
416 virtual int DeactivatePage( SfxItemSet
* pSet
);
418 void SetLineEndList( XLineEndList
* pInList
) { pLineEndList
= pInList
; }
419 void SetPolyObj( const SdrObject
* pObj
) { pPolyObj
= pObj
; }
420 void SetObjSelected( BOOL bHasObj
) { bObjSelected
= bHasObj
; }
422 void SetPageType( USHORT
* pInType
) { pPageType
= pInType
; }
423 void SetDlgType( USHORT
* pInType
) { pDlgType
= pInType
; }
424 void SetPosLineEndLb( USHORT
* pInPos
) { pPosLineEndLb
= pInPos
; }
426 void SetLineEndChgd( ChangeType
* pIn
) { pnLineEndListState
= pIn
; }
428 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
432 #endif // _CUI_TAB_LINE_HXX