1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_EXTRUSION_CONTROLS_HXX
24cdf0e10cSrcweir #define _SVX_EXTRUSION_CONTROLS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "svx/svxdllapi.h"
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <svtools/valueset.hxx>
29cdf0e10cSrcweir #include <svtools/svtreebx.hxx>
30cdf0e10cSrcweir #include <vcl/button.hxx>
31cdf0e10cSrcweir #include <vcl/dialog.hxx>
32cdf0e10cSrcweir #include <vcl/field.hxx>
33cdf0e10cSrcweir #include <vcl/fixed.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <svtools/toolbarmenu.hxx>
36cdf0e10cSrcweir #include <svtools/popupwindowcontroller.hxx>
37cdf0e10cSrcweir #include <svtools/popupmenucontrollerbase.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class SfxBindings;
40cdf0e10cSrcweir class SfxStatusForwarder;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //========================================================================
43cdf0e10cSrcweir 
44cdf0e10cSrcweir namespace svx
45cdf0e10cSrcweir {
46cdf0e10cSrcweir class ToolboxButtonColorUpdater;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class ExtrusionDirectionWindow : public svtools::ToolbarMenu
49cdf0e10cSrcweir {
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir 	ExtrusionDirectionWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
54cdf0e10cSrcweir 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
55cdf0e10cSrcweir 
56cdf0e10cSrcweir private:
57cdf0e10cSrcweir 	svt::ToolboxController& mrController;
58cdf0e10cSrcweir 	ValueSet* mpDirectionSet;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	Image		maImgDirection[9];
61cdf0e10cSrcweir 	Image		maImgDirectionH[9];
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	Image		maImgPerspective;
64cdf0e10cSrcweir 	Image		maImgPerspectiveH;
65cdf0e10cSrcweir 	Image		maImgParallel;
66cdf0e10cSrcweir 	Image		maImgParallelH;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	const rtl::OUString msExtrusionDirection;
69cdf0e10cSrcweir 	const rtl::OUString msExtrusionProjection;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	DECL_LINK( SelectHdl, void * );
72cdf0e10cSrcweir 	void			FillValueSet();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	void implSetDirection( sal_Int32 nSkew, bool bEnabled = true );
75cdf0e10cSrcweir 	void implSetProjection( sal_Int32 nProjection, bool bEnabled = true );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir };
78cdf0e10cSrcweir 
79cdf0e10cSrcweir //========================================================================
80cdf0e10cSrcweir 
81cdf0e10cSrcweir class ExtrusionDirectionControl : public svt::PopupWindowController
82cdf0e10cSrcweir {
83cdf0e10cSrcweir public:
84cdf0e10cSrcweir 	ExtrusionDirectionControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	virtual ::Window* createPopupWindow( ::Window* pParent );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     // XServiceInfo
89cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
90cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	using svt::PopupWindowController::createPopupWindow;
93cdf0e10cSrcweir };
94cdf0e10cSrcweir 
95cdf0e10cSrcweir //========================================================================
96cdf0e10cSrcweir 
97cdf0e10cSrcweir class ExtrusionDepthWindow : public svtools::ToolbarMenu
98cdf0e10cSrcweir {
99cdf0e10cSrcweir private:
100cdf0e10cSrcweir 	svt::ToolboxController& mrController;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	Image maImgDepth0;
103cdf0e10cSrcweir 	Image maImgDepth1;
104cdf0e10cSrcweir 	Image maImgDepth2;
105cdf0e10cSrcweir 	Image maImgDepth3;
106cdf0e10cSrcweir 	Image maImgDepth4;
107cdf0e10cSrcweir 	Image maImgDepthInfinity;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	Image maImgDepth0h;
110cdf0e10cSrcweir 	Image maImgDepth1h;
111cdf0e10cSrcweir 	Image maImgDepth2h;
112cdf0e10cSrcweir 	Image maImgDepth3h;
113cdf0e10cSrcweir 	Image maImgDepth4h;
114cdf0e10cSrcweir 	Image maImgDepthInfinityh;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	FieldUnit	meUnit;
117cdf0e10cSrcweir 	double		mfDepth;
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 	const rtl::OUString msExtrusionDepth;
120cdf0e10cSrcweir 	const rtl::OUString msMetricUnit;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	DECL_LINK( SelectHdl, void * );
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	void	implFillStrings( FieldUnit eUnit );
125cdf0e10cSrcweir 	void	implSetDepth( double fDepth );
126cdf0e10cSrcweir 
127cdf0e10cSrcweir public:
128cdf0e10cSrcweir 	ExtrusionDepthWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 	virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
131cdf0e10cSrcweir 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
132cdf0e10cSrcweir };
133cdf0e10cSrcweir 
134cdf0e10cSrcweir //========================================================================
135cdf0e10cSrcweir 
136cdf0e10cSrcweir class ExtrusionDepthController : public svt::PopupWindowController
137cdf0e10cSrcweir {
138cdf0e10cSrcweir public:
139cdf0e10cSrcweir 	ExtrusionDepthController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	virtual ::Window* createPopupWindow( ::Window* pParent );
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     // XServiceInfo
144cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
145cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 	using svt::PopupWindowController::createPopupWindow;
148cdf0e10cSrcweir };
149cdf0e10cSrcweir 
150cdf0e10cSrcweir //========================================================================
151cdf0e10cSrcweir 
152cdf0e10cSrcweir class ExtrusionLightingWindow : public svtools::ToolbarMenu
153cdf0e10cSrcweir {
154cdf0e10cSrcweir private:
155cdf0e10cSrcweir 	svt::ToolboxController& mrController;
156cdf0e10cSrcweir 	ValueSet*	 mpLightingSet;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 	Image maImgLightingOff[9];
159cdf0e10cSrcweir 	Image maImgLightingOn[9];
160cdf0e10cSrcweir 	Image maImgLightingPreview[9];
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	Image maImgLightingOffh[9];
163cdf0e10cSrcweir 	Image maImgLightingOnh[9];
164cdf0e10cSrcweir 	Image maImgLightingPreviewh[9];
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 	Image maImgBright;
167cdf0e10cSrcweir 	Image maImgNormal;
168cdf0e10cSrcweir 	Image maImgDim;
169cdf0e10cSrcweir 	Image maImgBrighth;
170cdf0e10cSrcweir 	Image maImgNormalh;
171cdf0e10cSrcweir 	Image maImgDimh;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	int		mnLevel;
174cdf0e10cSrcweir 	bool	mbLevelEnabled;
175cdf0e10cSrcweir 	int		mnDirection;
176cdf0e10cSrcweir 	bool	mbDirectionEnabled;
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 	const rtl::OUString msExtrusionLightingDirection;
179cdf0e10cSrcweir 	const rtl::OUString msExtrusionLightingIntensity;
180cdf0e10cSrcweir 
181cdf0e10cSrcweir 	void	implSetIntensity( int nLevel, bool bEnabled );
182cdf0e10cSrcweir 	void	implSetDirection( int nDirection, bool bEnabled );
183cdf0e10cSrcweir 
184cdf0e10cSrcweir 	DECL_LINK( SelectHdl, void * );
185cdf0e10cSrcweir public:
186cdf0e10cSrcweir 	ExtrusionLightingWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
189cdf0e10cSrcweir 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
190cdf0e10cSrcweir };
191cdf0e10cSrcweir 
192cdf0e10cSrcweir //========================================================================
193cdf0e10cSrcweir 
194cdf0e10cSrcweir class ExtrusionLightingControl : public svt::PopupWindowController
195cdf0e10cSrcweir {
196cdf0e10cSrcweir public:
197cdf0e10cSrcweir 	ExtrusionLightingControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	virtual ::Window* createPopupWindow( ::Window* pParent );
200cdf0e10cSrcweir 
201cdf0e10cSrcweir     // XServiceInfo
202cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
203cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 	using svt::PopupWindowController::createPopupWindow;
206cdf0e10cSrcweir };
207cdf0e10cSrcweir 
208cdf0e10cSrcweir //========================================================================
209cdf0e10cSrcweir 
210cdf0e10cSrcweir class ExtrusionSurfaceWindow : public svtools::ToolbarMenu
211cdf0e10cSrcweir {
212cdf0e10cSrcweir private:
213cdf0e10cSrcweir 	svt::ToolboxController& mrController;
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	Image maImgSurface1;
216cdf0e10cSrcweir 	Image maImgSurface2;
217cdf0e10cSrcweir 	Image maImgSurface3;
218cdf0e10cSrcweir 	Image maImgSurface4;
219cdf0e10cSrcweir 	Image maImgSurface1h;
220cdf0e10cSrcweir 	Image maImgSurface2h;
221cdf0e10cSrcweir 	Image maImgSurface3h;
222cdf0e10cSrcweir 	Image maImgSurface4h;
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	const rtl::OUString msExtrusionSurface;
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 	DECL_LINK( SelectHdl, void * );
227cdf0e10cSrcweir 
228cdf0e10cSrcweir 	void	implSetSurface( int nSurface, bool bEnabled );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir public:
231cdf0e10cSrcweir 	ExtrusionSurfaceWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow );
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 	virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
234cdf0e10cSrcweir };
235cdf0e10cSrcweir 
236cdf0e10cSrcweir //========================================================================
237cdf0e10cSrcweir 
238cdf0e10cSrcweir class ExtrusionSurfaceControl : public svt::PopupWindowController
239cdf0e10cSrcweir {
240cdf0e10cSrcweir public:
241cdf0e10cSrcweir 	ExtrusionSurfaceControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	virtual ::Window* createPopupWindow( ::Window* pParent );
244cdf0e10cSrcweir 
245cdf0e10cSrcweir     // XServiceInfo
246cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
247cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 	using svt::PopupWindowController::createPopupWindow;
250cdf0e10cSrcweir };
251cdf0e10cSrcweir 
252cdf0e10cSrcweir //========================================================================
253cdf0e10cSrcweir 
254cdf0e10cSrcweir }
255cdf0e10cSrcweir #endif
256cdf0e10cSrcweir 
257