bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / cuitabarea.hxx
blob9ea0cf600cba320246de472f77272db5a872649c
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 INCLUDED_CUI_SOURCE_INC_CUITABAREA_HXX
20 #define INCLUDED_CUI_SOURCE_INC_CUITABAREA_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>
30 #include <svx/SvxColorValueSet.hxx>
32 class SdrModel;
33 class SdrView;
35 /************************************************************************/
37 class SvxAreaTabDialog : public SfxTabDialog
39 sal_uInt16 m_nAreaTabPage;
40 sal_uInt16 m_nShadowTabPage;
41 sal_uInt16 m_nTransparenceTabPage;
42 sal_uInt16 m_nColorTabPage;
43 sal_uInt16 m_nGradientTabPage;
44 sal_uInt16 m_nHatchTabPage;
45 sal_uInt16 m_nBitmapTabPage;
47 private:
48 SdrModel* mpDrawModel;
50 XColorListRef mpColorList;
51 XColorListRef mpNewColorList;
52 XGradientListRef mpGradientList;
53 XGradientListRef mpNewGradientList;
54 XHatchListRef mpHatchingList;
55 XHatchListRef mpNewHatchingList;
56 XBitmapListRef mpBitmapList;
57 XBitmapListRef mpNewBitmapList;
59 const SfxItemSet& mrOutAttrs;
61 ChangeType mnColorListState;
62 ChangeType mnBitmapListState;
63 ChangeType mnGradientListState;
64 ChangeType mnHatchingListState;
66 sal_uInt16 mnPageType;
67 sal_Int32 mnPos;
68 bool mbAreaTP;
70 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SAL_OVERRIDE;
72 protected:
73 virtual short Ok() SAL_OVERRIDE;
74 DECL_LINK( CancelHdlImpl, void * );
75 void SavePalettes();
77 public:
78 SvxAreaTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow );
80 void SetNewColorList( XColorListRef pColTab )
81 { mpNewColorList = pColTab; }
82 XColorListRef GetNewColorList() const { return mpNewColorList; }
83 const XColorListRef GetColorList() const { return mpColorList; }
85 void SetNewGradientList( XGradientListRef pGrdLst)
86 { mpNewGradientList = pGrdLst; }
87 XGradientListRef GetNewGradientList() const
88 { return mpNewGradientList; }
89 const XGradientListRef GetGradientList() const { return mpGradientList; }
91 void SetNewHatchingList( XHatchListRef pHtchLst)
92 { mpNewHatchingList = pHtchLst; }
93 XHatchListRef GetNewHatchingList() const
94 { return mpNewHatchingList; }
95 const XHatchListRef GetHatchingList() const { return mpHatchingList; }
97 void SetNewBitmapList( XBitmapListRef pBmpLst)
98 { mpNewBitmapList = pBmpLst; }
99 XBitmapListRef GetNewBitmapList() const { return mpNewBitmapList; }
100 const XBitmapListRef GetBitmapList() const { return mpBitmapList; }
103 /************************************************************************/
105 class SvxTransparenceTabPage : public SvxTabPage
107 using TabPage::ActivatePage;
108 using TabPage::DeactivatePage;
109 static const sal_uInt16 pTransparenceRanges[];
111 const SfxItemSet& rOutAttrs;
112 RECT_POINT eRP;
114 sal_uInt16 nPageType;
115 sal_uInt16 nDlgType;
117 // main selection
118 VclPtr<RadioButton> m_pRbtTransOff;
119 VclPtr<RadioButton> m_pRbtTransLinear;
120 VclPtr<RadioButton> m_pRbtTransGradient;
122 /// linear transparency
123 VclPtr<MetricField> m_pMtrTransparent;
125 // gradient transparency
126 VclPtr<VclGrid> m_pGridGradient;
127 VclPtr<ListBox> m_pLbTrgrGradientType;
128 VclPtr<FixedText> m_pFtTrgrCenterX;
129 VclPtr<MetricField> m_pMtrTrgrCenterX;
130 VclPtr<FixedText> m_pFtTrgrCenterY;
131 VclPtr<MetricField> m_pMtrTrgrCenterY;
132 VclPtr<FixedText> m_pFtTrgrAngle;
133 VclPtr<MetricField> m_pMtrTrgrAngle;
134 VclPtr<MetricField> m_pMtrTrgrBorder;
135 VclPtr<MetricField> m_pMtrTrgrStartValue;
136 VclPtr<MetricField> m_pMtrTrgrEndValue;
138 // preview
139 VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
140 VclPtr<SvxXRectPreview> m_pCtlXRectPreview;
141 bool bBitmap;
143 XOutdevItemPool* pXPool;
144 XFillAttrSetItem aXFillAttr;
145 SfxItemSet& rXFSet;
147 DECL_LINK(ClickTransOffHdl_Impl, void * );
148 DECL_LINK(ClickTransLinearHdl_Impl, void * );
149 DECL_LINK(ClickTransGradientHdl_Impl, void * );
150 DECL_LINK(ModifyTransparentHdl_Impl, void*);
151 DECL_STATIC_LINK(SvxTransparenceTabPage, ChangeTrgrTypeHdl_Impl, void*);
152 DECL_LINK(ModifiedTrgrHdl_Impl, void*);
154 void ActivateLinear(bool bActivate);
155 void ActivateGradient(bool bActivate);
156 void SetControlState_Impl(css::awt::GradientStyle eXGS);
158 bool InitPreview ( const SfxItemSet& rSet );
159 void InvalidatePreview (bool bEnable = true );
161 public:
162 SvxTransparenceTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs);
163 virtual ~SvxTransparenceTabPage();
164 virtual void dispose() SAL_OVERRIDE;
166 static VclPtr<SfxTabPage> Create(vcl::Window*, const SfxItemSet*);
167 static const sal_uInt16* GetRanges() { return pTransparenceRanges; }
169 virtual bool FillItemSet(SfxItemSet*) SAL_OVERRIDE;
170 virtual void Reset(const SfxItemSet*) SAL_OVERRIDE;
171 virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
172 virtual sfxpg DeactivatePage(SfxItemSet* pSet) SAL_OVERRIDE;
173 virtual void PointChanged(vcl::Window* pWindow, RECT_POINT eRP) SAL_OVERRIDE;
175 void SetPageType(sal_uInt16 nInType) { nPageType = nInType; }
176 void SetDlgType(sal_uInt16 nInType) { nDlgType = nInType; }
177 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
180 /************************************************************************/
182 class SvxAreaTabPage : public SvxTabPage
184 using TabPage::ActivatePage;
185 using TabPage::DeactivatePage;
186 static const sal_uInt16 pAreaRanges[];
187 private:
188 VclPtr<ListBox> m_pTypeLB;
190 VclPtr<VclBox> m_pFillLB;
191 VclPtr<ColorLB> m_pLbColor;
192 VclPtr<GradientLB> m_pLbGradient;
193 VclPtr<HatchingLB> m_pLbHatching;
194 VclPtr<BitmapLB> m_pLbBitmap;
195 VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
197 VclPtr<TriStateBox> m_pTsbStepCount;
198 VclPtr<VclFrame> m_pFlStepCount;
199 VclPtr<NumericField> m_pNumFldStepCount;
201 VclPtr<VclFrame> m_pFlHatchBckgrd;
202 VclPtr<CheckBox> m_pCbxHatchBckgrd;
203 VclPtr<ColorLB> m_pLbHatchBckgrdColor;
205 VclPtr<VclBox> m_pBxBitmap;
207 VclPtr<VclFrame> m_pFlSize;
208 VclPtr<TriStateBox> m_pTsbOriginal;
209 VclPtr<TriStateBox> m_pTsbScale;
210 VclPtr<VclGrid> m_pGridX_Y;
211 VclPtr<FixedText> m_pFtXSize;
212 VclPtr<MetricField> m_pMtrFldXSize;
213 VclPtr<FixedText> m_pFtYSize;
214 VclPtr<MetricField> m_pMtrFldYSize;
216 VclPtr<VclFrame> m_pFlPosition;
217 VclPtr<SvxRectCtl> m_pCtlPosition;
218 VclPtr<VclGrid> m_pGridOffset;
219 VclPtr<MetricField> m_pMtrFldXOffset;
220 VclPtr<MetricField> m_pMtrFldYOffset;
221 VclPtr<VclBox> m_pBxTile;
222 VclPtr<TriStateBox> m_pTsbTile;
223 VclPtr<TriStateBox> m_pTsbStretch;
224 VclPtr<VclFrame> m_pFlOffset;
225 VclPtr<RadioButton> m_pRbtRow;
226 VclPtr<RadioButton> m_pRbtColumn;
227 VclPtr<MetricField> m_pMtrFldOffset;
229 VclPtr<SvxXRectPreview> m_pCtlXRectPreview;
231 const SfxItemSet& rOutAttrs;
232 RECT_POINT eRP;
234 XColorListRef pColorList;
235 XGradientListRef pGradientList;
236 XHatchListRef pHatchingList;
237 XBitmapListRef pBitmapList;
239 // Placeholders for pointer-based entries; these will be inited
240 // to point to these so that the page is usable without that
241 // SvxAreaTabDialog has to call the setter methods (e.g. SetColorChgd).
242 // Without that the pages used in SvxAreaTabDialog are not usable
243 ChangeType maFixed_ChangeType;
244 bool maFixed_sal_Bool;
246 ChangeType* pnColorListState;
247 ChangeType* pnBitmapListState;
248 ChangeType* pnGradientListState;
249 ChangeType* pnHatchingListState;
251 sal_uInt16 nPageType;
252 sal_uInt16 nDlgType;
253 sal_Int32 nPos;
255 bool* pbAreaTP;
257 XOutdevItemPool* pXPool;
258 XFillAttrSetItem aXFillAttr;
259 SfxItemSet& rXFSet;
261 SfxMapUnit ePoolUnit;
262 FieldUnit eFUnit;
264 //UUUU
265 bool mbOfferImportButton;
266 bool mbDirectGraphicSet;
267 Graphic maDirectGraphic;
268 OUString maDirectName;
269 VclPtr<PushButton> m_pBtnImport;
271 DECL_LINK(SelectDialogTypeHdl_Impl, void *);
272 DECL_LINK( ModifyColorHdl_Impl, void * );
273 DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * );
274 DECL_LINK( ModifyGradientHdl_Impl, void * );
275 DECL_LINK( ModifyHatchingHdl_Impl, void * );
276 DECL_LINK( ToggleHatchBckgrdColorHdl_Impl, void * );
277 DECL_LINK( ModifyBitmapHdl_Impl, void * );
278 DECL_LINK( ModifyStepCountHdl_Impl, void * );
280 //UUUU
281 DECL_LINK( ClickImportHdl_Impl, void * );
283 DECL_LINK( ModifyTileHdl_Impl, void * );
284 DECL_LINK( ClickScaleHdl_Impl, void * );
285 void ClickInvisibleHdl_Impl();
286 void ClickHatchingHdl_Impl();
287 void ClickGradientHdl_Impl();
288 void ClickColorHdl_Impl();
289 void ClickBitmapHdl_Impl();
291 public:
292 SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
293 virtual ~SvxAreaTabPage();
294 virtual void dispose() SAL_OVERRIDE;
296 void Construct();
298 static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
299 static const sal_uInt16* GetRanges() { return pAreaRanges; }
301 virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
302 virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
303 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
304 virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
305 virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) SAL_OVERRIDE;
307 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
308 void SetGradientList( XGradientListRef pGrdLst)
309 { pGradientList = pGrdLst; }
310 void SetHatchingList( XHatchListRef pHtchLst)
311 { pHatchingList = pHtchLst; }
312 void SetBitmapList( XBitmapListRef pBmpLst) { pBitmapList = pBmpLst; }
314 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
315 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
316 void SetPos( sal_uInt16 nInPos ) { nPos = nInPos; }
317 void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
318 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
319 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
320 void SetGrdChgd( ChangeType* pIn ) { pnGradientListState = pIn; }
321 void SetHtchChgd( ChangeType* pIn ) { pnHatchingListState = pIn; }
322 void SetBmpChgd( ChangeType* pIn ) { pnBitmapListState = pIn; }
326 class SvxShadowTabPage : public SvxTabPage
328 using TabPage::ActivatePage;
329 using TabPage::DeactivatePage;
330 static const sal_uInt16 pShadowRanges[];
332 private:
333 VclPtr<TriStateBox> m_pTsbShowShadow;
334 VclPtr<VclGrid> m_pGridShadow;
335 VclPtr<SvxRectCtl> m_pCtlPosition;
336 VclPtr<MetricField> m_pMtrDistance;
337 VclPtr<ColorLB> m_pLbShadowColor;
338 VclPtr<MetricField> m_pMtrTransparent;
339 VclPtr<SvxXShadowPreview> m_pCtlXRectPreview;
341 const SfxItemSet& rOutAttrs;
342 RECT_POINT eRP;
344 XColorListRef pColorList;
345 ChangeType* pnColorListState;
346 sal_uInt16 nPageType;
347 sal_uInt16 nDlgType;
348 bool* pbAreaTP;
350 bool bDisable;
352 XOutdevItemPool* pXPool;
353 XFillAttrSetItem aXFillAttr;
354 SfxItemSet& rXFSet;
355 SfxMapUnit ePoolUnit;
357 DECL_LINK( ClickShadowHdl_Impl, void * );
358 DECL_LINK( ModifyShadowHdl_Impl, void * );
360 public:
361 SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
362 virtual ~SvxShadowTabPage();
363 virtual void dispose() SAL_OVERRIDE;
365 void Construct();
366 static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
367 static const sal_uInt16* GetRanges() { return pShadowRanges; }
369 virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
370 virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
371 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
372 virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
373 virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) SAL_OVERRIDE;
375 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
376 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
377 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
378 void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
379 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
380 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
381 void DisablePage( bool bIn ) { bDisable = bIn; }
384 /************************************************************************/
386 class SvxGradientTabPage : public SfxTabPage
388 using TabPage::ActivatePage;
389 using TabPage::DeactivatePage;
391 private:
392 VclPtr<ListBox> m_pLbGradientType;
393 VclPtr<FixedText> m_pFtCenterX;
394 VclPtr<MetricField> m_pMtrCenterX;
395 VclPtr<FixedText> m_pFtCenterY;
396 VclPtr<MetricField> m_pMtrCenterY;
397 VclPtr<FixedText> m_pFtAngle;
398 VclPtr<MetricField> m_pMtrAngle;
399 VclPtr<MetricField> m_pMtrBorder;
400 VclPtr<ColorLB> m_pLbColorFrom;
401 VclPtr<MetricField> m_pMtrColorFrom;
402 VclPtr<ColorLB> m_pLbColorTo;
403 VclPtr<MetricField> m_pMtrColorTo;
404 VclPtr<GradientLB> m_pLbGradients;
405 VclPtr<SvxXRectPreview> m_pCtlPreview;
406 VclPtr<PushButton> m_pBtnAdd;
407 VclPtr<PushButton> m_pBtnModify;
408 VclPtr<PushButton> m_pBtnDelete;
409 VclPtr<PushButton> m_pBtnLoad;
410 VclPtr<PushButton> m_pBtnSave;
412 const SfxItemSet& rOutAttrs;
414 XColorListRef pColorList;
415 XGradientListRef pGradientList;
417 ChangeType* pnGradientListState;
418 ChangeType* pnColorListState;
419 sal_uInt16* pPageType;
420 sal_uInt16 nDlgType;
421 sal_Int32* pPos;
422 bool* pbAreaTP;
424 XOutdevItemPool* pXPool;
425 XFillStyleItem aXFStyleItem;
426 XFillGradientItem aXGradientItem;
427 XFillAttrSetItem aXFillAttr;
428 SfxItemSet& rXFSet;
430 DECL_LINK( ClickAddHdl_Impl, void * );
431 DECL_LINK( ClickModifyHdl_Impl, void * );
432 DECL_LINK( ClickDeleteHdl_Impl, void * );
433 DECL_LINK( ChangeGradientHdl_Impl, void * );
434 DECL_LINK( ModifiedHdl_Impl, void * );
435 DECL_LINK( ClickLoadHdl_Impl, void * );
436 DECL_LINK( ClickSaveHdl_Impl, void * );
438 long CheckChanges_Impl();
439 void SetControlState_Impl( css::awt::GradientStyle eXGS );
441 public:
442 SvxGradientTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
443 virtual ~SvxGradientTabPage();
444 virtual void dispose() SAL_OVERRIDE;
446 void Construct();
448 static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
449 virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
450 virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
452 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
453 virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
455 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
456 void SetGradientList( XGradientListRef pGrdLst)
457 { pGradientList = pGrdLst; }
459 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
460 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
461 void SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
462 void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
464 void SetGrdChgd( ChangeType* pIn ) { pnGradientListState = pIn; }
465 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
468 /************************************************************************/
470 class SvxHatchTabPage : public SvxTabPage
472 using TabPage::ActivatePage;
473 using TabPage::DeactivatePage;
475 private:
476 VclPtr<MetricField> m_pMtrDistance;
477 VclPtr<MetricField> m_pMtrAngle;
478 VclPtr<SvxRectCtl> m_pCtlAngle;
479 VclPtr<ListBox> m_pLbLineType;
480 VclPtr<ColorLB> m_pLbLineColor;
481 VclPtr<HatchingLB> m_pLbHatchings;
482 VclPtr<SvxXRectPreview> m_pCtlPreview;
483 VclPtr<PushButton> m_pBtnAdd;
484 VclPtr<PushButton> m_pBtnModify;
485 VclPtr<PushButton> m_pBtnDelete;
486 VclPtr<PushButton> m_pBtnLoad;
487 VclPtr<PushButton> m_pBtnSave;
489 const SfxItemSet& rOutAttrs;
491 XColorListRef pColorList;
492 XHatchListRef pHatchingList;
494 ChangeType* pnHatchingListState;
495 ChangeType* pnColorListState;
496 sal_uInt16* pPageType;
497 sal_uInt16 nDlgType;
498 sal_Int32* pPos;
499 bool* pbAreaTP;
501 XOutdevItemPool* pXPool;
502 XFillStyleItem aXFStyleItem;
503 XFillHatchItem aXHatchItem;
504 XFillAttrSetItem aXFillAttr;
505 SfxItemSet& rXFSet;
507 SfxMapUnit ePoolUnit;
509 DECL_LINK( ChangeHatchHdl_Impl, void * );
510 DECL_LINK( ModifiedHdl_Impl, void * );
511 DECL_LINK( ClickAddHdl_Impl, void * );
512 DECL_LINK( ClickModifyHdl_Impl, void * );
513 DECL_LINK( ClickDeleteHdl_Impl, void * );
514 DECL_LINK( ClickLoadHdl_Impl, void * );
515 DECL_LINK( ClickSaveHdl_Impl, void * );
517 long CheckChanges_Impl();
519 public:
520 SvxHatchTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
521 virtual ~SvxHatchTabPage();
522 virtual void dispose() SAL_OVERRIDE;
524 void Construct();
526 static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
527 virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
528 virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
530 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
531 virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
533 virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) SAL_OVERRIDE;
535 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
536 void SetHatchingList( XHatchListRef pHtchLst)
537 { pHatchingList = pHtchLst; }
539 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
540 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
541 void SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
542 void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
544 void SetHtchChgd( ChangeType* pIn ) { pnHatchingListState = pIn; }
545 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
547 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
550 /************************************************************************/
552 class SvxBitmapTabPage : public SvxTabPage
554 using TabPage::ActivatePage;
555 using TabPage::DeactivatePage;
557 private:
558 VclPtr<VclBox> m_pBxPixelEditor;
559 VclPtr<SvxPixelCtl> m_pCtlPixel;
560 VclPtr<ColorLB> m_pLbColor;
561 VclPtr<ColorLB> m_pLbBackgroundColor;
562 VclPtr<FixedText> m_pLbBitmapsHidden;
563 VclPtr<BitmapLB> m_pLbBitmaps;
564 VclPtr<SvxXRectPreview> m_pCtlPreview;
565 VclPtr<PushButton> m_pBtnAdd;
566 VclPtr<PushButton> m_pBtnModify;
567 VclPtr<PushButton> m_pBtnImport;
568 VclPtr<PushButton> m_pBtnDelete;
569 VclPtr<PushButton> m_pBtnLoad;
570 VclPtr<PushButton> m_pBtnSave;
572 SvxBitmapCtl* m_pBitmapCtl;
574 const SfxItemSet& rOutAttrs;
576 XColorListRef pColorList;
577 XBitmapListRef pBitmapList;
579 ChangeType* pnBitmapListState;
580 ChangeType* pnColorListState;
581 sal_uInt16* pPageType;
582 sal_uInt16 nDlgType;
583 sal_Int32* pPos;
584 bool* pbAreaTP;
586 bool bBmpChanged;
588 XOutdevItemPool* pXPool;
589 XFillStyleItem aXFStyleItem;
590 XFillBitmapItem aXBitmapItem;
591 XFillAttrSetItem aXFillAttr;
592 SfxItemSet& rXFSet;
594 DECL_LINK( ClickAddHdl_Impl, void * );
595 DECL_LINK( ClickImportHdl_Impl, void * );
596 DECL_LINK( ClickModifyHdl_Impl, void * );
597 DECL_LINK( ClickDeleteHdl_Impl, void * );
598 DECL_LINK( ChangeBitmapHdl_Impl, void * );
599 DECL_LINK( ChangePixelColorHdl_Impl, void * );
600 DECL_LINK( ChangeBackgrndColorHdl_Impl, void * );
601 DECL_LINK( ClickLoadHdl_Impl, void * );
602 DECL_LINK( ClickSaveHdl_Impl, void * );
604 long CheckChanges_Impl();
606 public:
607 SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
608 virtual ~SvxBitmapTabPage();
609 virtual void dispose() SAL_OVERRIDE;
611 void Construct();
613 static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
614 virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
615 virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
617 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
618 virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
620 virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) SAL_OVERRIDE;
622 void SetColorList( XColorListRef pColTab ) { pColorList = pColTab; }
623 void SetBitmapList( XBitmapListRef pBmpLst) { pBitmapList = pBmpLst; }
625 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
626 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
627 void SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
628 void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
630 void SetBmpChgd( ChangeType* pIn ) { pnBitmapListState = pIn; }
631 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
633 /** Return a label that is associated with the given control. This
634 label is used to the determine the name for the control.
635 @param pLabeled
636 The control for which to return a label.
637 @return
638 Return a label control that provides a name for the specified
639 control.
641 virtual vcl::Window* GetParentLabeledBy( const vcl::Window* pLabeled ) const SAL_OVERRIDE;
644 /************************************************************************/
646 struct SvxColorTabPageShadow;
647 class SvxColorTabPage : public SfxTabPage
649 using TabPage::ActivatePage;
650 using TabPage::DeactivatePage;
652 private:
653 XPropertyListType meType;
655 VclPtr<Window> mpTopDlg;
656 VclPtr<CheckBox> m_pBoxEmbed;
657 VclPtr<PushButton> m_pBtnLoad;
658 VclPtr<PushButton> m_pBtnSave;
659 VclPtr<FixedText> m_pTableName;
661 DECL_LINK( EmbedToggleHdl_Impl, void * );
662 DECL_LINK( ClickLoadHdl_Impl, void * );
663 DECL_LINK( ClickSaveHdl_Impl, void * );
665 XPropertyListRef GetList();
666 bool GetEmbed();
667 void SetEmbed( bool bEmbed );
668 void UpdateTableName();
669 void EnableSave( bool bCanSave );
671 SvxColorTabPageShadow *pShadow;
672 VclPtr<Edit> m_pEdtName;
673 VclPtr<ColorLB> m_pLbColor;
675 VclPtr<SvxColorValueSet> m_pValSetColorList;
677 VclPtr<SvxXRectPreview> m_pCtlPreviewOld;
678 VclPtr<SvxXRectPreview> m_pCtlPreviewNew;
680 VclPtr<ListBox> m_pLbColorModel;
682 VclPtr<VclContainer> m_pRGB;
683 VclPtr<NumericField> m_pR;
684 VclPtr<NumericField> m_pG;
685 VclPtr<NumericField> m_pB;
687 VclPtr<VclContainer> m_pCMYK;
688 VclPtr<MetricField> m_pC;
689 VclPtr<MetricField> m_pY;
690 VclPtr<MetricField> m_pM;
691 VclPtr<MetricField> m_pK;
693 VclPtr<PushButton> m_pBtnAdd;
694 VclPtr<PushButton> m_pBtnModify;
695 VclPtr<PushButton> m_pBtnWorkOn;
696 VclPtr<PushButton> m_pBtnDelete;
698 const SfxItemSet& rOutAttrs;
700 XColorListRef pColorList;
702 ChangeType* pnColorListState;
703 sal_uInt16* pPageType;
704 sal_uInt16 nDlgType;
705 sal_Int32* pPos;
706 bool* pbAreaTP;
708 XFillStyleItem aXFStyleItem;
709 XFillColorItem aXFillColorItem;
710 XFillAttrSetItem aXFillAttr;
711 SfxItemSet& rXFSet;
713 ColorModel eCM;
715 Color aCurrentColor;
717 static void ConvertColorValues (Color& rColor, ColorModel eModell);
718 static void RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK );
719 static void CmykToRgb_Impl( Color& rColor, const sal_uInt16 nKey );
720 sal_uInt16 ColorToPercent_Impl( sal_uInt16 nColor );
721 sal_uInt16 PercentToColor_Impl( sal_uInt16 nPercent );
723 void ImpColorCountChanged();
726 DECL_LINK( ClickAddHdl_Impl, void * );
727 DECL_LINK( ClickModifyHdl_Impl, void * );
728 DECL_LINK( ClickDeleteHdl_Impl, void * );
729 DECL_LINK( ClickWorkOnHdl_Impl, void * );
731 DECL_LINK( SelectColorLBHdl_Impl, void * );
732 DECL_LINK( SelectValSetHdl_Impl, void * );
733 DECL_LINK( SelectColorModelHdl_Impl, void * );
734 void ChangeColor(const Color &rNewColor);
735 DECL_LINK( ModifiedHdl_Impl, void * );
737 long CheckChanges_Impl();
739 void UpdateModified();
740 public:
741 SvxColorTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
742 virtual ~SvxColorTabPage();
743 virtual void dispose() SAL_OVERRIDE;
745 void Construct();
747 static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
748 virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
749 virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
751 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
752 virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
754 XPropertyListRef GetPropertyList( XPropertyListType t );
755 void SetPropertyList( XPropertyListType t, const XPropertyListRef &xRef );
757 void SetColorList( XColorListRef pColList );
758 XColorListRef GetColorList() { return pColorList; }
759 void SaveToViewFrame( SfxViewFrame *pViewFrame );
760 void SetupForViewFrame( SfxViewFrame *pViewFrame );
762 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
763 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
764 void SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
765 void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
767 void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; }
769 virtual void FillUserData() SAL_OVERRIDE;
771 bool IsModified()
773 return bool(*pnColorListState & ChangeType::MODIFIED);
775 void SetModified(bool bIsModified)
777 if (bIsModified)
778 *pnColorListState |= ChangeType::MODIFIED;
779 else
780 *pnColorListState &= ~ChangeType::MODIFIED;
782 void AddState(ChangeType nState)
784 *pnColorListState |= nState;
786 void Update(bool bLoaded);
789 #endif // INCLUDED_CUI_SOURCE_INC_CUITABAREA_HXX
791 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */