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 INCLUDED_CUI_SOURCE_INC_CUITABLINE_HXX
21 #define INCLUDED_CUI_SOURCE_INC_CUITABLINE_HXX
24 #include <svx/tabline.hxx>
25 #include <svx/tabarea.hxx>
27 class SvxLineTabDialog
: public SfxTabDialog
29 sal_uInt16 m_nLineTabPage
;
30 sal_uInt16 m_nShadowTabPage
;
31 sal_uInt16 m_nStyleTabPage
;
32 sal_uInt16 m_nEndTabPage
;
36 const SdrObject
* pObj
;
38 const SfxItemSet
& rOutAttrs
;
40 XColorListRef pColorList
;
41 XColorListRef mpNewColorList
;
42 XDashListRef pDashList
;
43 XDashListRef pNewDashList
;
44 XLineEndListRef pLineEndList
;
45 XLineEndListRef pNewLineEndList
;
48 ChangeType nLineEndListState
;
49 ChangeType nDashListState
;
50 ChangeType mnColorListState
;
54 sal_Int32 nPosLineEndLb
;
57 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
) SAL_OVERRIDE
;
60 virtual short Ok() SAL_OVERRIDE
;
61 DECL_LINK( CancelHdlImpl
, void * );
65 SvxLineTabDialog( vcl::Window
* pParent
, const SfxItemSet
* pAttr
,
66 SdrModel
* pModel
, const SdrObject
* pObj
= NULL
,
67 bool bHasObj
= true );
69 void SetNewDashList( XDashListRef pInLst
)
70 { pNewDashList
= pInLst
; }
71 XDashListRef
GetNewDashList() const { return pNewDashList
; }
72 XDashListRef
GetDashList() const { return pDashList
; }
74 void SetNewLineEndList( XLineEndListRef pInLst
)
75 { pNewLineEndList
= pInLst
; }
76 XLineEndListRef
GetNewLineEndList() const { return pNewLineEndList
; }
77 XLineEndListRef
GetLineEndList() const { return pLineEndList
; }
79 void SetNewColorList( XColorListRef pColTab
) { mpNewColorList
= pColTab
; }
80 XColorListRef
GetNewColorList() const { return mpNewColorList
; }
81 XColorListRef
GetColorList() const { return pColorList
; }
84 /*************************************************************************/
86 struct SvxBmpItemInfo
;
87 typedef ::std::vector
< SvxBmpItemInfo
* > SvxBmpItemInfoList
;
89 class SvxLineTabPage
: public SvxTabPage
91 using TabPage::ActivatePage
;
92 using TabPage::DeactivatePage
;
93 static const sal_uInt16 pLineRanges
[];
95 VclPtr
<VclBox
> m_pBoxColor
;
96 VclPtr
<LineLB
> m_pLbLineStyle
;
97 VclPtr
<ColorLB
> m_pLbColor
;
98 VclPtr
<VclBox
> m_pBoxWidth
;
99 VclPtr
<MetricField
> m_pMtrLineWidth
;
100 VclPtr
<VclBox
> m_pBoxTransparency
;
101 VclPtr
<MetricField
> m_pMtrTransparent
;
103 VclPtr
<VclFrame
> m_pFlLineEnds
;
104 VclPtr
<VclBox
> m_pBoxArrowStyles
;
105 VclPtr
<LineEndLB
> m_pLbStartStyle
;
106 VclPtr
<VclBox
> m_pBoxStart
;
107 VclPtr
<MetricField
> m_pMtrStartWidth
;
108 VclPtr
<TriStateBox
> m_pTsbCenterStart
;
109 VclPtr
<VclBox
> m_pBoxEnd
;
110 VclPtr
<LineEndLB
> m_pLbEndStyle
;
111 VclPtr
<MetricField
> m_pMtrEndWidth
;
112 VclPtr
<TriStateBox
> m_pTsbCenterEnd
;
113 VclPtr
<CheckBox
> m_pCbxSynchronize
;
114 VclPtr
<SvxXLinePreview
> m_pCtlPreview
;
117 VclPtr
<VclFrame
> m_pFLEdgeStyle
;
118 VclPtr
<VclGrid
> m_pGridEdgeCaps
;
119 VclPtr
<ListBox
> m_pLBEdgeStyle
;
122 VclPtr
<ListBox
> m_pLBCapStyle
;
124 //#58425# symbols on a line (e. g. StarChart) ->
125 /** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview.
126 The list position is to be used cyclic. */
127 SdrObjList
* pSymbolList
;
129 /// a graphic to be displayed in the preview in case that an automatic symbol is chosen
130 Graphic aAutoSymbolGraphic
;
131 long nNumMenuGalleryItems
;
133 /// attributes for the shown symbols; only necessary if not equal to line properties
134 SfxItemSet
* pSymbolAttr
;
135 VclPtr
<VclFrame
> m_pFlSymbol
;
136 VclPtr
<VclGrid
> m_pGridIconSize
;
137 VclPtr
<MenuButton
> m_pSymbolMB
;
138 VclPtr
<MetricField
> m_pSymbolWidthMF
;
139 VclPtr
<MetricField
> m_pSymbolHeightMF
;
140 VclPtr
<CheckBox
> m_pSymbolRatioCB
;
141 std::vector
<OUString
> aGrfNames
;
142 SvxBmpItemInfoList aGrfBrushItems
;
143 bool bLastWidthModified
;
144 Size aSymbolLastSize
;
145 Graphic aSymbolGraphic
;
149 const SfxItemSet
& rOutAttrs
;
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_Int32
* pPosDashLb
;
171 sal_Int32
* pPosLineEndLb
;
173 SfxMapUnit ePoolUnit
;
176 sal_Int32 nActLineWidth
;
178 // handler for gallery popup menu button + size
179 DECL_LINK_TYPED( GraphicHdl_Impl
, MenuButton
*, void );
180 DECL_LINK( MenuCreateHdl_Impl
, MenuButton
* );
181 DECL_LINK( GraphicArrivedHdl_Impl
, SvxBrushItem
* );
182 DECL_LINK( SizeHdl_Impl
, MetricField
* );
183 DECL_LINK( RatioHdl_Impl
, CheckBox
* );
185 DECL_LINK( ClickInvisibleHdl_Impl
, void * );
186 DECL_LINK( ChangeStartHdl_Impl
, void * );
187 DECL_LINK( ChangeEndHdl_Impl
, void * );
188 DECL_LINK( ChangePreviewHdl_Impl
, void * );
189 DECL_LINK( ChangeTransparentHdl_Impl
, void * );
192 DECL_LINK( ChangeEdgeStyleHdl_Impl
, void * );
195 DECL_LINK ( ChangeCapStyleHdl_Impl
, void * );
197 bool FillXLSet_Impl();
199 void InitSymbols(MenuButton
* pButton
);
200 void SymbolSelected(MenuButton
* pButton
);
201 void FillListboxes();
204 void ShowSymbolControls(bool bOn
);
206 SvxLineTabPage( vcl::Window
* pParent
, const SfxItemSet
& rInAttrs
);
207 virtual ~SvxLineTabPage();
208 virtual void dispose() SAL_OVERRIDE
;
212 static VclPtr
<SfxTabPage
> Create( vcl::Window
*, const SfxItemSet
* );
213 static const sal_uInt16
* GetRanges() { return pLineRanges
; }
215 virtual bool FillItemSet( SfxItemSet
* ) SAL_OVERRIDE
;
216 virtual void Reset( const SfxItemSet
* ) SAL_OVERRIDE
;
218 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
219 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
) SAL_OVERRIDE
;
221 virtual void PointChanged( vcl::Window
* pWindow
, RECT_POINT eRP
) SAL_OVERRIDE
;
223 virtual void FillUserData() SAL_OVERRIDE
;
225 void SetColorList( XColorListRef pColTab
) { pColorList
= pColTab
; }
226 void SetDashList( XDashListRef pDshLst
) { pDashList
= pDshLst
; }
227 void SetLineEndList( XLineEndListRef pLneEndLst
) { pLineEndList
= pLneEndLst
; }
228 void SetObjSelected( bool bHasObj
) { bObjSelected
= bHasObj
; }
230 void SetPageType( sal_uInt16 nInType
) { nPageType
= nInType
; }
231 void SetDlgType( sal_uInt16 nInType
) { nDlgType
= nInType
; }
232 void SetPosDashLb( sal_Int32
* pInPos
) { pPosDashLb
= pInPos
; }
233 void SetPosLineEndLb( sal_Int32
* pInPos
) { pPosLineEndLb
= pInPos
; }
235 void SetLineEndChgd( ChangeType
* pIn
) { pnLineEndListState
= pIn
; }
236 void SetDashChgd( ChangeType
* pIn
) { pnDashListState
= pIn
; }
237 void SetColorChgd( ChangeType
* pIn
) { pnColorListState
= pIn
; }
239 virtual void PageCreated(const SfxAllItemSet
& aSet
) SAL_OVERRIDE
;
240 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) SAL_OVERRIDE
;
243 /*************************************************************************/
245 class SvxLineDefTabPage
: public SfxTabPage
247 using TabPage::ActivatePage
;
248 using TabPage::DeactivatePage
;
250 VclPtr
<LineLB
> m_pLbLineStyles
;
251 VclPtr
<ListBox
> m_pLbType1
;
252 VclPtr
<ListBox
> m_pLbType2
;
253 VclPtr
<NumericField
> m_pNumFldNumber1
;
254 VclPtr
<NumericField
> m_pNumFldNumber2
;
255 VclPtr
<MetricField
> m_pMtrLength1
;
256 VclPtr
<MetricField
> m_pMtrLength2
;
257 VclPtr
<MetricField
> m_pMtrDistance
;
258 VclPtr
<CheckBox
> m_pCbxSynchronize
;
259 VclPtr
<PushButton
> m_pBtnAdd
;
260 VclPtr
<PushButton
> m_pBtnModify
;
261 VclPtr
<PushButton
> m_pBtnDelete
;
262 VclPtr
<PushButton
> m_pBtnLoad
;
263 VclPtr
<PushButton
> m_pBtnSave
;
264 VclPtr
<SvxXLinePreview
> m_pCtlPreview
;
266 const SfxItemSet
& rOutAttrs
;
270 XOutdevItemPool
* pXPool
;
271 XLineStyleItem aXLStyle
;
272 XLineWidthItem aXWidth
;
273 XLineDashItem aXDash
;
274 XLineColorItem aXColor
;
275 XLineAttrSetItem aXLineAttr
;
278 XDashListRef pDashList
;
280 ChangeType
* pnDashListState
;
281 sal_uInt16
* pPageType
;
283 sal_Int32
* pPosDashLb
;
285 SfxMapUnit ePoolUnit
;
288 void FillDash_Impl();
289 void FillDialog_Impl();
291 DECL_LINK( ClickAddHdl_Impl
, void * );
292 DECL_LINK( ClickModifyHdl_Impl
, void * );
293 DECL_LINK( ClickDeleteHdl_Impl
, void * );
294 DECL_LINK( SelectLinestyleHdl_Impl
, void * );
295 DECL_LINK( ChangePreviewHdl_Impl
, void * );
296 DECL_LINK( ChangeNumber1Hdl_Impl
, void * );
297 DECL_LINK( ChangeNumber2Hdl_Impl
, void * );
298 DECL_LINK( ClickLoadHdl_Impl
, void * );
299 DECL_LINK( ClickSaveHdl_Impl
, void * );
300 DECL_LINK( ChangeMetricHdl_Impl
, void * );
301 DECL_LINK( SelectTypeHdl_Impl
, void * );
303 void CheckChanges_Impl();
306 SvxLineDefTabPage( vcl::Window
* pParent
, const SfxItemSet
& rInAttrs
);
307 virtual ~SvxLineDefTabPage();
308 virtual void dispose() SAL_OVERRIDE
;
312 static VclPtr
<SfxTabPage
> Create( vcl::Window
*, const SfxItemSet
* );
313 virtual bool FillItemSet( SfxItemSet
* ) SAL_OVERRIDE
;
314 virtual void Reset( const SfxItemSet
* ) SAL_OVERRIDE
;
316 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
317 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
) SAL_OVERRIDE
;
319 void SetDashList( XDashListRef pDshLst
) { pDashList
= pDshLst
; }
320 void SetObjSelected( bool bHasObj
) { bObjSelected
= bHasObj
; }
322 void SetPageType( sal_uInt16
* pInType
) { pPageType
= pInType
; }
323 void SetDlgType( sal_uInt16 nInType
) { nDlgType
= nInType
; }
324 void SetPosDashLb( sal_Int32
* pInPos
) { pPosDashLb
= pInPos
; }
326 void SetDashChgd( ChangeType
* pIn
) { pnDashListState
= pIn
; }
328 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) SAL_OVERRIDE
;
331 /*************************************************************************/
333 class SvxLineEndDefTabPage
: public SfxTabPage
335 using TabPage::ActivatePage
;
336 using TabPage::DeactivatePage
;
339 VclPtr
<Edit
> m_pEdtName
;
340 VclPtr
<LineEndLB
> m_pLbLineEnds
;
341 VclPtr
<PushButton
> m_pBtnAdd
;
342 VclPtr
<PushButton
> m_pBtnModify
;
343 VclPtr
<PushButton
> m_pBtnDelete
;
344 VclPtr
<PushButton
> m_pBtnLoad
;
345 VclPtr
<PushButton
> m_pBtnSave
;
346 VclPtr
<SvxXLinePreview
> m_pCtlPreview
;
348 const SfxItemSet
& rOutAttrs
;
349 const SdrObject
* pPolyObj
;
352 XOutdevItemPool
* pXPool
;
353 XLineStyleItem aXLStyle
;
354 XLineWidthItem aXWidth
;
355 XLineColorItem aXColor
;
356 XLineAttrSetItem aXLineAttr
;
359 XLineEndListRef pLineEndList
;
361 ChangeType
* pnLineEndListState
;
362 sal_uInt16
* pPageType
;
364 sal_Int32
* pPosLineEndLb
;
366 DECL_LINK( ClickAddHdl_Impl
, void * );
367 DECL_LINK( ClickModifyHdl_Impl
, void * );
368 DECL_LINK( ClickDeleteHdl_Impl
, void * );
369 DECL_LINK( ClickLoadHdl_Impl
, void * );
370 DECL_LINK( ClickSaveHdl_Impl
, void * );
371 DECL_LINK( SelectLineEndHdl_Impl
, void * );
372 long ChangePreviewHdl_Impl( void* p
);
374 void CheckChanges_Impl();
377 SvxLineEndDefTabPage( vcl::Window
* pParent
, const SfxItemSet
& rInAttrs
);
378 virtual ~SvxLineEndDefTabPage();
379 virtual void dispose() SAL_OVERRIDE
;
383 static VclPtr
<SfxTabPage
> Create( vcl::Window
*, const SfxItemSet
* );
384 virtual bool FillItemSet( SfxItemSet
* ) SAL_OVERRIDE
;
385 virtual void Reset( const SfxItemSet
* ) SAL_OVERRIDE
;
387 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
388 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
) SAL_OVERRIDE
;
390 void SetLineEndList( XLineEndListRef pInList
) { pLineEndList
= pInList
; }
391 void SetPolyObj( const SdrObject
* pObj
) { pPolyObj
= pObj
; }
392 void SetObjSelected( bool bHasObj
) { bObjSelected
= bHasObj
; }
394 void SetPageType( sal_uInt16
* pInType
) { pPageType
= pInType
; }
395 void SetDlgType( sal_uInt16 nInType
) { nDlgType
= nInType
; }
396 void SetPosLineEndLb( sal_Int32
* pInPos
) { pPosLineEndLb
= pInPos
; }
398 void SetLineEndChgd( ChangeType
* pIn
) { pnLineEndListState
= pIn
; }
400 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) SAL_OVERRIDE
;
401 virtual void Resize() SAL_OVERRIDE
;
404 #endif // INCLUDED_CUI_SOURCE_INC_CUITABLINE_HXX
406 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */