Merge "Set proper locale to harfbuzz" into devel/master
[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) 2016 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
24 // INTERNAL INCLUDES
25 #include <dali/public-api/dali-core.h>
26
27 namespace Dali
28 {
29 /**
30  * @addtogroup dali_adaptor_framework
31  * @{
32  */
33
34 /**
35  * @brief The WatchTime class is used to get time for the WatchApplication.
36  *
37  * A WatchTime has a time handle from watch application framework.
38  * You can get time(hour, minute, second, millisecond) and date(year, month, day)
39  * on receiving timeTick signal.
40  * @SINCE_1_1.37
41  */
42 class DALI_IMPORT_API WatchTime
43 {
44 public:
45
46   /**
47    * @brief Constructor.
48    * @SINCE_1_1.37
49    */
50   WatchTime();
51
52   /**
53    * @brief Destructor.
54    * @SINCE_1_1.37
55    */
56   ~WatchTime();
57
58   /**
59    * @brief Returns the current hour.
60    *
61    * @SINCE_1_1.37
62    * @return The current hour
63    * @note The return value is always positive.
64    * @pre The WatchTime needs to be initialized.
65    */
66   int GetHour() const;
67
68   /**
69    * @brief Returns the current hour24.
70    *
71    * @SINCE_1_1.37
72    * @return The current hour(the 24-hour clock)
73    * @note The return value is always positive.
74    * @pre The WatchTime needs to be initialized.
75    */
76   int GetHour24() const;
77
78   /**
79    * @brief Returns the current minute.
80    *
81    * @SINCE_1_1.37
82    * @return The current minute
83    * @note The return value is always positive.
84    * @pre The WatchTime needs to be initialized.
85    */
86   int GetMinute() const;
87
88   /**
89    * @brief Returns the current second.
90    *
91    * @SINCE_1_1.37
92    * @return The current second
93    * @note The return value is always positive.
94    * @pre The WatchTime needs to be initialized.
95    */
96   int GetSecond() const;
97
98   /**
99    * @brief Returns the current millisecond.
100    *
101    * @SINCE_1_2_32
102    * @return The current millisecond
103    * @note The return value is always positive.
104    * @pre The WatchTime needs to be initialized.
105    */
106   int GetMillisecond() const;
107
108   /**
109    * @brief Returns the current year.
110    *
111    * @SINCE_1_2_32
112    * @return The current year
113    * @note The return value is always positive.
114    * @pre The WatchTime needs to be initialized.
115    */
116   int GetYear() const;
117
118   /**
119    * @brief Returns the current month.
120    *
121    * @SINCE_1_2_32
122    * @return The current month
123    * @note The return value is always positive.
124    * @pre The WatchTime needs to be initialized.
125    */
126   int GetMonth() const;
127
128   /**
129    * @brief Returns the current day.
130    *
131    * @SINCE_1_2_32
132    * @return The current day
133    * @note The return value is always positive.
134    * @pre The WatchTime needs to be initialized.
135    */
136   int GetDay() const;
137
138   /**
139    * @brief Returns the current day of week.
140    *
141    * @details The value returns from 1 (Sunday) to 7 (Saturday).
142    *
143    * @SINCE_1_2_32
144    * @return The current day of week
145    * @note The return value is always positive.
146    * @pre The WatchTime needs to be initialized.
147    */
148   int GetDayOfWeek() const;
149
150   /**
151    * @brief Returns the UTC time. (Coordinated Universal Time)
152    *
153    * @details Regarding struct tm (the return value), please refer to the site :
154    * http://www.cplusplus.com/reference/ctime/tm/
155    *
156    * @SINCE_1_2_32
157    * @return The UTC time
158    * @pre The WatchTime needs to be initialized.
159    */
160   struct tm GetUtcTime() const;
161
162   /**
163    * @brief Returns the UTC timestamp.
164    *
165    * @SINCE_1_2_32
166    * @return The UTC timestamp
167    * @pre The WatchTime needs to be initialized.
168    */
169   time_t GetUtcTimeStamp() const;
170
171   /**
172    * @brief Returns the ID of timezone.
173    *
174    * @details The timezone ID, according to the IANA(Internet Assigned Numbers Authority)
175    * If you want to see more information, please refer to the site :
176    * https://en.wikipedia.org/wiki/List_of_tz_database_time_zones/
177    *
178    * @SINCE_1_2_32
179    * @return The ID of timezone
180    * @pre The WatchTime needs to be initialized.
181    */
182   const char* GetTimeZone() const;
183
184   /**
185    * @brief Returns the daylight saving time status.
186    *
187    * @SINCE_1_2_32
188    * @return The Daylight Saving Time status
189    * @pre The WatchTime needs to be initialized.
190    */
191   bool GetDaylightSavingTimeStatus() const;
192
193 public: // Not intended for application developers
194   DALI_INTERNAL WatchTime(void *time_handle);
195
196 private:  // Internal Data
197
198   struct Impl;
199   Impl* mImpl;
200 };
201
202 /**
203  * @}
204  */
205 } // namespace Dali
206
207 #endif // __DALI_WATCH_TIME_H__