update credits
[LibreOffice.git] / cui / source / inc / cuitabline.hxx
blob5207b7a046119f28b37a2b7f4659f10d4be137f3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <vector>
24 #include <svx/tabline.hxx>
26 class SvxLineTabDialog : public SfxTabDialog
28 private:
29 SdrModel* pDrawModel;
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;
46 sal_uInt16 nPageType;
47 sal_uInt16 nDlgType;
48 sal_uInt16 nPosDashLb;
49 sal_uInt16 nPosLineEndLb;
50 sal_Bool mbAreaTP;
52 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
54 protected:
55 virtual short Ok();
56 DECL_LINK( CancelHdlImpl, void * );
57 void SavePalettes();
59 public:
60 SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr,
61 SdrModel* pModel, const SdrObject* pObj = NULL,
62 sal_Bool bHasObj = sal_True );
63 ~SvxLineTabDialog();
65 void SetNewDashList( XDashListRef pInLst)
66 { pNewDashList = pInLst; }
67 XDashListRef GetNewDashList() const { return pNewDashList; }
68 XDashListRef GetDashList() const { return pDashList; }
70 void SetNewLineEndList( XLineEndListRef pInLst)
71 { pNewLineEndList = pInLst; }
72 XLineEndListRef GetNewLineEndList() const { return pNewLineEndList; }
73 XLineEndListRef GetLineEndList() const { return pLineEndList; }
75 void SetNewColorList( XColorListRef pColTab ) { mpNewColorList = pColTab; }
76 XColorListRef GetNewColorList() const { return mpNewColorList; }
77 XColorListRef GetColorList() const { return pColorList; }
80 /*************************************************************************/
82 struct SvxBmpItemInfo;
83 typedef ::std::vector< SvxBmpItemInfo* > SvxBmpItemInfoList;
85 class SvxLineTabPage : public SvxTabPage
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;
112 // #116827#
113 FixedLine maFLEdgeStyle;
114 FixedText maFTEdgeStyle;
115 LineEndLB maLBEdgeStyle;
117 // LineCaps
118 FixedText maFTCapStyle;
119 LineEndLB maLBCapStyle;
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;
147 const SfxItemSet& rOutAttrs;
148 RECT_POINT eRP;
149 sal_Bool bObjSelected;
151 XOutdevItemPool* pXPool;
152 XLineStyleItem aXLStyle;
153 XLineWidthItem aXWidth;
154 XLineDashItem aXDash;
155 XLineColorItem aXColor;
156 XLineAttrSetItem aXLineAttr;
157 SfxItemSet& rXLSet;
159 XColorListRef pColorList;
160 XDashListRef pDashList;
161 XLineEndListRef pLineEndList;
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;
171 SfxMapUnit ePoolUnit;
173 // #63083#
174 sal_Int32 nActLineWidth;
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 * );
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 * );
189 // #116827#
190 DECL_LINK( ChangeEdgeStyleHdl_Impl, void * );
192 // LineCaps
193 DECL_LINK ( ChangeCapStyleHdl_Impl, void * );
195 sal_Bool FillXLSet_Impl();
197 void InitSymbols(MenuButton* pButton);
198 void SymbolSelected(MenuButton* pButton);
199 void FillListboxes();
200 public:
202 void ShowSymbolControls(sal_Bool bOn);
204 SvxLineTabPage( Window* pParent, const SfxItemSet& rInAttrs );
205 virtual ~SvxLineTabPage();
207 void Construct();
209 static SfxTabPage* Create( Window*, const SfxItemSet& );
210 static sal_uInt16* GetRanges();
212 virtual sal_Bool FillItemSet( SfxItemSet& );
213 virtual void Reset( const SfxItemSet& );
215 virtual void ActivatePage( const SfxItemSet& rSet );
216 virtual int DeactivatePage( SfxItemSet* pSet );
218 virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
220 virtual void FillUserData();
222 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
223 void SetDashList( XDashListRef pDshLst ) { pDashList = pDshLst; }
224 void SetLineEndList( XLineEndListRef pLneEndLst) { pLineEndList = pLneEndLst; }
225 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
227 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
228 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
229 void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
230 void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
232 void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
233 void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
234 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
236 virtual void PageCreated (SfxAllItemSet aSet);
237 virtual void DataChanged( const DataChangedEvent& rDCEvt );
240 /*************************************************************************/
242 class SvxLineDefTabPage : public SfxTabPage
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;
269 const SfxItemSet& rOutAttrs;
270 XDash aDash;
271 sal_Bool bObjSelected;
273 XOutdevItemPool* pXPool;
274 XLineStyleItem aXLStyle;
275 XLineWidthItem aXWidth;
276 XLineDashItem aXDash;
277 XLineColorItem aXColor;
278 XLineAttrSetItem aXLineAttr;
279 SfxItemSet& rXLSet;
281 XDashListRef pDashList;
283 ChangeType* pnDashListState;
284 sal_uInt16* pPageType;
285 sal_uInt16* pDlgType;
286 sal_uInt16* pPosDashLb;
288 SfxMapUnit ePoolUnit;
289 FieldUnit eFUnit;
291 void FillDash_Impl();
292 void FillDialog_Impl();
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 * );
306 void CheckChanges_Impl();
308 public:
309 SvxLineDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
311 void Construct();
313 static SfxTabPage* Create( Window*, const SfxItemSet& );
314 virtual sal_Bool FillItemSet( SfxItemSet& );
315 virtual void Reset( const SfxItemSet & );
317 virtual void ActivatePage( const SfxItemSet& rSet );
318 virtual int DeactivatePage( SfxItemSet* pSet );
320 void SetDashList( XDashListRef pDshLst ) { pDashList = pDshLst; }
321 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
323 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
324 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
325 void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
327 void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
329 virtual void DataChanged( const DataChangedEvent& rDCEvt );
332 /*************************************************************************/
334 class SvxLineEndDefTabPage : public SfxTabPage
336 using TabPage::ActivatePage;
337 using TabPage::DeactivatePage;
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;
353 const SfxItemSet& rOutAttrs;
354 const SdrObject* pPolyObj;
355 sal_Bool bObjSelected;
357 XOutdevItemPool* pXPool;
358 XLineStyleItem aXLStyle;
359 XLineWidthItem aXWidth;
360 XLineColorItem aXColor;
361 XLineAttrSetItem aXLineAttr;
362 SfxItemSet& rXLSet;
364 XLineEndListRef pLineEndList;
366 ChangeType* pnLineEndListState;
367 sal_uInt16* pPageType;
368 sal_uInt16* pDlgType;
369 sal_uInt16* pPosLineEndLb;
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 );
379 void CheckChanges_Impl();
381 public:
382 SvxLineEndDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
383 ~SvxLineEndDefTabPage();
385 void Construct();
387 static SfxTabPage* Create( Window*, const SfxItemSet& );
388 virtual sal_Bool FillItemSet( SfxItemSet& );
389 virtual void Reset( const SfxItemSet & );
391 virtual void ActivatePage( const SfxItemSet& rSet );
392 virtual int DeactivatePage( SfxItemSet* pSet );
394 void SetLineEndList( XLineEndListRef pInList ) { pLineEndList = pInList; }
395 void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
396 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
398 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
399 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
400 void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
402 void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
404 virtual void DataChanged( const DataChangedEvent& rDCEvt );
407 #endif // _CUI_TAB_LINE_HXX
409 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */