Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / effects / inc / FUiEffects_RuntimeIEffectModelScript.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FUiEffects_RuntimeIEffectModelScript.h
19  * @brief       This is the header file for the IEffectModelScript class.
20  */
21
22 #ifndef _FUI_EFFECTS_INTERNAL_RUNTIME_IEFFECT_MODEL_SCRIPT_H_
23 #define _FUI_EFFECTS_INTERNAL_RUNTIME_IEFFECT_MODEL_SCRIPT_H_
24
25 #include "utils/FUiEffects_Utils.h"
26
27 namespace _Utils { template<class T> class LuaMat4; }
28
29 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
30 {
31
32 class UnitLight;
33
34 /**
35  * @class       IEffectModelScript
36  * @brief       This class is an interface between ScriptProcessing and EffectModel –
37  *                      API for EffectModel access from user's scripts
38  *
39  * @since 2.0
40  *
41  */
42 class IEffectModelScript
43 {
44
45 public:
46         /**
47          * Class destructor
48          *
49          * @since 2.0
50          *
51          */
52         virtual ~IEffectModelScript(void)
53         {
54         }
55
56         /**
57          * Called by ScriptProcessing to modify the element's property of boolean type
58          *
59          * @since 2.0
60          *
61          */
62         virtual bool ScriptSetProperty(long objID, ElementProperty property, bool value) = 0;
63
64         /**
65          * Called by ScriptProcessing to modify the element's property of lua_Number type
66          * (floating point or integer)
67          *
68          * @since 2.0
69          *
70          */
71         virtual bool ScriptSetProperty(long objID, ElementProperty property, LUA_NUMBER value) = 0;
72
73         /**
74          * Called by ScriptProcessing to modify the element's property of Vec3f type
75          *
76          * @since 2.0
77          *
78          */
79         virtual bool ScriptSetProperty(long objID, ElementProperty property, const Tizen::Ui::Effects::_Utils::Vec3f &value) = 0;
80
81         /**
82          * Called by ScriptProcessing to modify some group of elements
83          * for specified model surface
84          *
85          * @since 2.0
86          *
87          */
88         virtual bool ScriptSetPropertyGroup(long modelSurfaceID, GroupElements group, ElementProperty property, LUA_NUMBER value) = 0;
89
90         /**
91          * Called by ScriptProcessing to get distance from ground for model surface
92          *
93          * @since 2.0
94          *
95          */
96         virtual PropertyCast ScriptGetDistanceFromGround(long modelSurfaceID) const = 0;
97
98         /**
99          * Called by ScriptProcessing to get the element's property of any type,
100          * specified in class PropertyCast
101          *
102          * @since 2.0
103          *
104          */
105         virtual PropertyCast ScriptGetProperty(long objID, ElementProperty property) const = 0;
106
107         /**
108          * Called by ScriptProcessing to modify bitmap resource
109          *
110          * @since 2.0
111          *
112          */
113         virtual bool ScriptUpdateBitmap(long graphicalSurfaceID, long bitmapID) = 0;
114
115         /**
116          * Called by ScriptProcessing to get the IDs of vector of vectors of nearest points for specified GraphicalSurface
117          *
118          * @since 2.0
119          *
120          */
121         virtual PropertyCast ScriptGetNearestPointsIds(long graphicalSurfaceID, Tizen::Ui::Effects::_Utils::Vec3f &position) const = 0;
122
123         /**
124          * Called by ScriptProcessing to modify model matrix (rotation)
125          *
126          * @since 2.0
127          *
128          */
129         virtual bool ScriptRotateSurface(long graphicalSurfaceID, float angle, _Axis axis, _Point point,
130                                                                          float ax, float ay, float az, float x0, float y0, float z0) = 0;
131
132         /**
133          * Called by ScriptProcessing to modify model matrix (scaling)
134          *
135          * @since 2.0
136          *
137          */
138         virtual bool ScriptScaleSurface(long graphicalSurfaceID, float ax, float ay, float az, _Point point,
139                                                                         float x0, float y0, float z0) = 0;
140
141         /**
142          * Called by ScriptProcessing to modify model matrix (translating)
143          *
144          * @since 2.0
145          *
146          */
147         virtual bool ScriptMoveSurface(long graphicalSurfaceID, float x0, float y0, float z0) = 0;
148
149         /**
150          * Called by ScriptProcessing to modify model matrix (sets identity matrix)
151          *
152          * @since 2.0
153          *
154          */
155         virtual bool ScriptResetSurfaceTransformation(long graphicalSurfaceID) = 0;
156
157         /**
158          * Called by ScriptProcessing to modify model matrix
159          *
160          * @since 2.0
161          *
162          */
163         virtual bool ScriptSetTransformationMatrix(long graphicalSurfaceID, const Tizen::Ui::Effects::_Utils::LuaMatrix4& luaMatrix4) = 0;
164
165         /**
166          * Adds new unit light to scene
167          *
168          * @since 2.0
169          *
170          * @remarks             Returns true if addition was succeeded and false otherwise
171          */
172         virtual bool ScriptAddUnitLight(UnitLight& unitLight) = 0;
173
174         /**
175          * Excludes specified unit light from scene with using unique name of it
176          *
177          * @since 2.0
178          *
179          * @remarks             Returns true if addition was succeeded and false otherwise
180          */
181         virtual bool ScriptRemoveUnitLight(const std::string& name) = 0;
182
183         /**
184          * Excludes all units light of specified type from scene
185          *
186          * @since 2.0
187          *
188          * @remarks             Returns true if addition was succeeded and false otherwise
189          */
190         virtual bool ScriptRemoveAllUnitsLightType(TypeUnitLight typeUnitLight) = 0;
191
192         /**
193          * Returns specified unit light with using unique name of it
194          *
195          * @since 2.0
196          *
197          */
198         virtual PropertyCast ScriptGetUnitLight(const std::string& name) const = 0;
199
200         /**
201          * Sets ambient colour for scene
202          *
203          * @since 2.0
204          *
205          */
206         virtual void ScriptSetLightAmbientColour(const Tizen::Ui::Effects::_Utils::Vec3f& ambientColour) = 0;
207
208         /**
209          * Sets ambient colour for scene
210          *
211          * @since 2.0
212          *
213          */
214         virtual void ScriptSetLightAmbientColour(float red, float green, float blue) = 0;
215
216         /**
217          * Sets light intensity for scene
218          *
219          * @since 2.0
220          *
221          */
222         virtual void ScriptSetLightIntensity(float intensity) = 0;
223
224         /**
225          * Sets attenuation for units light on scene
226          *
227          * @since 2.0
228          *
229          */
230         virtual void ScriptSetLightAttenuation(float attenuation) = 0;
231
232         /**
233          * Returns ambient colour of scene
234          *
235          * @since 2.0
236          *
237          */
238         virtual const Tizen::Ui::Effects::_Utils::Vec3f& ScriptGetLightAmbientColour(void) const = 0;
239
240         /**
241          * Returns light intensity of scene
242          *
243          * @since 2.0
244          *
245          */
246         virtual float ScriptGetLightIntensity(void) const = 0;
247
248         /**
249          * Returns attenuation for units light on scene
250          *
251          * @since 2.0
252          *
253          */
254         virtual float ScriptGetLightAttenuation(void) const = 0;
255
256 }; // IEffectModelScript
257
258 } } } } // Tizen::Ui::Effects::_Runtime
259
260 #endif //_FUI_EFFECTS_INTERNAL_RUNTIME_IEFFECT_MODEL_SCRIPT_H_