9caf62eced08b2acd40a7f29ea1fc1e540bf63e5
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / Timer.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.\r
2 *\r
3 * Licensed under the Apache License, Version 2.0 (the "License");\r
4 * you may not use this file except in compliance with the License.\r
5 * You may obtain a copy of the License at\r
6 *\r
7 * http://www.apache.org/licenses/LICENSE-2.0\r
8 *\r
9 * Unless required by applicable law or agreed to in writing, software\r
10 * distributed under the License is distributed on an "AS IS" BASIS,\r
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
12 * See the License for the specific language governing permissions and\r
13 * limitations under the License.\r
14 *\r
15 */\r
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts\r
17 //------------------------------------------------------------------------------\r
18 // <auto-generated />\r
19 //\r
20 // This file was automatically generated by SWIG (http://www.swig.org).\r
21 // Version 3.0.9\r
22 //\r
23 // Do not make changes to this file unless you know what you are doing--modify\r
24 // the SWIG interface file instead.\r
25 //------------------------------------------------------------------------------\r
26 \r
27 namespace Tizen.NUI\r
28 {\r
29 \r
30     public class Timer : BaseHandle\r
31     {\r
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;\r
33 \r
34         internal Timer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Timer_SWIGUpcast(cPtr), cMemoryOwn)\r
35         {\r
36             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);\r
37         }\r
38 \r
39         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Timer obj)\r
40         {\r
41             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;\r
42         }\r
43 \r
44         ~Timer()\r
45         {\r
46             DisposeQueue.Instance.Add(this);\r
47         }\r
48 \r
49         public override void Dispose()\r
50         {\r
51             if (!Stage.IsInstalled())\r
52             {\r
53                 DisposeQueue.Instance.Add(this);\r
54                 return;\r
55             }\r
56 \r
57             lock (this)\r
58             {\r
59                 if (swigCPtr.Handle != global::System.IntPtr.Zero)\r
60                 {\r
61                     if (swigCMemOwn)\r
62                     {\r
63                         swigCMemOwn = false;\r
64                         NDalicPINVOKE.delete_Timer(swigCPtr);\r
65                     }\r
66                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);\r
67                 }\r
68                 global::System.GC.SuppressFinalize(this);\r
69                 base.Dispose();\r
70             }\r
71         }\r
72 \r
73 \r
74         public Timer(uint milliSec) : this(NDalicPINVOKE.Timer_New(milliSec), true)\r
75         {\r
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
77 \r
78         }\r
79         internal Timer(Timer timer) : this(NDalicPINVOKE.new_Timer__SWIG_1(Timer.getCPtr(timer)), true)\r
80         {\r
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
82         }\r
83 \r
84         internal Timer Assign(Timer timer)\r
85         {\r
86             Timer ret = new Timer(NDalicPINVOKE.Timer_Assign(swigCPtr, Timer.getCPtr(timer)), false);\r
87             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
88             return ret;\r
89         }\r
90 \r
91         public static Timer DownCast(BaseHandle handle)\r
92         {\r
93             Timer ret = new Timer(NDalicPINVOKE.Timer_DownCast(BaseHandle.getCPtr(handle)), true);\r
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
95             return ret;\r
96         }\r
97 \r
98         public void Start()\r
99         {\r
100             NDalicPINVOKE.Timer_Start(swigCPtr);\r
101             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
102         }\r
103 \r
104         public void Stop()\r
105         {\r
106             NDalicPINVOKE.Timer_Stop(swigCPtr);\r
107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
108         }\r
109 \r
110         public uint Interval\r
111         {\r
112             set\r
113             {\r
114                 SetInterval(value);\r
115             }\r
116             get\r
117             {\r
118                 return GetInterval();\r
119             }\r
120         }\r
121 \r
122         internal void SetInterval(uint milliSec)\r
123         {\r
124             NDalicPINVOKE.Timer_SetInterval(swigCPtr, milliSec);\r
125             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
126         }\r
127 \r
128         internal uint GetInterval()\r
129         {\r
130             uint ret = NDalicPINVOKE.Timer_GetInterval(swigCPtr);\r
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
132             return ret;\r
133         }\r
134 \r
135         public bool Running\r
136         {\r
137             get\r
138             {\r
139                 return IsRunning();\r
140             }\r
141         }\r
142 \r
143         internal bool IsRunning()\r
144         {\r
145             bool ret = NDalicPINVOKE.Timer_IsRunning(swigCPtr);\r
146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
147             return ret;\r
148         }\r
149 \r
150         internal BoolSignal TickSignal()\r
151         {\r
152             BoolSignal ret = new BoolSignal(NDalicPINVOKE.Timer_TickSignal(swigCPtr), false);\r
153             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
154             return ret;\r
155         }\r
156 \r
157     }\r
158 \r
159 }\r