Add a watch_time_get_daylight_time_status API 25/118525/2 accepted/tizen/3.0/common/20170314.072632 accepted/tizen/3.0/ivi/20170314.004842 accepted/tizen/3.0/mobile/20170314.004730 accepted/tizen/3.0/tv/20170314.004747 accepted/tizen/3.0/wearable/20170314.004815 submit/tizen_3.0/20170313.052957
authorSunwook Bae <sunwook45.bae@samsung.com>
Mon, 8 Jun 2015 05:12:42 +0000 (14:12 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Mon, 13 Mar 2017 05:02:46 +0000 (14:02 +0900)
Signed-off-by: Sunwook Bae <sunwook45.bae@samsung.com>
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
Conflicts:
CMakeLists.txt
packaging/appcore-watch.spec

Change-Id: I14ad245d8656b38bf08580db4ca473829ff7de18

include/appcore-watch.h
include/watch_app_extension.h [new file with mode: 0755]
packaging/appcore-watch.spec
src/appcore-watch.c
src/watch_app_main.c

index 2b4645b..287af58 100755 (executable)
@@ -59,6 +59,7 @@ struct watch_time_s {
        int minute;
        int second;
        int millisecond;
+       int indaylight;
        time_t timestamp;
        char *timezone;
 };
diff --git a/include/watch_app_extension.h b/include/watch_app_extension.h
new file mode 100755 (executable)
index 0000000..773ad77
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __TIZEN_APPFW_WATCH_APP_EXTENSION_H__
+#define __TIZEN_APPFW_WATCH_APP_EXTENSION_H__
+
+#include <watch_app.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @brief Gets the daylight time status.
+ * @since_tizen 3.0
+ * @param[in] watch_time The watch_time handle
+ * @param[out] daylight The Daylight time status
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NONE Successful
+ */
+int watch_time_get_daylight_time_status(watch_time_h watch_time, bool *daylight);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_APPFW_WATCH_APP_EXTENSION_H__ */
index 94140e7..80fe760 100644 (file)
@@ -87,5 +87,6 @@ cp LICENSE %{buildroot}/usr/share/license/%{name}
 %files -n capi-appfw-watch-application-devel
 /usr/include/appcore-watch/watch_app.h
 /usr/include/appcore-watch/watch_app_efl.h
+/usr/include/appcore-watch/watch_app_extension.h
 /usr/lib/pkgconfig/capi-appfw-watch-application.pc
 
index cc93811..5cf60a1 100755 (executable)
@@ -818,6 +818,7 @@ static void __get_timeinfo(struct watch_time_s *timeinfo)
        timeinfo->minute = ucal_get(cal, UCAL_MINUTE, &status);
        timeinfo->second = ucal_get(cal, UCAL_SECOND, &status);
        timeinfo->millisecond = ucal_get(cal, UCAL_MILLISECOND, &status);
+       timeinfo->indaylight = ucal_inDaylightTime(cal, &status);
        timeinfo->timezone = timezone;
 
        timeinfo->hour -= (timeinfo->hour > 12) ? 12 : 0;
index be336c6..e334143 100755 (executable)
@@ -65,6 +65,7 @@ struct _watch_time_s {
        int minute;
        int second;
        int millisecond;
+       int indaylight;
        time_t timestamp;
        char *timezone;
 };
@@ -681,6 +682,19 @@ EXPORT_API int watch_time_get_time_zone(watch_time_h watch_time,
        return APP_ERROR_NONE;
 }
 
+EXPORT_API int watch_time_get_daylight_time_status(watch_time_h watch_time, bool *daylight)
+{
+       if (watch_time == NULL)
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+       if (watch_time->indaylight)
+               *daylight = true;
+       else
+               *daylight = false;
+
+       return APP_ERROR_NONE;
+}
+
 EXPORT_API int watch_app_get_elm_win(Evas_Object **win)
 {
        Evas_Object *ret_win;