Support TranslatablePlaceholderTextFocused to TextField
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / WatchTime.cs
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// The WatchTime class is used to get time for the WatchApplication.<br/>
23     /// A WatchTime has a time handle from watch application framework.<br/>
24     /// You can get time(hour, minute, second, millisecond) and date(year, month, day)<br/>
25     /// on receiving timeTick signal.
26     /// </summary>
27     /// <since_tizen> 4 </since_tizen>
28     public class WatchTime : Disposable
29     {
30
31         /// <summary>
32         /// Constructor.
33         /// </summary>
34         /// <since_tizen> 4 </since_tizen>
35         public WatchTime() : this(Interop.Watch.new_WatchTime(), true)
36         {
37             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
38         }
39
40         internal WatchTime(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
41         {
42         }
43
44         /// <summary>
45         /// Get the current hour.
46         /// </summary>
47         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
48         /// <since_tizen> 4 </since_tizen>
49         public int Hour
50         {
51             get
52             {
53                 return GetHour();
54             }
55         }
56
57         /// <summary>
58         /// Get the current hour24.
59         /// </summary>
60         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
61         /// <since_tizen> 4 </since_tizen>
62         public int Hour24
63         {
64             get
65             {
66                 return GetHour24();
67             }
68         }
69
70         /// <summary>
71         /// Get the current minute.
72         /// </summary>
73         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
74         /// <since_tizen> 4 </since_tizen>
75         public int Minute
76         {
77             get
78             {
79                 return GetMinute();
80             }
81         }
82
83         /// <summary>
84         /// Get the current second.
85         /// </summary>
86         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
87         /// <since_tizen> 4 </since_tizen>
88         public int Second
89         {
90             get
91             {
92                 return GetSecond();
93             }
94         }
95
96         /// <summary>
97         /// Get the current millisecond.
98         /// </summary>
99         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
100         /// <since_tizen> 4 </since_tizen>
101         public int Millisecond
102         {
103             get
104             {
105                 return GetMillisecond();
106             }
107         }
108
109         /// <summary>
110         /// Get the current year.
111         /// </summary>
112         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
113         /// <since_tizen> 4 </since_tizen>
114         public int Year
115         {
116             get
117             {
118                 return GetYear();
119             }
120         }
121
122         /// <summary>
123         /// Get the current month.
124         /// </summary>
125         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
126         /// <since_tizen> 4 </since_tizen>
127         public int Month
128         {
129             get
130             {
131                 return GetMonth();
132             }
133         }
134
135         /// <summary>
136         /// Get the current day.
137         /// </summary>
138         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
139         /// <since_tizen> 4 </since_tizen>
140         public int Day
141         {
142             get
143             {
144                 return GetDay();
145             }
146         }
147
148         /// <summary>
149         /// Get the current week.
150         /// </summary>
151         /// <remarks>The return value is always positive.The WatchTime needs to be initialized.</remarks>
152         /// <since_tizen> 4 </since_tizen>
153         public int DayOfWeek
154         {
155             get
156             {
157                 return GetDayOfWeek();
158             }
159         }
160
161         /// <summary>
162         /// Get the ID of timezone.
163         /// </summary>
164         /// <remarks>
165         /// The WatchTime needs to be initialized.<br/>
166         /// The timezone ID, according to the IANA(Internet Assigned Numbers Authority)<br/>
167         /// If you want to see more information, please refer to the site :<br/>
168         /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones/
169         /// </remarks>
170         /// <since_tizen> 4 </since_tizen>
171         public string TimeZone
172         {
173             get
174             {
175                 return GetTimeZone();
176             }
177         }
178
179         /// <summary>
180         /// Get the daylight saving time status.
181         /// </summary>
182         /// <remarks>The WatchTime needs to be initialized.</remarks>
183         /// <since_tizen> 4 </since_tizen>
184         public bool DaylightSavingTimeStatus
185         {
186             get
187             {
188                 return GetDaylightSavingTimeStatus();
189             }
190         }
191
192         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchTime obj)
193         {
194             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
195         }
196
197         internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr)
198         {
199             WatchTime ret = new WatchTime(cPtr, false);
200             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201             return ret;
202         }
203
204         internal int GetDayOfWeek()
205         {
206             int ret = Interop.Watch.WatchTime_GetDayOfWeek(swigCPtr);
207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208             return ret;
209         }
210
211         internal SWIGTYPE_p_tm GetUtcTime()
212         {
213             SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(Interop.Watch.WatchTime_GetUtcTime(swigCPtr), true);
214             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215             return ret;
216         }
217
218         internal SWIGTYPE_p_time_t GetUtcTimeStamp()
219         {
220             SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(Interop.Watch.WatchTime_GetUtcTimeStamp(swigCPtr), true);
221             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222             return ret;
223         }
224
225         internal string GetTimeZone()
226         {
227             string ret = Interop.Watch.WatchTime_GetTimeZone(swigCPtr);
228             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229             return ret;
230         }
231
232         internal bool GetDaylightSavingTimeStatus()
233         {
234             bool ret = Interop.Watch.WatchTime_GetDaylightSavingTimeStatus(swigCPtr);
235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236             return ret;
237         }
238
239         internal int GetHour()
240         {
241             int ret = Interop.Watch.WatchTime_GetHour(swigCPtr);
242             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243             return ret;
244         }
245
246         internal int GetHour24()
247         {
248             int ret = Interop.Watch.WatchTime_GetHour24(swigCPtr);
249             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250             return ret;
251         }
252
253         internal int GetMinute()
254         {
255             int ret = Interop.Watch.WatchTime_GetMinute(swigCPtr);
256             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257             return ret;
258         }
259
260         internal int GetSecond()
261         {
262             int ret = Interop.Watch.WatchTime_GetSecond(swigCPtr);
263             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264             return ret;
265         }
266
267         internal int GetMillisecond()
268         {
269             int ret = Interop.Watch.WatchTime_GetMillisecond(swigCPtr);
270             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271             return ret;
272         }
273
274         internal int GetYear()
275         {
276             int ret = Interop.Watch.WatchTime_GetYear(swigCPtr);
277             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278             return ret;
279         }
280
281         internal int GetMonth()
282         {
283             int ret = Interop.Watch.WatchTime_GetMonth(swigCPtr);
284             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285             return ret;
286         }
287
288         internal int GetDay()
289         {
290             int ret = Interop.Watch.WatchTime_GetDay(swigCPtr);
291             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292             return ret;
293         }
294
295         /// This will not be public opened.
296         [EditorBrowsable(EditorBrowsableState.Never)]
297         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
298         {
299             Interop.Watch.delete_WatchTime(swigCPtr);
300         }
301     }
302 }