Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / cuitabarea.hxx
blobef3832c6687e53356f9a53e909ac77af0493456c
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 .
19 #ifndef _CUI_TAB_AREA_HXX
20 #define _CUI_TAB_AREA_HXX
22 #include <svtools/valueset.hxx>
23 #include <vcl/button.hxx>
24 #include <vcl/fixed.hxx>
25 #include <svx/dlgctrl.hxx>
26 #include <svx/xsetit.hxx>
27 #include <svx/xfillit0.hxx>
28 #include <svx/xfillit.hxx>
29 #include <svx/tabarea.hxx>
31 class SdrModel;
32 class SdrView;
34 /************************************************************************/
36 class SvxAreaTabDialog : public SfxTabDialog
38 private:
39 SdrModel* mpDrawModel;
41 XColorListRef mpColorList;
42 XColorListRef mpNewColorList;
43 XGradientListRef mpGradientList;
44 XGradientListRef mpNewGradientList;
45 XHatchListRef mpHatchingList;
46 XHatchListRef mpNewHatchingList;
47 XBitmapListRef mpBitmapList;
48 XBitmapListRef mpNewBitmapList;
50 const SfxItemSet& mrOutAttrs;
52 ChangeType mnColorListState;
53 ChangeType mnBitmapListState;
54 ChangeType mnGradientListState;
55 ChangeType mnHatchingListState;
57 sal_uInt16 mnPageType;
58 sal_uInt16 mnDlgType;
59 sal_uInt16 mnPos;
60 sal_Bool mbAreaTP;
62 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
64 protected:
65 virtual short Ok();
66 #ifdef _SVX_TABAREA_CXX
67 DECL_LINK( CancelHdlImpl, void * );
68 void SavePalettes();
69 #endif
71 public:
72 SvxAreaTabDialog( Window* pParent,
73 const SfxItemSet* pAttr, SdrModel* pModel,
74 const SdrView* pSdrView = NULL );
75 ~SvxAreaTabDialog();
77 void SetNewColorList( XColorListRef pColTab )
78 { mpNewColorList = pColTab; }
79 XColorListRef GetNewColorList() const { return mpNewColorList; }
80 const XColorListRef GetColorList() const { return mpColorList; }
82 void SetNewGradientList( XGradientListRef pGrdLst)
83 { mpNewGradientList = pGrdLst; }
84 XGradientListRef GetNewGradientList() const
85 { return mpNewGradientList; }
86 const XGradientListRef GetGradientList() const { return mpGradientList; }
88 void SetNewHatchingList( XHatchListRef pHtchLst)
89 { mpNewHatchingList = pHtchLst; }
90 XHatchListRef GetNewHatchingList() const
91 { return mpNewHatchingList; }
92 const XHatchListRef GetHatchingList() const { return mpHatchingList; }
94 void SetNewBitmapList( XBitmapListRef pBmpLst)
95 { mpNewBitmapList = pBmpLst; }
96 XBitmapListRef GetNewBitmapList() const { return mpNewBitmapList; }
97 const XBitmapListRef GetBitmapList() const { return mpBitmapList; }
100 /************************************************************************/
102 class SvxTransparenceTabPage : public SvxTabPage
104 using TabPage::ActivatePage;
105 using TabPage::DeactivatePage;
107 const SfxItemSet& rOutAttrs;
108 RECT_POINT eRP;
110 sal_uInt16 nPageType;
111 sal_uInt16 nDlgType;
113 // main selection
114 FixedLine aFlProp;
115 RadioButton aRbtTransOff;
116 RadioButton aRbtTransLinear;
117 RadioButton aRbtTransGradient;
119 /// linear transparency
120 MetricField aMtrTransparent;
122 // gradient transparency
123 FixedText aFtTrgrType;
124 ListBox aLbTrgrGradientType;
125 FixedText aFtTrgrCenterX;
126 MetricField aMtrTrgrCenterX;
127 FixedText aFtTrgrCenterY;
128 MetricField aMtrTrgrCenterY;
129 FixedText aFtTrgrAngle;
130 MetricField aMtrTrgrAngle;
131 FixedText aFtTrgrBorder;
132 MetricField aMtrTrgrBorder;
133 FixedText aFtTrgrStartValue;
134 MetricField aMtrTrgrStartValue;
135 FixedText aFtTrgrEndValue;
136 MetricField aMtrTrgrEndValue;
138 // preview
139 SvxXRectPreview aCtlBitmapPreview;
140 SvxXRectPreview aCtlXRectPreview;
141 sal_Bool bBitmap;
143 XOutdevItemPool* pXPool;
144 XFillAttrSetItem aXFillAttr;
145 SfxItemSet& rXFSet;
147 #ifdef _SVX_TPAREA_CXX
148 DECL_LINK(ClickTransOffHdl_Impl, void * );
149 DECL_LINK(ClickTransLinearHdl_Impl, void * );
150 DECL_LINK(ClickTransGradientHdl_Impl, void * );
151 DECL_LINK(ModifyTransparentHdl_Impl, void*);
152 DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
153 DECL_LINK(ModifiedTrgrHdl_Impl, void*);
154 #endif
156 void ActivateLinear(sal_Bool bActivate);
157 void ActivateGradient(sal_Bool bActivate);
158 void SetControlState_Impl(XGradientStyle eXGS);
160 sal_Bool InitPreview ( const SfxItemSet& rSet );
161 void InvalidatePreview (sal_Bool bEnable = sal_True );
163 public:
164 SvxTransparenceTabPage(Window* pParent, const SfxItemSet& rInAttrs);
165 void Construct();
167 static SfxTabPage* Create(Window*, const SfxItemSet&);
168 static sal_uInt16* GetRanges();
170 virtual sal_Bool FillItemSet(SfxItemSet&);
171 virtual void Reset(const SfxItemSet&);
172 virtual void ActivatePage(const SfxItemSet& rSet);
173 virtual int DeactivatePage(SfxItemSet* pSet);
174 virtual void PointChanged(Window* pWindow, RECT_POINT eRP);
176 void SetPageType(sal_uInt16 nInType) { nPageType = nInType; }
177 void SetDlgType(sal_uInt16 nInType) { nDlgType = nInType; }
178 virtual void PageCreated (SfxAllItemSet aSet);
181 /************************************************************************/
183 class SvxAreaTabPage : public SvxTabPage
185 using TabPage::ActivatePage;
186 using TabPage::DeactivatePage;
188 private:
189 FixedLine aFlProp;
190 ListBox aTypeLB;
192 ColorLB aLbColor;
193 GradientLB aLbGradient;
194 HatchingLB aLbHatching;
195 BitmapLB aLbBitmap;
196 SvxXRectPreview aCtlBitmapPreview;
198 TriStateBox aTsbStepCount;
199 FixedLine aFlStepCount;
200 NumericField aNumFldStepCount;
202 CheckBox aCbxHatchBckgrd;
203 ColorLB aLbHatchBckgrdColor;
205 FixedLine aFlSize;
206 TriStateBox aTsbOriginal;
207 TriStateBox aTsbScale;
208 FixedText aFtXSize;
209 MetricField aMtrFldXSize;
210 FixedText aFtYSize;
211 MetricField aMtrFldYSize;
212 FixedLine aFlPosition;
213 SvxRectCtl aCtlPosition;
214 FixedText aFtXOffset;
215 MetricField aMtrFldXOffset;
216 FixedText aFtYOffset;
217 MetricField aMtrFldYOffset;
218 TriStateBox aTsbTile;
219 TriStateBox aTsbStretch;
220 FixedLine aFlOffset;
221 RadioButton aRbtRow;
222 RadioButton aRbtColumn;
223 MetricField aMtrFldOffset;
225 SvxXRectPreview aCtlXRectPreview;
227 const SfxItemSet& rOutAttrs;
228 RECT_POINT eRP;
230 XColorListRef pColorList;
231 XGradientListRef pGradientList;
232 XHatchListRef pHatchingList;
233 XBitmapListRef pBitmapList;
235 ChangeType* pnColorListState;
236 ChangeType* pnBitmapListState;
237 ChangeType* pnGradientListState;
238 ChangeType* pnHatchingListState;
240 sal_uInt16 nPageType;
241 sal_uInt16 nDlgType;
242 sal_uInt16 nPos;
244 sal_Bool* pbAreaTP;
246 XOutdevItemPool* pXPool;
247 XFillAttrSetItem aXFillAttr;
248 SfxItemSet& rXFSet;
250 SfxMapUnit ePoolUnit;
251 FieldUnit eFUnit;
253 #ifdef _SVX_TPAREA_CXX
254 DECL_LINK(SelectDialogTypeHdl_Impl, void *);
255 DECL_LINK( ModifyColorHdl_Impl, void * );
256 DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * );
257 DECL_LINK( ModifyGradientHdl_Impl, void * );
258 DECL_LINK( ModifyHatchingHdl_Impl, void * );
259 DECL_LINK( ToggleHatchBckgrdColorHdl_Impl, void * );
260 DECL_LINK( ModifyBitmapHdl_Impl, void * );
261 DECL_LINK( ModifyStepCountHdl_Impl, void * );
262 DECL_LINK( ModifyTileHdl_Impl, void * );
263 DECL_LINK( ClickScaleHdl_Impl, void * );
264 void ClickInvisibleHdl_Impl();
265 void ClickHatchingHdl_Impl();
266 void ClickGradientHdl_Impl();
267 void ClickColorHdl_Impl();
268 void ClickBitmapHdl_Impl();
269 #endif
271 public:
272 SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs );
274 void Construct();
276 static SfxTabPage* Create( Window*, const SfxItemSet& );
277 static sal_uInt16* GetRanges();
279 virtual sal_Bool FillItemSet( SfxItemSet& );
280 virtual void Reset( const SfxItemSet & );
281 virtual void ActivatePage( const SfxItemSet& rSet );
282 virtual int DeactivatePage( SfxItemSet* pSet );
283 virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
285 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
286 void SetGradientList( XGradientListRef pGrdLst)
287 { pGradientList = pGrdLst; }
288 void SetHatchingList( XHatchListRef pHtchLst)
289 { pHatchingList = pHtchLst; }
290 void SetBitmapList( XBitmapListRef pBmpLst) { pBitmapList = pBmpLst; }
292 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
293 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
294 void SetPos( sal_uInt16 nInPos ) { nPos = nInPos; }
295 void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
296 virtual void PageCreated (SfxAllItemSet aSet);
297 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
298 void SetGrdChgd( ChangeType* pIn ) { pnGradientListState = pIn; }
299 void SetHtchChgd( ChangeType* pIn ) { pnHatchingListState = pIn; }
300 void SetBmpChgd( ChangeType* pIn ) { pnBitmapListState = pIn; }
304 class SvxShadowTabPage : public SvxTabPage
306 using TabPage::ActivatePage;
307 using TabPage::DeactivatePage;
309 private:
310 FixedLine aFlProp;
311 TriStateBox aTsbShowShadow;
312 FixedText aFtPosition;
313 SvxRectCtl aCtlPosition;
314 FixedText aFtDistance;
315 MetricField aMtrDistance;
316 FixedText aFtShadowColor;
317 ColorLB aLbShadowColor;
318 FixedText aFtTransparent;
319 MetricField aMtrTransparent;
320 SvxXShadowPreview aCtlXRectPreview;
322 const SfxItemSet& rOutAttrs;
323 RECT_POINT eRP;
325 XColorListRef pColorList;
326 ChangeType* pnColorListState;
327 sal_uInt16 nPageType;
328 sal_uInt16 nDlgType;
329 sal_Bool* pbAreaTP;
331 sal_Bool bDisable;
333 XOutdevItemPool* pXPool;
334 XFillAttrSetItem aXFillAttr;
335 SfxItemSet& rXFSet;
336 SfxMapUnit ePoolUnit;
338 #ifdef _SVX_TPSHADOW_CXX
339 DECL_LINK( ClickShadowHdl_Impl, void * );
340 DECL_LINK( ModifyShadowHdl_Impl, void * );
341 #endif
343 public:
344 SvxShadowTabPage( Window* pParent, const SfxItemSet& rInAttrs );
346 void Construct();
347 static SfxTabPage* Create( Window*, const SfxItemSet& );
348 static sal_uInt16* GetRanges();
350 virtual sal_Bool FillItemSet( SfxItemSet& );
351 virtual void Reset( const SfxItemSet & );
352 virtual void ActivatePage( const SfxItemSet& rSet );
353 virtual int DeactivatePage( SfxItemSet* pSet );
354 virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
356 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
357 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
358 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
359 void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
360 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
361 virtual void PageCreated (SfxAllItemSet aSet);
362 void DisablePage( sal_Bool bIn ) { bDisable = bIn; }
365 /************************************************************************/
367 class SvxGradientTabPage : public SfxTabPage
369 using TabPage::ActivatePage;
370 using TabPage::DeactivatePage;
372 private:
373 FixedLine aFlProp;
374 FixedText aFtType;
375 ListBox aLbGradientType;
376 FixedText aFtCenterX;
377 MetricField aMtrCenterX;
378 FixedText aFtCenterY;
379 MetricField aMtrCenterY;
380 FixedText aFtAngle;
381 MetricField aMtrAngle;
382 FixedText aFtBorder;
383 MetricField aMtrBorder;
384 FixedText aFtColorFrom;
385 ColorLB aLbColorFrom;
386 MetricField aMtrColorFrom;
387 FixedText aFtColorTo;
388 ColorLB aLbColorTo;
389 MetricField aMtrColorTo;
390 GradientLB aLbGradients;
391 SvxXRectPreview aCtlPreview;
392 PushButton aBtnAdd;
393 PushButton aBtnModify;
394 PushButton aBtnDelete;
395 ImageButton aBtnLoad;
396 ImageButton aBtnSave;
398 const SfxItemSet& rOutAttrs;
400 XColorListRef pColorList;
401 XGradientListRef pGradientList;
403 ChangeType* pnGradientListState;
404 ChangeType* pnColorListState;
405 sal_uInt16* pPageType;
406 sal_uInt16* pDlgType;
407 sal_uInt16* pPos;
408 sal_Bool* pbAreaTP;
410 XOutdevItemPool* pXPool;
411 XFillStyleItem aXFStyleItem;
412 XFillGradientItem aXGradientItem;
413 XFillAttrSetItem aXFillAttr;
414 SfxItemSet& rXFSet;
416 #ifdef _SVX_TPGRADNT_CXX
417 DECL_LINK( ClickAddHdl_Impl, void * );
418 DECL_LINK( ClickModifyHdl_Impl, void * );
419 DECL_LINK( ClickDeleteHdl_Impl, void * );
420 DECL_LINK( ChangeGradientHdl_Impl, void * );
421 DECL_LINK( ModifiedHdl_Impl, void * );
422 DECL_LINK( ClickLoadHdl_Impl, void * );
423 DECL_LINK( ClickSaveHdl_Impl, void * );
425 long CheckChanges_Impl();
426 void SetControlState_Impl( XGradientStyle eXGS );
427 #endif
429 public:
430 SvxGradientTabPage( Window* pParent, const SfxItemSet& rInAttrs );
432 void Construct();
434 static SfxTabPage* Create( Window*, const SfxItemSet& );
435 virtual sal_Bool FillItemSet( SfxItemSet& );
436 virtual void Reset( const SfxItemSet & );
438 virtual void ActivatePage( const SfxItemSet& rSet );
439 virtual int DeactivatePage( SfxItemSet* pSet );
441 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
442 void SetGradientList( XGradientListRef pGrdLst)
443 { pGradientList = pGrdLst; }
445 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
446 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
447 void SetPos( sal_uInt16* pInPos ) { pPos = pInPos; }
448 void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
450 void SetGrdChgd( ChangeType* pIn ) { pnGradientListState = pIn; }
451 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
454 /************************************************************************/
456 class SvxHatchTabPage : public SvxTabPage
458 using TabPage::ActivatePage;
459 using TabPage::DeactivatePage;
461 private:
462 FixedText aFtDistance;
463 MetricField aMtrDistance;
464 FixedText aFtAngle;
465 MetricField aMtrAngle;
466 SvxRectCtl aCtlAngle;
467 FixedLine aFlProp;
468 FixedText aFtLineType;
469 ListBox aLbLineType;
470 FixedText aFtLineColor;
471 ColorLB aLbLineColor;
472 HatchingLB aLbHatchings;
473 SvxXRectPreview aCtlPreview;
474 PushButton aBtnAdd;
475 PushButton aBtnModify;
476 PushButton aBtnDelete;
477 ImageButton aBtnLoad;
478 ImageButton aBtnSave;
480 const SfxItemSet& rOutAttrs;
482 XColorListRef pColorList;
483 XHatchListRef pHatchingList;
485 ChangeType* pnHatchingListState;
486 ChangeType* pnColorListState;
487 sal_uInt16* pPageType;
488 sal_uInt16* pDlgType;
489 sal_uInt16* pPos;
490 sal_Bool* pbAreaTP;
492 XOutdevItemPool* pXPool;
493 XFillStyleItem aXFStyleItem;
494 XFillHatchItem aXHatchItem;
495 XFillAttrSetItem aXFillAttr;
496 SfxItemSet& rXFSet;
498 SfxMapUnit ePoolUnit;
500 #ifdef _SVX_TPHATCH_CXX
501 DECL_LINK( ChangeHatchHdl_Impl, void * );
502 DECL_LINK( ModifiedHdl_Impl, void * );
503 DECL_LINK( ClickAddHdl_Impl, void * );
504 DECL_LINK( ClickModifyHdl_Impl, void * );
505 DECL_LINK( ClickDeleteHdl_Impl, void * );
506 DECL_LINK( ClickLoadHdl_Impl, void * );
507 DECL_LINK( ClickSaveHdl_Impl, void * );
509 long CheckChanges_Impl();
510 #endif
512 public:
513 SvxHatchTabPage( Window* pParent, const SfxItemSet& rInAttrs );
515 void Construct();
517 static SfxTabPage* Create( Window*, const SfxItemSet& );
518 virtual sal_Bool FillItemSet( SfxItemSet& );
519 virtual void Reset( const SfxItemSet & );
521 virtual void ActivatePage( const SfxItemSet& rSet );
522 virtual int DeactivatePage( SfxItemSet* pSet );
524 virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
526 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
527 void SetHatchingList( XHatchListRef pHtchLst)
528 { pHatchingList = pHtchLst; }
530 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
531 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
532 void SetPos( sal_uInt16* pInPos ) { pPos = pInPos; }
533 void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
535 void SetHtchChgd( ChangeType* pIn ) { pnHatchingListState = pIn; }
536 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
538 virtual void DataChanged( const DataChangedEvent& rDCEvt );
541 /************************************************************************/
543 class SvxBitmapTabPage : public SvxTabPage
545 using TabPage::ActivatePage;
546 using TabPage::DeactivatePage;
548 private:
549 SvxPixelCtl aCtlPixel;
550 FixedText aFtPixelEdit;
551 FixedText aFtColor;
552 ColorLB aLbColor;
553 FixedText aFtBackgroundColor;
554 ColorLB aLbBackgroundColor;
555 FixedText aLbBitmapsHidden;
556 BitmapLB aLbBitmaps;
557 FixedLine aFlProp;
558 SvxXRectPreview aCtlPreview;
559 PushButton aBtnAdd;
560 PushButton aBtnModify;
561 PushButton aBtnImport;
562 PushButton aBtnDelete;
563 ImageButton aBtnLoad;
564 ImageButton aBtnSave;
566 SvxBitmapCtl aBitmapCtl;
568 const SfxItemSet& rOutAttrs;
570 XColorListRef pColorList;
571 XBitmapListRef pBitmapList;
573 ChangeType* pnBitmapListState;
574 ChangeType* pnColorListState;
575 sal_uInt16* pPageType;
576 sal_uInt16* pDlgType;
577 sal_uInt16* pPos;
578 sal_Bool* pbAreaTP;
580 sal_Bool bBmpChanged;
582 XOutdevItemPool* pXPool;
583 XFillStyleItem aXFStyleItem;
584 XFillBitmapItem aXBitmapItem;
585 XFillAttrSetItem aXFillAttr;
586 SfxItemSet& rXFSet;
588 #ifdef _SVX_TPBITMAP_CXX
589 DECL_LINK( ClickAddHdl_Impl, void * );
590 DECL_LINK( ClickImportHdl_Impl, void * );
591 DECL_LINK( ClickModifyHdl_Impl, void * );
592 DECL_LINK( ClickDeleteHdl_Impl, void * );
593 DECL_LINK( ChangeBitmapHdl_Impl, void * );
594 DECL_LINK( ChangePixelColorHdl_Impl, void * );
595 DECL_LINK( ChangeBackgrndColorHdl_Impl, void * );
596 DECL_LINK( ClickLoadHdl_Impl, void * );
597 DECL_LINK( ClickSaveHdl_Impl, void * );
599 long CheckChanges_Impl();
600 #endif
602 public:
603 SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs );
605 void Construct();
607 static SfxTabPage* Create( Window*, const SfxItemSet& );
608 virtual sal_Bool FillItemSet( SfxItemSet& );
609 virtual void Reset( const SfxItemSet & );
611 virtual void ActivatePage( const SfxItemSet& rSet );
612 virtual int DeactivatePage( SfxItemSet* pSet );
614 virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
616 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
617 void SetBitmapList( XBitmapListRef pBmpLst) { pBitmapList = pBmpLst; }
619 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
620 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
621 void SetPos( sal_uInt16* pInPos ) { pPos = pInPos; }
622 void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
624 void SetBmpChgd( ChangeType* pIn ) { pnBitmapListState = pIn; }
625 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
627 /** Return a label that is associated with the given control. This
628 label is used to the determine the name for the control.
629 @param pLabeled
630 The control for which to return a label.
631 @return
632 Return a label control that provides a name for the specified
633 control.
635 virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
638 /// Load save embed functionality
639 class SvxLoadSaveEmbed {
640 XPropertyListType meType;
641 XOutdevItemPool* mpXPool;
643 Window *mpTopDlg;
644 CheckBox maBoxEmbed;
645 ImageButton maBtnLoad;
646 ImageButton maBtnSave;
647 FixedText maTableName;
649 DECL_LINK( EmbedToggleHdl_Impl, void * );
650 DECL_LINK( ClickLoadHdl_Impl, void * );
651 DECL_LINK( ClickSaveHdl_Impl, void * );
652 public:
653 SvxLoadSaveEmbed( Window *pParent, Window *pDialog,
654 const ResId &aLoad, const ResId &aSave,
655 const ResId &aEmbed, const ResId &aTableName,
656 XPropertyListType t, XOutdevItemPool* mpXPool );
657 virtual ~SvxLoadSaveEmbed() {};
658 XPropertyListRef GetList();
659 void HideLoadSaveEmbed();
660 bool GetEmbed();
661 void SetEmbed( bool bEmbed );
662 void UpdateTableName();
663 void EnableSave( bool bCanSave );
665 virtual bool IsModified() = 0;
666 virtual void SetModified(bool bIsModified) = 0;
667 virtual void AddState(ChangeType nState) = 0;
668 virtual void Update(bool bLoaded) = 0;
671 /************************************************************************/
673 struct SvxColorTabPageShadow;
674 class SvxColorTabPage : public SfxTabPage, public SvxLoadSaveEmbed
676 using TabPage::ActivatePage;
677 using TabPage::DeactivatePage;
679 private:
680 SvxColorTabPageShadow *pShadow;
681 FixedLine aFlProp;
682 FixedText aFtName;
683 Edit aEdtName;
684 FixedText aFtColor;
685 ColorLB aLbColor;
687 ValueSet aValSetColorList;
689 SvxXRectPreview aCtlPreviewOld;
690 SvxXRectPreview aCtlPreviewNew;
692 ListBox aLbColorModel;
693 FixedText aFtColorModel1;
694 MetricField aMtrFldColorModel1;
695 FixedText aFtColorModel2;
696 MetricField aMtrFldColorModel2;
697 FixedText aFtColorModel3;
698 MetricField aMtrFldColorModel3;
700 FixedText aFtColorModel4;
701 MetricField aMtrFldColorModel4;
703 PushButton aBtnAdd;
704 PushButton aBtnModify;
705 PushButton aBtnWorkOn;
706 PushButton aBtnDelete;
708 const SfxItemSet& rOutAttrs;
710 XColorListRef pColorList;
712 ChangeType* pnColorListState;
713 sal_uInt16* pPageType;
714 sal_uInt16* pDlgType;
715 sal_uInt16* pPos;
716 sal_Bool* pbAreaTP;
718 XFillStyleItem aXFStyleItem;
719 XFillColorItem aXFillColorItem;
720 XFillAttrSetItem aXFillAttr;
721 SfxItemSet& rXFSet;
723 ColorModel eCM;
725 Color aAktuellColor;
727 #ifdef _SVX_TPCOLOR_CXX
728 void ConvertColorValues (Color& rColor, ColorModel eModell);
729 void RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK );
730 void CmykToRgb_Impl( Color& rColor, const sal_uInt16 nKey );
731 sal_uInt16 ColorToPercent_Impl( sal_uInt16 nColor );
732 sal_uInt16 PercentToColor_Impl( sal_uInt16 nPercent );
734 void FillValueSet_Impl( ValueSet& rVs );
735 //-----------------------------------------------------------------------------------------------------
736 DECL_LINK( ClickAddHdl_Impl, void * );
737 DECL_LINK( ClickModifyHdl_Impl, void * );
738 DECL_LINK( ClickDeleteHdl_Impl, void * );
739 DECL_LINK( ClickWorkOnHdl_Impl, void * );
741 DECL_LINK( SelectColorLBHdl_Impl, void * );
742 DECL_LINK( SelectValSetHdl_Impl, void * );
743 DECL_LINK( SelectColorModelHdl_Impl, void * );
744 long ChangeColorHdl_Impl( void* p );
745 DECL_LINK( ModifiedHdl_Impl, void * );
746 DECL_LINK( ClickLoadHdl_Impl, void * );
747 DECL_LINK( ClickSaveHdl_Impl, void * );
749 long CheckChanges_Impl();
750 #endif
752 void UpdateModified();
753 public:
754 SvxColorTabPage( Window* pParent, const SfxItemSet& rInAttrs );
755 ~SvxColorTabPage();
757 void Construct();
759 static SfxTabPage* Create( Window*, const SfxItemSet& );
760 virtual sal_Bool FillItemSet( SfxItemSet& );
761 virtual void Reset( const SfxItemSet & );
763 virtual void ActivatePage( const SfxItemSet& rSet );
764 virtual int DeactivatePage( SfxItemSet* pSet );
766 virtual XPropertyListRef GetPropertyList( XPropertyListType t );
767 virtual void SetPropertyList( XPropertyListType t, const XPropertyListRef &xRef );
769 void SetColorList( XColorListRef pColList );
770 XColorListRef GetColorList() { return pColorList; }
771 void SaveToViewFrame( SfxViewFrame *pViewFrame );
772 void SetupForViewFrame( SfxViewFrame *pViewFrame );
774 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
775 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
776 void SetPos( sal_uInt16* pInPos ) { pPos = pInPos; }
777 void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
779 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
781 virtual void FillUserData();
783 virtual bool IsModified()
785 return *pnColorListState & CT_MODIFIED;
787 virtual void SetModified(bool bIsModified)
789 if (bIsModified)
790 *pnColorListState |= CT_MODIFIED;
791 else
792 *pnColorListState &= ~CT_MODIFIED;
794 virtual void AddState(ChangeType nState)
796 *pnColorListState |= nState;
798 virtual void Update(bool bLoaded);
801 #endif // _CUI_TAB_AREA_HXX
803 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */