166c1fc23SArmin Le Grand /**************************************************************
2*62762835Smseidel  *
366c1fc23SArmin Le Grand  * Licensed to the Apache Software Foundation (ASF) under one
466c1fc23SArmin Le Grand  * or more contributor license agreements.  See the NOTICE file
566c1fc23SArmin Le Grand  * distributed with this work for additional information
666c1fc23SArmin Le Grand  * regarding copyright ownership.  The ASF licenses this file
766c1fc23SArmin Le Grand  * to you under the Apache License, Version 2.0 (the
866c1fc23SArmin Le Grand  * "License"); you may not use this file except in compliance
966c1fc23SArmin Le Grand  * with the License.  You may obtain a copy of the License at
10*62762835Smseidel  *
1166c1fc23SArmin Le Grand  *   http://www.apache.org/licenses/LICENSE-2.0
12*62762835Smseidel  *
1366c1fc23SArmin Le Grand  * Unless required by applicable law or agreed to in writing,
1466c1fc23SArmin Le Grand  * software distributed under the License is distributed on an
1566c1fc23SArmin Le Grand  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1666c1fc23SArmin Le Grand  * KIND, either express or implied.  See the License for the
1766c1fc23SArmin Le Grand  * specific language governing permissions and limitations
1866c1fc23SArmin Le Grand  * under the License.
19*62762835Smseidel  *
2066c1fc23SArmin Le Grand  *************************************************************/
2166c1fc23SArmin Le Grand 
22*62762835Smseidel 
23*62762835Smseidel 
2466c1fc23SArmin Le Grand #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX
2566c1fc23SArmin Le Grand #define SVX_PROPERTYPANEL_AREAPAGE_HXX
2666c1fc23SArmin Le Grand 
27facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx>
288dcb2a10SAndre Fischer #include "AreaTransparencyGradientPopup.hxx"
2966c1fc23SArmin Le Grand #include <vcl/ctrl.hxx>
3066c1fc23SArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx>
3166c1fc23SArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx>
326a606da0SAndre Fischer #include <sfx2/sidebar/GridLayouter.hxx>
3366c1fc23SArmin Le Grand #include <svx/xgrad.hxx>
3466c1fc23SArmin Le Grand #include <svx/itemwin.hxx>
3566c1fc23SArmin Le Grand #include <svx/xfillit0.hxx>
3666c1fc23SArmin Le Grand #include <svx/xflclit.hxx>
3766c1fc23SArmin Le Grand #include <svx/xflgrit.hxx>
3866c1fc23SArmin Le Grand #include <svx/xflhtit.hxx>
3966c1fc23SArmin Le Grand #include <svx/xbtmpit.hxx>
4066c1fc23SArmin Le Grand #include <svx/drawitem.hxx>
4166c1fc23SArmin Le Grand #include <vcl/lstbox.hxx>
4266c1fc23SArmin Le Grand #include <vcl/field.hxx>
4366c1fc23SArmin Le Grand #include <vcl/fixed.hxx>
4466c1fc23SArmin Le Grand #include <svl/intitem.hxx>
4566c1fc23SArmin Le Grand #include <svx/tbxcolorupdate.hxx>
4666c1fc23SArmin Le Grand #include <com/sun/star/ui/XUIElement.hpp>
4766c1fc23SArmin Le Grand #include <boost/scoped_ptr.hpp>
4866c1fc23SArmin Le Grand 
498dcb2a10SAndre Fischer 
5066c1fc23SArmin Le Grand class XFillFloatTransparenceItem;
5166c1fc23SArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; }
5266c1fc23SArmin Le Grand 
5366c1fc23SArmin Le Grand 
5466c1fc23SArmin Le Grand namespace svx { namespace sidebar {
5566c1fc23SArmin Le Grand 
568dcb2a10SAndre Fischer class PopupContainer;
578dcb2a10SAndre Fischer class AreaTransparencyGradientControl;
5802c50d82SAndre Fischer 
5966c1fc23SArmin Le Grand class AreaPropertyPanel
60*62762835Smseidel :	public Control,
61*62762835Smseidel 	public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
6266c1fc23SArmin Le Grand {
6366c1fc23SArmin Le Grand public:
64*62762835Smseidel 	static AreaPropertyPanel* Create(
65*62762835Smseidel 		Window* pParent,
66*62762835Smseidel 		const cssu::Reference<css::frame::XFrame>& rxFrame,
67*62762835Smseidel 		SfxBindings* pBindings);
6866c1fc23SArmin Le Grand 
69*62762835Smseidel 	virtual void DataChanged(
70*62762835Smseidel 		const DataChangedEvent& rEvent);
7166c1fc23SArmin Le Grand 
72*62762835Smseidel 	virtual void NotifyItemUpdate(
73*62762835Smseidel 		const sal_uInt16 nSId,
74*62762835Smseidel 		const SfxItemState eState,
75*62762835Smseidel 		const SfxPoolItem* pState,
76*62762835Smseidel 		const bool bIsEnabled);
7766c1fc23SArmin Le Grand 
78*62762835Smseidel 	SfxBindings* GetBindings();
7966c1fc23SArmin Le Grand 
80*62762835Smseidel 	const static sal_Int32 DEFAULT_CENTERX;
81*62762835Smseidel 	const static sal_Int32 DEFAULT_CENTERY;
82*62762835Smseidel 	const static sal_Int32 DEFAULT_ANGLE;
83*62762835Smseidel 	const static sal_Int32 DEFAULT_STARTVALUE;
84*62762835Smseidel 	const static sal_Int32 DEFAULT_ENDVALUE;
85*62762835Smseidel 	const static sal_Int32 DEFAULT_BORDER;
868dcb2a10SAndre Fischer 
87*62762835Smseidel 	XGradient GetGradient (const XGradientStyle eStyle) const;
88*62762835Smseidel 	void SetGradient (const XGradient& rGradient);
89*62762835Smseidel 	sal_Int32 GetSelectedTransparencyTypeIndex (void) const;
908dcb2a10SAndre Fischer 
91*62762835Smseidel 	virtual void Resize (void);
926a606da0SAndre Fischer 
9366c1fc23SArmin Le Grand private:
94*62762835Smseidel 	sal_uInt16											meLastXFS;
95*62762835Smseidel 	Color												maLastColor;
96*62762835Smseidel 
97*62762835Smseidel 	sal_uInt16											mnLastPosGradient;
98*62762835Smseidel 	sal_uInt16											mnLastPosHatch;
99*62762835Smseidel 	sal_uInt16											mnLastPosBitmap;
100*62762835Smseidel 	sal_uInt16											mnLastTransSolid;
101*62762835Smseidel 
102*62762835Smseidel 	XGradient											maGradientLinear;
103*62762835Smseidel 	XGradient											maGradientAxial;
104*62762835Smseidel 	XGradient											maGradientRadial;
105*62762835Smseidel 	XGradient											maGradientElliptical;
106*62762835Smseidel 	XGradient											maGradientSquare;
107*62762835Smseidel 	XGradient											maGradientRect;
108*62762835Smseidel 
109*62762835Smseidel 	// ui controls
110*62762835Smseidel 	::boost::scoped_ptr< FixedText >					mpColorTextFT;
111*62762835Smseidel 	::boost::scoped_ptr< SvxFillTypeBox >				mpLbFillType;
112*62762835Smseidel 	::boost::scoped_ptr< SvxFillAttrBox >				mpLbFillAttr;
113*62762835Smseidel 	::boost::scoped_ptr< Window >						mpToolBoxColorBackground;
114*62762835Smseidel 	::boost::scoped_ptr< ToolBox >						mpToolBoxColor; // for new color picker
115*62762835Smseidel 	::boost::scoped_ptr< FixedText >					mpTrspTextFT;
116*62762835Smseidel 	::boost::scoped_ptr< ListBox >						mpLBTransType;
117*62762835Smseidel 	::boost::scoped_ptr< MetricField >					mpMTRTransparent;
118*62762835Smseidel 	::boost::scoped_ptr< Window >						mpBTNGradientBackground;
119*62762835Smseidel 	::boost::scoped_ptr< ToolBox >						mpBTNGradient;
120*62762835Smseidel 
121*62762835Smseidel 	::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater >	mpColorUpdater;
122*62762835Smseidel 
123*62762835Smseidel 	::boost::scoped_ptr< XFillStyleItem >				mpStyleItem;
124*62762835Smseidel 	::boost::scoped_ptr< XFillColorItem >				mpColorItem;
125*62762835Smseidel 	::boost::scoped_ptr< XFillGradientItem >			mpFillGradientItem;
126*62762835Smseidel 	::boost::scoped_ptr< XFillHatchItem >				mpHatchItem;
127*62762835Smseidel 	::boost::scoped_ptr< XFillBitmapItem >				mpBitmapItem;
128*62762835Smseidel 
129*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maStyleControl;
130*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maColorControl;
131*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maGradientControl;
132*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maHatchControl;
133*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maBitmapControl;
134*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maColorTableControl;
135*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maGradientListControl;
136*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maHatchListControl;
137*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maBitmapListControl;
138*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maFillTransparenceController;
139*62762835Smseidel 	::sfx2::sidebar::ControllerItem						maFillFloatTransparenceController;
140*62762835Smseidel 
141*62762835Smseidel 	Image												maImgAxial;
142*62762835Smseidel 	Image												maImgElli;
143*62762835Smseidel 	Image												maImgQuad;
144*62762835Smseidel 	Image												maImgRadial;
145*62762835Smseidel 	Image												maImgSquare;
146*62762835Smseidel 	Image												maImgLinear;
147*62762835Smseidel 	Image												maImgColor;
148*62762835Smseidel 
149*62762835Smseidel 	// for high contract
150*62762835Smseidel 	Image												maImgAxialH;
151*62762835Smseidel 	Image												maImgElliH;
152*62762835Smseidel 	Image												maImgQuadH;
153*62762835Smseidel 	Image												maImgRadialH;
154*62762835Smseidel 	Image												maImgSquareH;
155*62762835Smseidel 	Image												maImgLinearH;
156*62762835Smseidel 	Image												maImgColorH;
157*62762835Smseidel 
158*62762835Smseidel 	String												msHelpFillType;
159*62762835Smseidel 	String												msHelpFillAttr;
160*62762835Smseidel 
161*62762835Smseidel 	AreaTransparencyGradientPopup maTrGrPopup;
162*62762835Smseidel 	ColorPopup maColorPopup;
163*62762835Smseidel 
164*62762835Smseidel 	::boost::scoped_ptr< XFillFloatTransparenceItem >	mpFloatTransparenceItem;
165*62762835Smseidel 	::boost::scoped_ptr< SfxUInt16Item >				mpTransparanceItem;
166*62762835Smseidel 
167*62762835Smseidel 	cssu::Reference<css::frame::XFrame>					mxFrame;
168*62762835Smseidel 	SfxBindings*										mpBindings;
169*62762835Smseidel 
170*62762835Smseidel 	// bitfield
171*62762835Smseidel 	bool												mbColorAvail : 1;
172*62762835Smseidel 
173*62762835Smseidel 	::sfx2::sidebar::GridLayouter maLayouter;
174*62762835Smseidel 
175*62762835Smseidel 	DECL_LINK(SelectFillTypeHdl, ListBox* );
176*62762835Smseidel 	DECL_LINK(SelectFillAttrHdl, ListBox* );
177*62762835Smseidel 	DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
178*62762835Smseidel 	DECL_LINK(ModifyTransparentHdl_Impl, void*);
179*62762835Smseidel 	DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* );
180*62762835Smseidel 
181*62762835Smseidel 	// for transparency gradient
182*62762835Smseidel 	PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
183*62762835Smseidel 	DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
184*62762835Smseidel 
185*62762835Smseidel 	// for color picker
186*62762835Smseidel 	PopupControl* CreateColorPopupControl (PopupContainer* pParent);
187*62762835Smseidel 	DECL_LINK(ToolBoxColorDropHdl, ToolBox *); // for new color picker
188*62762835Smseidel 
189*62762835Smseidel 	// constructor/destructor
190*62762835Smseidel 	AreaPropertyPanel(
191*62762835Smseidel 		Window* pParent,
192*62762835Smseidel 		const cssu::Reference<css::frame::XFrame>& rxFrame,
193*62762835Smseidel 		SfxBindings* pBindings);
194*62762835Smseidel 	virtual ~AreaPropertyPanel(void);
195*62762835Smseidel 
196*62762835Smseidel 	void SetupIcons(void);
197*62762835Smseidel 	void Initialize();
198*62762835Smseidel 	void Update();
199*62762835Smseidel 	void ImpUpdateTransparencies();
200*62762835Smseidel 
201*62762835Smseidel 	Color GetLastColor (void) const;
202*62762835Smseidel 	void SetColor (
203*62762835Smseidel 		const String& rsColorName,
204*62762835Smseidel 		const Color aColor);
20566c1fc23SArmin Le Grand };
20666c1fc23SArmin Le Grand 
20766c1fc23SArmin Le Grand 
2088dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar
20966c1fc23SArmin Le Grand 
21066c1fc23SArmin Le Grand 
21166c1fc23SArmin Le Grand 
2128dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX
2134e8031e0SArmin Le Grand 
2144e8031e0SArmin Le Grand // eof
215