[NUI] Fix to disable ThemeManager in tv profile
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Application / 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.NewWatchTime(), 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 WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr)
193         {
194             WatchTime ret = new WatchTime(cPtr, false);
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196             return ret;
197         }
198
199         internal int GetDayOfWeek()
200         {
201             int ret = Interop.Watch.WatchTimeGetDayOfWeek(SwigCPtr);
202             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203             return ret;
204         }
205
206         internal SWIGTYPE_p_tm GetUtcTime()
207         {
208             SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(Interop.Watch.WatchTimeGetUtcTime(SwigCPtr));
209             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210             return ret;
211         }
212
213         internal SWIGTYPE_p_time_t GetUtcTimeStamp()
214         {
215             SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(Interop.Watch.WatchTimeGetUtcTimeStamp(SwigCPtr));
216             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217             return ret;
218         }
219
220         internal string GetTimeZone()
221         {
222             string ret = Interop.Watch.WatchTimeGetTimeZone(SwigCPtr);
223             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224             return ret;
225         }
226
227         internal bool GetDaylightSavingTimeStatus()
228         {
229             bool ret = Interop.Watch.WatchTimeGetDaylightSavingTimeStatus(SwigCPtr);
230             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231             return ret;
232         }
233
234         internal int GetHour()
235         {
236             int ret = Interop.Watch.WatchTimeGetHour(SwigCPtr);
237             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238             return ret;
239         }
240
241         internal int GetHour24()
242         {
243             int ret = Interop.Watch.WatchTimeGetHour24(SwigCPtr);
244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245             return ret;
246         }
247
248         internal int GetMinute()
249         {
250             int ret = Interop.Watch.WatchTimeGetMinute(SwigCPtr);
251             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             return ret;
253         }
254
255         internal int GetSecond()
256         {
257             int ret = Interop.Watch.WatchTimeGetSecond(SwigCPtr);
258             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259             return ret;
260         }
261
262         internal int GetMillisecond()
263         {
264             int ret = Interop.Watch.WatchTimeGetMillisecond(SwigCPtr);
265             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266             return ret;
267         }
268
269         internal int GetYear()
270         {
271             int ret = Interop.Watch.WatchTimeGetYear(SwigCPtr);
272             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273             return ret;
274         }
275
276         internal int GetMonth()
277         {
278             int ret = Interop.Watch.WatchTimeGetMonth(SwigCPtr);
279             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280             return ret;
281         }
282
283         internal int GetDay()
284         {
285             int ret = Interop.Watch.WatchTimeGetDay(SwigCPtr);
286             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287             return ret;
288         }
289
290         /// This will not be public opened.
291         [EditorBrowsable(EditorBrowsableState.Never)]
292         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
293         {
294             Interop.Watch.DeleteWatchTime(swigCPtr);
295         }
296     }
297 }