1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
32 using Tizen.NUI.BaseComponents;
35 internal class Builder : BaseHandle
37 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
39 internal Builder(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Builder_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Builder obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
49 protected override void Dispose(DisposeTypes type)
56 if (type == DisposeTypes.Explicit)
59 //Release your own managed resources here.
60 //You should release all of your own disposable objects here.
64 //Release your own unmanaged resources here.
65 //You should not access any managed member here except static instance.
66 //because the execution order of Finalizes is non-deterministic.
69 if (swigCPtr.Handle != global::System.IntPtr.Zero)
74 NDalicPINVOKE.delete_Builder(swigCPtr);
76 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
84 public class QuitEventArgs : EventArgs
88 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89 private delegate void QuitEventCallbackDelegate();
90 private DaliEventHandler<object, QuitEventArgs> _builderQuitEventHandler;
91 private QuitEventCallbackDelegate _builderQuitEventCallbackDelegate;
93 public event DaliEventHandler<object, QuitEventArgs> Quit
99 // Restricted to only one listener
100 if (_builderQuitEventHandler == null)
102 _builderQuitEventHandler += value;
104 _builderQuitEventCallbackDelegate = new QuitEventCallbackDelegate(OnQuit);
105 this.QuitSignal().Connect(_builderQuitEventCallbackDelegate);
114 if (_builderQuitEventHandler != null)
116 this.QuitSignal().Disconnect(_builderQuitEventCallbackDelegate);
119 _builderQuitEventHandler -= value;
124 // Callback for Builder QuitSignal
125 private void OnQuit()
127 QuitEventArgs e = new QuitEventArgs();
129 if (_builderQuitEventHandler != null)
131 //here we send all data to user event handlers
132 _builderQuitEventHandler(this, e);
137 public void LoadFromFile(string fileName)
141 string json = System.IO.File.ReadAllText(fileName);
144 LoadFromString(json);
148 throw new global::System.InvalidOperationException("Failed to load file " + fileName);
152 catch (System.Exception e)
154 throw new global::System.InvalidOperationException("Failed to parse " + fileName);
160 public Builder() : this(NDalicPINVOKE.Builder_New(), true)
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public void LoadFromString(string data, Builder.UIFormat format)
167 NDalicPINVOKE.Builder_LoadFromString__SWIG_0(swigCPtr, data, (int)format);
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public void LoadFromString(string data)
173 NDalicPINVOKE.Builder_LoadFromString__SWIG_1(swigCPtr, data);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public void AddConstants(PropertyMap map)
179 NDalicPINVOKE.Builder_AddConstants(swigCPtr, PropertyMap.getCPtr(map));
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public void AddConstant(string key, PropertyValue value)
185 NDalicPINVOKE.Builder_AddConstant(swigCPtr, key, PropertyValue.getCPtr(value));
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public PropertyMap GetConstants()
191 PropertyMap ret = new PropertyMap(NDalicPINVOKE.Builder_GetConstants(swigCPtr), false);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public PropertyValue GetConstant(string key)
198 PropertyValue ret = new PropertyValue(NDalicPINVOKE.Builder_GetConstant(swigCPtr, key), false);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public Animation CreateAnimation(string animationName)
205 Animation ret = new Animation(NDalicPINVOKE.Builder_CreateAnimation__SWIG_0(swigCPtr, animationName), true);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 public Animation CreateAnimation(string animationName, PropertyMap map)
212 Animation ret = new Animation(NDalicPINVOKE.Builder_CreateAnimation__SWIG_1(swigCPtr, animationName, PropertyMap.getCPtr(map)), true);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 public Animation CreateAnimation(string animationName, View sourceActor)
219 Animation ret = new Animation(NDalicPINVOKE.Builder_CreateAnimation__SWIG_2(swigCPtr, animationName, View.getCPtr(sourceActor)), true);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224 public Animation CreateAnimation(string animationName, PropertyMap map, View sourceActor)
226 Animation ret = new Animation(NDalicPINVOKE.Builder_CreateAnimation__SWIG_3(swigCPtr, animationName, PropertyMap.getCPtr(map), View.getCPtr(sourceActor)), true);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 public BaseHandle Create(string templateName)
233 BaseHandle ret = new BaseHandle(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 public BaseHandle Create(string templateName, PropertyMap map)
240 BaseHandle ret = new BaseHandle(NDalicPINVOKE.Builder_Create__SWIG_1(swigCPtr, templateName, PropertyMap.getCPtr(map)), true);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 public BaseHandle CreateFromJson(string json)
247 BaseHandle ret = new BaseHandle(NDalicPINVOKE.Builder_CreateFromJson(swigCPtr, json), true);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 public bool ApplyStyle(string styleName, Animatable handle)
254 bool ret = NDalicPINVOKE.Builder_ApplyStyle(swigCPtr, styleName, Animatable.getCPtr(handle));
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 public bool ApplyFromJson(Animatable handle, string json)
261 bool ret = NDalicPINVOKE.Builder_ApplyFromJson(swigCPtr, Animatable.getCPtr(handle), json);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 public void AddViews(View toActor)
268 NDalicPINVOKE.Builder_AddActors__SWIG_0(swigCPtr, View.getCPtr(toActor));
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 public void AddViews(string sectionName, View toActor)
274 NDalicPINVOKE.Builder_AddActors__SWIG_1(swigCPtr, sectionName, View.getCPtr(toActor));
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 public void CreateRenderTask(string name)
280 NDalicPINVOKE.Builder_CreateRenderTask(swigCPtr, name);
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
284 internal FrameBufferImage GetFrameBufferImage(string name)
286 FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.Builder_GetFrameBufferImage(swigCPtr, name), true);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 public Path GetPath(string name)
293 Path ret = new Path(NDalicPINVOKE.Builder_GetPath(swigCPtr, name), true);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 internal PathConstrainer GetPathConstrainer(string pathConstrainerName)
300 PathConstrainer ret = new PathConstrainer(NDalicPINVOKE.Builder_GetPathConstrainer(swigCPtr, pathConstrainerName), true);
301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 internal LinearConstrainer GetLinearConstrainer(string linearConstrainerName)
307 LinearConstrainer ret = new LinearConstrainer(NDalicPINVOKE.Builder_GetLinearConstrainer(swigCPtr, linearConstrainerName), true);
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312 internal VoidSignal QuitSignal()
314 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Builder_QuitSignal(swigCPtr), false);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();