1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CHART2_TP_3D_SCENE_ILLUMIMATION_HXX
24 #define _CHART2_TP_3D_SCENE_ILLUMIMATION_HXX
25 
26 #include "ModifyListenerCallBack.hxx"
27 #include "TimerTriggeredControllerLock.hxx"
28 
29 // #ifndef _COM_SUN_STAR_CHART2_SCENEDESCRIPTOR_HPP_
30 // #include <com/sun/star/chart2/SceneDescriptor.hpp>
31 // #endif
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 
34 // header for class TabPage
35 #include <vcl/tabpage.hxx>
36 // header for class FixedText
37 #include <vcl/fixed.hxx>
38 // header for class CheckBox
39 #ifndef _SV_BUTTON_HXX
40 #include <vcl/button.hxx>
41 #endif
42 // header for class ColorLB
43 #include <svx/dlgctrl.hxx>
44 // header for class SvxLightCtl3D
45 #include <svx/dlgctl3d.hxx>
46 
47 //.............................................................................
48 namespace chart
49 {
50 //.............................................................................
51 
52 class LightButton : public ImageButton
53 {
54 public:
55     LightButton( Window* pParent, const ResId& rResId, sal_Int32 nLightNumber );
56     virtual ~LightButton();
57 
58     void switchLightOn(bool bOn);
59     bool isLightOn() const;
60 
61 private:
62     bool m_bLightOn;
63 };
64 
65 class ColorButton : public ImageButton
66 {
67 public:
68     ColorButton( Window* pParent, const ResId& rResId );
69     virtual ~ColorButton();
70 };
71 
72 struct LightSourceInfo;
73 
74 class ThreeD_SceneIllumination_TabPage : public TabPage
75 {
76 public:
77     ThreeD_SceneIllumination_TabPage(
78         Window* pWindow,
79         const ::com::sun::star::uno::Reference<
80             ::com::sun::star::beans::XPropertySet > & xSceneProperties,
81         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel,
82         XColorTable* pColorTable=0 );
83 	virtual ~ThreeD_SceneIllumination_TabPage();
84 
85     // has to be called in case the dialog was closed with OK
86     void commitPendingChanges();
87 
88 private:
89     DECL_LINK( ClickLightSourceButtonHdl, LightButton* );
90     DECL_LINK( SelectColorHdl, ColorLB* );
91     DECL_LINK( ColorDialogHdl, Button* );
92     DECL_LINK( PreviewChangeHdl, void* );
93     DECL_LINK( PreviewSelectHdl, void* );
94 
95     void updatePreview();
96 
97 private:
98     DECL_LINK(fillControlsFromModel, void *);
99 
100     void applyLightSourceToModel( sal_uInt32 nLightNumber );
101     void applyLightSourcesToModel();
102 
103     FixedText   m_aFT_LightSource;
104 
105     LightButton m_aBtn_Light1;
106     LightButton m_aBtn_Light2;
107     LightButton m_aBtn_Light3;
108     LightButton m_aBtn_Light4;
109     LightButton m_aBtn_Light5;
110     LightButton m_aBtn_Light6;
111     LightButton m_aBtn_Light7;
112     LightButton m_aBtn_Light8;
113 
114     ColorLB     m_aLB_LightSource;
115     ColorButton m_aBtn_LightSource_Color;
116 
117     FixedText   m_aFT_AmbientLight;
118     ColorLB     m_aLB_AmbientLight;
119     ColorButton m_aBtn_AmbientLight_Color;
120 
121     SvxLightCtl3D   m_aCtl_Preview;
122 
123     LightSourceInfo* m_pLightSourceInfoList;
124 
125     ::com::sun::star::uno::Reference<
126             ::com::sun::star::beans::XPropertySet > m_xSceneProperties;
127 
128     TimerTriggeredControllerLock    m_aTimerTriggeredControllerLock;
129 
130     bool            m_bInCommitToModel;
131 
132     ModifyListenerCallBack m_aModelChangeListener;
133     ::com::sun::star::uno::Reference<
134         ::com::sun::star::frame::XModel >       m_xChartModel;
135 };
136 
137 //.............................................................................
138 } //namespace chart
139 //.............................................................................
140 
141 #endif
142