1 #ifndef DALI_WATCH_TIME_H
2 #define DALI_WATCH_TIME_H
5 * Copyright (c) 2019 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.
23 #include <dali/public-api/dali-core.h>
26 #include <dali/public-api/dali-adaptor-common.h>
31 * @addtogroup dali_adaptor_framework
36 * @brief The WatchTime class is used to get time for the WatchApplication.
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.
43 class DALI_ADAPTOR_API WatchTime
60 * @brief Returns the current hour.
63 * @return The current hour
64 * @note The return value is always positive.
65 * @pre The WatchTime needs to be initialized.
70 * @brief Returns the current hour24.
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.
77 int GetHour24() const;
80 * @brief Returns the current minute.
83 * @return The current minute
84 * @note The return value is always positive.
85 * @pre The WatchTime needs to be initialized.
87 int GetMinute() const;
90 * @brief Returns the current second.
93 * @return The current second
94 * @note The return value is always positive.
95 * @pre The WatchTime needs to be initialized.
97 int GetSecond() const;
100 * @brief Returns the current millisecond.
103 * @return The current millisecond
104 * @note The return value is always positive.
105 * @pre The WatchTime needs to be initialized.
107 int GetMillisecond() const;
110 * @brief Returns the current year.
113 * @return The current year
114 * @note The return value is always positive.
115 * @pre The WatchTime needs to be initialized.
120 * @brief Returns the current month.
123 * @return The current month
124 * @note The return value is always positive.
125 * @pre The WatchTime needs to be initialized.
127 int GetMonth() const;
130 * @brief Returns the current day.
133 * @return The current day
134 * @note The return value is always positive.
135 * @pre The WatchTime needs to be initialized.
140 * @brief Returns the current day of week.
142 * @details The value returns from 1 (Sunday) to 7 (Saturday).
145 * @return The current day of week
146 * @note The return value is always positive.
147 * @pre The WatchTime needs to be initialized.
149 int GetDayOfWeek() const;
152 * @brief Returns the UTC time. (Coordinated Universal Time)
154 * @details Regarding struct tm (the return value), please refer to the site :
155 * http://www.cplusplus.com/reference/ctime/tm/
158 * @return The UTC time
159 * @pre The WatchTime needs to be initialized.
161 struct tm GetUtcTime() const;
164 * @brief Returns the UTC timestamp.
167 * @return The UTC timestamp
168 * @pre The WatchTime needs to be initialized.
170 time_t GetUtcTimeStamp() const;
173 * @brief Returns the ID of timezone.
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
180 * @return The ID of timezone
181 * @pre The WatchTime needs to be initialized.
183 const char* GetTimeZone() const;
186 * @brief Returns the daylight saving time status.
189 * @return The Daylight Saving Time status
190 * @pre The WatchTime needs to be initialized.
192 bool GetDaylightSavingTimeStatus() const;
194 public: // Not intended for application developers
195 DALI_INTERNAL WatchTime(void *time_handle);
197 private: // Internal Data
208 #endif // DALI_WATCH_TIME_H