2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX
19 #define SVX_PROPERTYPANEL_AREAPAGE_HXX
21 #include <svx/sidebar/ColorPopup.hxx>
22 #include "AreaTransparencyGradientPopup.hxx"
23 #include <vcl/ctrl.hxx>
24 #include <sfx2/sidebar/SidebarPanelBase.hxx>
25 #include <sfx2/sidebar/ControllerItem.hxx>
26 #include <svx/xgrad.hxx>
27 #include <svx/itemwin.hxx>
28 #include <svx/xfillit0.hxx>
29 #include <svx/xflclit.hxx>
30 #include <svx/xflgrit.hxx>
31 #include <svx/xflhtit.hxx>
32 #include <svx/xbtmpit.hxx>
33 #include <svx/drawitem.hxx>
34 #include <vcl/lstbox.hxx>
35 #include <vcl/field.hxx>
36 #include <vcl/fixed.hxx>
37 #include <svl/intitem.hxx>
38 #include <svx/tbxcolorupdate.hxx>
39 #include <com/sun/star/ui/XUIElement.hpp>
40 #include <boost/scoped_ptr.hpp>
43 class XFillFloatTransparenceItem
;
44 namespace svx
{ class ToolboxButtonColorUpdater
; }
47 namespace svx
{ namespace sidebar
{
50 class AreaTransparencyGradientControl
;
52 class AreaPropertyPanel
54 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
57 static AreaPropertyPanel
* Create(
59 const cssu::Reference
<css::frame::XFrame
>& rxFrame
,
60 SfxBindings
* pBindings
);
62 virtual void DataChanged(
63 const DataChangedEvent
& rEvent
);
65 virtual void NotifyItemUpdate(
66 const sal_uInt16 nSId
,
67 const SfxItemState eState
,
68 const SfxPoolItem
* pState
,
69 const bool bIsEnabled
);
71 SfxBindings
* GetBindings();
73 const static sal_Int32 DEFAULT_CENTERX
;
74 const static sal_Int32 DEFAULT_CENTERY
;
75 const static sal_Int32 DEFAULT_ANGLE
;
76 const static sal_Int32 DEFAULT_STARTVALUE
;
77 const static sal_Int32 DEFAULT_ENDVALUE
;
78 const static sal_Int32 DEFAULT_BORDER
;
80 XGradient
GetGradient (const XGradientStyle eStyle
) const;
81 void SetGradient (const XGradient
& rGradient
);
82 sal_Int32
GetSelectedTransparencyTypeIndex (void) const;
88 sal_uInt16 mnLastPosGradient
;
89 sal_uInt16 mnLastPosHatch
;
90 sal_uInt16 mnLastPosBitmap
;
91 sal_uInt16 mnLastTransSolid
;
93 XGradient maGradientLinear
;
94 XGradient maGradientAxial
;
95 XGradient maGradientRadial
;
96 XGradient maGradientElliptical
;
97 XGradient maGradientSquare
;
98 XGradient maGradientRect
;
101 ::boost::scoped_ptr
< FixedText
> mpColorTextFT
;
102 ::boost::scoped_ptr
< SvxFillTypeBox
> mpLbFillType
;
103 ::boost::scoped_ptr
< SvxFillAttrBox
> mpLbFillAttr
;
104 ::boost::scoped_ptr
< Window
> mpToolBoxColorBackground
;
105 ::boost::scoped_ptr
< ToolBox
> mpToolBoxColor
; // for new color picker
106 ::boost::scoped_ptr
< FixedText
> mpTrspTextFT
;
107 ::boost::scoped_ptr
< ListBox
> mpLBTransType
;
108 ::boost::scoped_ptr
< MetricField
> mpMTRTransparent
;
109 ::boost::scoped_ptr
< Window
> mpBTNGradientBackground
;
110 ::boost::scoped_ptr
< ToolBox
> mpBTNGradient
;
112 ::boost::scoped_ptr
< ::svx::ToolboxButtonColorUpdater
> mpColorUpdater
;
114 ::boost::scoped_ptr
< XFillStyleItem
> mpStyleItem
;
115 ::boost::scoped_ptr
< XFillColorItem
> mpColorItem
;
116 ::boost::scoped_ptr
< XFillGradientItem
> mpFillGradientItem
;
117 ::boost::scoped_ptr
< XFillHatchItem
> mpHatchItem
;
118 ::boost::scoped_ptr
< XFillBitmapItem
> mpBitmapItem
;
120 ::sfx2::sidebar::ControllerItem maStyleControl
;
121 ::sfx2::sidebar::ControllerItem maColorControl
;
122 ::sfx2::sidebar::ControllerItem maGradientControl
;
123 ::sfx2::sidebar::ControllerItem maHatchControl
;
124 ::sfx2::sidebar::ControllerItem maBitmapControl
;
125 ::sfx2::sidebar::ControllerItem maColorTableControl
;
126 ::sfx2::sidebar::ControllerItem maGradientListControl
;
127 ::sfx2::sidebar::ControllerItem maHatchListControl
;
128 ::sfx2::sidebar::ControllerItem maBitmapListControl
;
129 ::sfx2::sidebar::ControllerItem maFillTransparenceController
;
130 ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController
;
140 String msHelpFillType
;
141 String msHelpFillAttr
;
143 AreaTransparencyGradientPopup maTrGrPopup
;
144 ColorPopup maColorPopup
;
146 ::boost::scoped_ptr
< XFillFloatTransparenceItem
> mpFloatTransparenceItem
;
147 ::boost::scoped_ptr
< SfxUInt16Item
> mpTransparanceItem
;
149 cssu::Reference
<css::frame::XFrame
> mxFrame
;
150 SfxBindings
* mpBindings
;
153 bool mbColorAvail
: 1;
155 DECL_LINK(SelectFillTypeHdl
, ListBox
* );
156 DECL_LINK(SelectFillAttrHdl
, ListBox
* );
157 DECL_LINK(ChangeTrgrTypeHdl_Impl
, void*);
158 DECL_LINK(ModifyTransparentHdl_Impl
, void*);
159 DECL_LINK( ImplPopupModeEndHdl
, FloatingWindow
* );
161 // for transparency gradient
162 PopupControl
* CreateTransparencyGradientControl (PopupContainer
* pParent
);
163 DECL_LINK( ClickTrGrHdl_Impl
, ToolBox
* );
166 PopupControl
* CreateColorPopupControl (PopupContainer
* pParent
);
167 DECL_LINK(ToolBoxColorDropHdl
, ToolBox
*); //for new color picker
169 // constructor/destuctor
172 const cssu::Reference
<css::frame::XFrame
>& rxFrame
,
173 SfxBindings
* pBindings
);
174 virtual ~AreaPropertyPanel(void);
176 void SetupIcons(void);
179 void ImpUpdateTransparencies();
181 Color
GetLastColor (void) const;
183 const String
& rsColorName
,
188 } } // end of namespace ::svx::sidebar
192 #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX