Revert "[Tizen] Add DALi Autofill implementation"
[platform/core/uifw/dali-adaptor.git] / dali / public-api / watch / watch-time.h
1 #ifndef DALI_WATCH_TIME_H
2 #define DALI_WATCH_TIME_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <time.h>
23 #include <dali/public-api/dali-core.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/dali-adaptor-common.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_adaptor_framework
32  * @{
33  */
34
35 /**
36  * @brief The WatchTime class is used to get time for the WatchApplication.
37  *
38  * A WatchTime has a time handle from watch application framework.
39  * You can get time(hour, minute, second, millisecond) and date(year, month, day)
40  * on receiving timeTick signal.
41  * @SINCE_1_1.37
42  */
43 class DALI_ADAPTOR_API WatchTime
44 {
45 public:
46
47   /**
48    * @brief Constructor.
49    * @SINCE_1_1.37
50    */
51   WatchTime();
52
53   /**
54    * @brief Destructor.
55    * @SINCE_1_1.37
56    */
57   ~WatchTime();
58
59   /**
60    * @brief Returns the current hour.
61    *
62    * @SINCE_1_1.37
63    * @return The current hour
64    * @note The return value is always positive.
65    * @pre The WatchTime needs to be initialized.
66    */
67   int GetHour() const;
68
69   /**
70    * @brief Returns the current hour24.
71    *
72    * @SINCE_1_1.37
73    * @return The current hour(the 24-hour clock)
74    * @note The return value is always positive.
75    * @pre The WatchTime needs to be initialized.
76    */
77   int GetHour24() const;
78
79   /**
80    * @brief Returns the current minute.
81    *
82    * @SINCE_1_1.37
83    * @return The current minute
84    * @note The return value is always positive.
85    * @pre The WatchTime needs to be initialized.
86    */
87   int GetMinute() const;
88
89   /**
90    * @brief Returns the current second.
91    *
92    * @SINCE_1_1.37
93    * @return The current second
94    * @note The return value is always positive.
95    * @pre The WatchTime needs to be initialized.
96    */
97   int GetSecond() const;
98
99   /**
100    * @brief Returns the current millisecond.
101    *
102    * @SINCE_1_2_32
103    * @return The current millisecond
104    * @note The return value is always positive.
105    * @pre The WatchTime needs to be initialized.
106    */
107   int GetMillisecond() const;
108
109   /**
110    * @brief Returns the current year.
111    *
112    * @SINCE_1_2_32
113    * @return The current year
114    * @note The return value is always positive.
115    * @pre The WatchTime needs to be initialized.
116    */
117   int GetYear() const;
118
119   /**
120    * @brief Returns the current month.
121    *
122    * @SINCE_1_2_32
123    * @return The current month
124    * @note The return value is always positive.
125    * @pre The WatchTime needs to be initialized.
126    */
127   int GetMonth() const;
128
129   /**
130    * @brief Returns the current day.
131    *
132    * @SINCE_1_2_32
133    * @return The current day
134    * @note The return value is always positive.
135    * @pre The WatchTime needs to be initialized.
136    */
137   int GetDay() const;
138
139   /**
140    * @brief Returns the current day of week.
141    *
142    * @details The value returns from 1 (Sunday) to 7 (Saturday).
143    *
144    * @SINCE_1_2_32
145    * @return The current day of week
146    * @note The return value is always positive.
147    * @pre The WatchTime needs to be initialized.
148    */
149   int GetDayOfWeek() const;
150
151   /**
152    * @brief Returns the UTC time. (Coordinated Universal Time)
153    *
154    * @details Regarding struct tm (the return value), please refer to the site :
155    * http://www.cplusplus.com/reference/ctime/tm/
156    *
157    * @SINCE_1_2_32
158    * @return The UTC time
159    * @pre The WatchTime needs to be initialized.
160    */
161   struct tm GetUtcTime() const;
162
163   /**
164    * @brief Returns the UTC timestamp.
165    *
166    * @SINCE_1_2_32
167    * @return The UTC timestamp
168    * @pre The WatchTime needs to be initialized.
169    */
170   time_t GetUtcTimeStamp() const;
171
172   /**
173    * @brief Returns the ID of timezone.
174    *
175    * @details The timezone ID, according to the IANA(Internet Assigned Numbers Authority)
176    * If you want to see more information, please refer to the site :
177    * https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
178    *
179    * @SINCE_1_2_32
180    * @return The ID of timezone
181    * @pre The WatchTime needs to be initialized.
182    */
183   const char* GetTimeZone() const;
184
185   /**
186    * @brief Returns the daylight saving time status.
187    *
188    * @SINCE_1_2_32
189    * @return The Daylight Saving Time status
190    * @pre The WatchTime needs to be initialized.
191    */
192   bool GetDaylightSavingTimeStatus() const;
193
194 public: // Not intended for application developers
195   DALI_INTERNAL WatchTime(void *time_handle);
196
197 private:  // Internal Data
198
199   struct Impl;
200   Impl* mImpl;
201 };
202
203 /**
204  * @}
205  */
206 } // namespace Dali
207
208 #endif // DALI_WATCH_TIME_H