1 #ifndef __DALI_WATCH_TIME_H__
2 #define __DALI_WATCH_TIME_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 #include <dali/public-api/dali-core.h>
30 * @addtogroup dali_adaptor_framework
35 * @brief The WatchTime class is used to get time for the WatchApplication.
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.
42 class DALI_IMPORT_API WatchTime
59 * @brief Returns the current hour.
62 * @return The current hour
63 * @note The return value is always positive.
64 * @pre The WatchTime needs to be initialized.
69 * @brief Returns the current hour24.
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.
76 int GetHour24() const;
79 * @brief Returns the current minute.
82 * @return The current minute
83 * @note The return value is always positive.
84 * @pre The WatchTime needs to be initialized.
86 int GetMinute() const;
89 * @brief Returns the current second.
92 * @return The current second
93 * @note The return value is always positive.
94 * @pre The WatchTime needs to be initialized.
96 int GetSecond() const;
99 * @brief Returns the current millisecond.
102 * @return The current millisecond
103 * @note The return value is always positive.
104 * @pre The WatchTime needs to be initialized.
106 int GetMillisecond() const;
109 * @brief Returns the current year.
112 * @return The current year
113 * @note The return value is always positive.
114 * @pre The WatchTime needs to be initialized.
119 * @brief Returns the current month.
122 * @return The current month
123 * @note The return value is always positive.
124 * @pre The WatchTime needs to be initialized.
126 int GetMonth() const;
129 * @brief Returns the current day.
132 * @return The current day
133 * @note The return value is always positive.
134 * @pre The WatchTime needs to be initialized.
139 * @brief Returns the current day of week.
141 * @details The value returns from 1 (Sunday) to 7 (Saturday).
144 * @return The current day of week
145 * @note The return value is always positive.
146 * @pre The WatchTime needs to be initialized.
148 int GetDayOfWeek() const;
151 * @brief Returns the UTC time. (Coordinated Universal Time)
153 * @details Regarding struct tm (the return value), please refer to the site :
154 * http://www.cplusplus.com/reference/ctime/tm/
157 * @return The UTC time
158 * @pre The WatchTime needs to be initialized.
160 struct tm GetUtcTime() const;
163 * @brief Returns the UTC timestamp.
166 * @return The UTC timestamp
167 * @pre The WatchTime needs to be initialized.
169 time_t GetUtcTimeStamp() const;
172 * @brief Returns the ID of timezone.
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/
179 * @return The ID of timezone
180 * @pre The WatchTime needs to be initialized.
182 const char* GetTimeZone() const;
185 * @brief Returns the daylight saving time status.
188 * @return The Daylight Saving Time status
189 * @pre The WatchTime needs to be initialized.
191 bool GetDaylightSavingTimeStatus() const;
193 public: // Not intended for application developers
194 DALI_INTERNAL WatchTime(void *time_handle);
196 private: // Internal Data
207 #endif // __DALI_WATCH_TIME_H__