xref: /aoo41x/main/cui/source/inc/cuitabline.hxx (revision c4eee24d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CUI_TAB_LINE_HXX
24 #define _CUI_TAB_LINE_HXX
25 
26 // include ---------------------------------------------------------------
27 #include <svx/tabline.hxx>
28 /*************************************************************************
29 |*
30 |* Transform-Tab-Dialog
31 |*
32 \************************************************************************/
33 
34 class SvxLineTabDialog : public SfxTabDialog
35 {
36 private:
37 	SdrModel*           pDrawModel;
38 	const SdrObject*    pObj;
39 
40 	const SfxItemSet&   rOutAttrs;
41 
42 	XColorTable*        pColorTab;
43 	XColorTable*        mpNewColorTab;
44 	XDashList*          pDashList;
45 	XDashList*          pNewDashList;
46 	XLineEndList*       pLineEndList;
47 	XLineEndList*       pNewLineEndList;
48 	sal_Bool                bObjSelected;
49 
50 	ChangeType          nLineEndListState;
51 	ChangeType          nDashListState;
52 	ChangeType          mnColorTableState;
53 
54 	sal_uInt16              nPageType;
55 	sal_uInt16              nDlgType;
56 	sal_uInt16              nPosDashLb;
57 	sal_uInt16              nPosLineEndLb;
58 	sal_uInt16              mnPos;
59 	sal_Bool                mbAreaTP;
60 	sal_Bool                mbDeleteColorTable;
61 
62 	virtual void        PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
63 
64 protected:
65 	virtual short       Ok();
66 #ifdef _SVX_TABLINE_CXX
67 	DECL_LINK( CancelHdlImpl, void * );
68 	void                SavePalettes();
69 #endif
70 
71 public:
72 	SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr,
73 					  SdrModel* pModel, const SdrObject* pObj = NULL,
74 					  sal_Bool bHasObj = sal_True );
75 	~SvxLineTabDialog();
76 
77 	void             SetNewDashList( XDashList* pInLst)
78 						{ pNewDashList = pInLst; }
79 	XDashList*       GetNewDashList() const { return pNewDashList; }
80 	const XDashList* GetDashList() const { return pDashList; }
81 
82 	void                SetNewLineEndList( XLineEndList* pInLst)
83 							{ pNewLineEndList = pInLst; }
84 	XLineEndList*       GetNewLineEndList() const { return pNewLineEndList; }
85 	const XLineEndList* GetLineEndList() const { return pLineEndList; }
86 
87 	void				SetNewColorTable( XColorTable* pColTab ) { mpNewColorTab = pColTab; }
88 	XColorTable*        GetNewColorTable() const { return mpNewColorTab; }
89 	const XColorTable*  GetColorTable() const { return pColorTab; }
90 };
91 
92 /*************************************************************************
93 |*
94 |* Linien-Tab-Page
95 |*
96 \************************************************************************/
97 
98 class SvxLineTabPage : public SvxTabPage
99 {
100 	using TabPage::ActivatePage;
101 	using TabPage::DeactivatePage;
102 private:
103 	FixedLine           aFlLine;
104 	FixedText           aFtLineStyle;
105 	LineLB              aLbLineStyle;
106 	FixedText           aFtColor;
107 	ColorLB             aLbColor;
108 	FixedText           aFtLineWidth;
109 	MetricField         aMtrLineWidth;
110 	FixedText           aFtTransparent;
111 	MetricField         aMtrTransparent;
112 	FixedLine           aFlLineEnds;
113 	LineEndLB           aLbStartStyle;
114 	MetricField         aMtrStartWidth;
115 	TriStateBox         aTsbCenterStart;
116 	FixedText           aFtLineEndsStyle;
117 	LineEndLB           aLbEndStyle;
118 	FixedText           aFtLineEndsWidth;
119 	MetricField         aMtrEndWidth;
120 	TriStateBox         aTsbCenterEnd;
121 	CheckBox            aCbxSynchronize;
122 	FixedLine           aFLSeparator;
123 	SvxXLinePreview     aCtlPreview;
124 
125 	// #116827#
126 	FixedLine           maFLEdgeStyle;
127 	FixedText           maFTEdgeStyle;
128 	LineEndLB           maLBEdgeStyle;
129 
130 	//#58425# Symbole auf einer Linie (z.B. StarChart) ->
131     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.
132 	bool				bNewSize;
133 	Graphic				aAutoSymbolGraphic; //a graphic to be displayed in the preview in case that an automatic symbol is choosen
134 	long				nNumMenuGalleryItems;
135 	long				nSymbolType;
136 	SfxItemSet*         pSymbolAttr; //attributes for the shown symbols; only necessary if not equal to line properties
137 	FixedLine			aFlSymbol;
138     MenuButton          aSymbolMB;
139     FixedText           aSymbolWidthFT;
140 	MetricField			aSymbolWidthMF;
141 	FixedText			aSymbolHeightFT;
142 	MetricField			aSymbolHeightMF;
143 	CheckBox			aSymbolRatioCB;
144 	List				aGrfNames;
145 	List				aGrfBrushItems;
146 	String				sNumCharFmtName;
147 	sal_Bool				bLastWidthModified;
148 	Size				aSymbolLastSize;
149 	Graphic				aSymbolGraphic;
150 	Size				aSymbolSize;
151 	sal_Bool				bSymbols;
152 
153     const SfxItemSet&   rOutAttrs;
154 	RECT_POINT          eRP;
155 	sal_Bool                bObjSelected;
156 
157 	XOutdevItemPool*    pXPool;
158 	XLineStyleItem      aXLStyle;
159 	XLineWidthItem      aXWidth;
160 	XLineDashItem       aXDash;
161 	XLineColorItem      aXColor;
162 	XLineAttrSetItem    aXLineAttr;
163 	SfxItemSet&         rXLSet;
164 
165 	XColorTable*        pColorTab;
166 	XDashList*          pDashList;
167 	XLineEndList*       pLineEndList;
168 
169 	ChangeType*         pnLineEndListState;
170 	ChangeType*         pnDashListState;
171 	ChangeType*         pnColorTableState;
172 	sal_uInt16             nPageType; //add CHINA001
173 	sal_uInt16             nDlgType; //add CHINA001
174 	sal_uInt16*             pPosDashLb;
175 	sal_uInt16*             pPosLineEndLb;
176 
177 	SfxMapUnit          ePoolUnit;
178 
179 	// #63083#
180 	sal_Int32				nActLineWidth;
181 
182     //Handler f�r Gallery-Popup-Menue-Button + Size
183     DECL_LINK( GraphicHdl_Impl, MenuButton * );
184     DECL_LINK( MenuCreateHdl_Impl, MenuButton * );
185     DECL_STATIC_LINK( SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
186     DECL_LINK( SizeHdl_Impl, MetricField * );
187     DECL_LINK( RatioHdl_Impl, CheckBox * );
188     // <- Symbole
189 
190 #ifdef _SVX_TPLINE_CXX
191 	DECL_LINK( ClickInvisibleHdl_Impl, void * );
192 	DECL_LINK( ChangeStartHdl_Impl, void * );
193 	DECL_LINK( ChangeEndHdl_Impl, void * );
194 	DECL_LINK( ChangePreviewHdl_Impl, void * );
195 	DECL_LINK( ChangeTransparentHdl_Impl, void * );
196 
197 	// #116827#
198 	DECL_LINK( ChangeEdgeStyleHdl_Impl, void * );
199 
200 	sal_Bool FillXLSet_Impl();
201 #endif
202 
203 	void FillListboxes();
204 public:
205 
206 	void ShowSymbolControls(sal_Bool bOn);
207 
208 	SvxLineTabPage( Window* pParent, const SfxItemSet& rInAttrs );
209 	virtual ~SvxLineTabPage();
210 
211 	void    Construct();
212 
213 
214 	static  SfxTabPage* Create( Window*, const SfxItemSet& );
215 	static  sal_uInt16*    GetRanges();
216 
217 	virtual sal_Bool FillItemSet( SfxItemSet& );
218 	virtual void Reset( const SfxItemSet& );
219 
220 	virtual void ActivatePage( const SfxItemSet& rSet );
221 	virtual int  DeactivatePage( SfxItemSet* pSet );
222 
223 	virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
224 
225 	virtual void FillUserData();
226 
227 	void    SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
228 	void    SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
229 	void    SetLineEndList( XLineEndList* pLneEndLst) { pLineEndList = pLneEndLst; }
230 	void    SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
231 
232 	void    SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }//CHINA001 void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
233 	void    SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }	//CHINA001 void    SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
234 	void    SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
235 	void    SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
236 
237 	void    SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
238 	void    SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
239 	void	SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
240 
241 	virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
242     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
243 };
244 
245 /*************************************************************************
246 |*
247 |* Linien-Definitions-Tab-Page
248 |*
249 \************************************************************************/
250 
251 class SvxLineDefTabPage : public SfxTabPage
252 {
253 	using TabPage::ActivatePage;
254 	using TabPage::DeactivatePage;
255 private:
256 	FixedLine           aFlDefinition;
257 	FixedText           aFTLinestyle;
258 	LineLB              aLbLineStyles;
259 	FixedText           aFtType;
260 	ListBox             aLbType1;
261 	ListBox             aLbType2;
262 	FixedText           aFtNumber;
263 	NumericField        aNumFldNumber1;
264 	NumericField        aNumFldNumber2;
265 	FixedText           aFtLength;
266 	MetricField         aMtrLength1;
267 	MetricField         aMtrLength2;
268 	FixedText           aFtDistance;
269 	MetricField         aMtrDistance;
270 	CheckBox            aCbxSynchronize;
271 	PushButton          aBtnAdd;
272 	PushButton          aBtnModify;
273 	PushButton          aBtnDelete;
274 	ImageButton         aBtnLoad;
275 	ImageButton         aBtnSave;
276 	SvxXLinePreview     aCtlPreview;
277 
278 	const SfxItemSet&   rOutAttrs;
279 	XDash               aDash;
280 	sal_Bool                bObjSelected;
281 
282 	XOutdevItemPool*    pXPool;
283 	XLineStyleItem      aXLStyle;
284 	XLineWidthItem      aXWidth;
285 	XLineDashItem       aXDash;
286 	XLineColorItem      aXColor;
287 	XLineAttrSetItem    aXLineAttr;
288 	SfxItemSet&         rXLSet;
289 
290 	XDashList*          pDashList;
291 
292 	ChangeType*         pnDashListState;
293 	sal_uInt16*             pPageType;
294 	sal_uInt16*             pDlgType;
295 	sal_uInt16*             pPosDashLb;
296 
297 	SfxMapUnit          ePoolUnit;
298 	FieldUnit           eFUnit;
299 
300 #ifdef _SVX_TPLNEDEF_CXX
301 	void FillDash_Impl();
302 	void FillDialog_Impl();
303 
304 	DECL_LINK( ClickAddHdl_Impl, void * );
305 	DECL_LINK( ClickModifyHdl_Impl, void * );
306 	DECL_LINK( ClickDeleteHdl_Impl, void * );
307 	DECL_LINK( SelectLinestyleHdl_Impl, void * );
308 	DECL_LINK( ChangePreviewHdl_Impl, void * );
309 	DECL_LINK( ChangeNumber1Hdl_Impl, void * );
310 	DECL_LINK( ChangeNumber2Hdl_Impl, void * );
311 	DECL_LINK( ClickLoadHdl_Impl, void * );
312 	DECL_LINK( ClickSaveHdl_Impl, void * );
313 	DECL_LINK( ChangeMetricHdl_Impl, void * );
314 	DECL_LINK( SelectTypeHdl_Impl, void * );
315 
316 	void CheckChanges_Impl();
317 #endif
318 
319 public:
320 	SvxLineDefTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
321 
322 	void    Construct();
323 
324 	static  SfxTabPage* Create( Window*, const SfxItemSet& );
325 	virtual sal_Bool FillItemSet( SfxItemSet& );
326 	virtual void Reset( const SfxItemSet & );
327 
328 	virtual void ActivatePage( const SfxItemSet& rSet );
329 	virtual int  DeactivatePage( SfxItemSet* pSet );
330 
331 	void    SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
332 	void    SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
333 
334 	void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
335 	void    SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
336 	void    SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
337 
338 	void    SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
339 
340     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
341 };
342 
343 /*************************************************************************
344 |*
345 |* Linienenden-Definitions-Tab-Page
346 |*
347 \************************************************************************/
348 
349 class SvxLineEndDefTabPage : public SfxTabPage
350 {
351 	using TabPage::ActivatePage;
352 	using TabPage::DeactivatePage;
353 
354 private:
355 	FixedLine           aFlTip;
356 	FixedText           aFTTitle;
357 	Edit                aEdtName;
358 	FixedText           aFTLineEndStyle;
359 	LineEndLB           aLbLineEnds;
360 	PushButton          aBtnAdd;
361 	PushButton          aBtnModify;
362 	PushButton          aBtnDelete;
363 	ImageButton         aBtnLoad;
364 	ImageButton         aBtnSave;
365 	FixedInfo           aFiTip;
366 	SvxXLinePreview     aCtlPreview;
367 
368 	const SfxItemSet&   rOutAttrs;
369 	const SdrObject*    pPolyObj;
370 	sal_Bool                bObjSelected;
371 
372 	XOutdevItemPool*    pXPool;
373 	XLineStyleItem      aXLStyle;
374 	XLineWidthItem      aXWidth;
375 	XLineColorItem      aXColor;
376 	XLineAttrSetItem    aXLineAttr;
377 	SfxItemSet&         rXLSet;
378 
379 	XLineEndList*       pLineEndList;
380 
381 	ChangeType*         pnLineEndListState;
382 	sal_uInt16*             pPageType;
383 	sal_uInt16*             pDlgType;
384 	sal_uInt16*             pPosLineEndLb;
385 
386 #ifdef _SVX_TPLNEEND_CXX
387 	DECL_LINK( ClickAddHdl_Impl, void * );
388 	DECL_LINK( ClickModifyHdl_Impl, void * );
389 	DECL_LINK( ClickDeleteHdl_Impl, void * );
390 	DECL_LINK( ClickLoadHdl_Impl, void * );
391 	DECL_LINK( ClickSaveHdl_Impl, void * );
392 	DECL_LINK( SelectLineEndHdl_Impl, void * );
393 	long ChangePreviewHdl_Impl( void* p );
394 
395 	void CheckChanges_Impl();
396 #endif
397 
398 public:
399 	SvxLineEndDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
400 	~SvxLineEndDefTabPage();
401 
402 	void    Construct();
403 
404 	static  SfxTabPage* Create( Window*, const SfxItemSet& );
405 	virtual sal_Bool FillItemSet( SfxItemSet& );
406 	virtual void Reset( const SfxItemSet & );
407 
408 	virtual void ActivatePage( const SfxItemSet& rSet );
409 	virtual int  DeactivatePage( SfxItemSet* pSet );
410 
411 	void    SetLineEndList( XLineEndList* pInList ) { pLineEndList = pInList; }
412 	void    SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
413 	void    SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
414 
415 	void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
416 	void    SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
417 	void    SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
418 
419 	void    SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
420 
421     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
422 };
423 
424 
425 #endif // _CUI_TAB_LINE_HXX
426 
427