appcore-common
appcore-efl
pkgmgr-info
+ capi-system-info
)
FOREACH(flag ${pkg_watch_CFLAGS})
SET(EXTRA_CFLAGS_watch "${EXTRA_CFLAGS_watch} ${flag}")
* - Registering callbacks for basic system events.
* - Time related utility APIs for watch applications.
*
+ * @section CAPI_WATCH_APP_MODULE_FEATURE Related Features
+ * This API is related with the following features:
+ * - http://tizen.org/feature/watch_app
+ * It is recommended to design feature related codes in your application for reliability.
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature Element</b>.</a>
+ *
* @subsection CAPI_WATCH_APP_MODULE_STATE_CHANGE_EVENT Registering Callbacks for Application State Change Events
* The state change events for Tizen watch application is similar to the Tizen UI applications. See the @ref CAPI_APPLICATION_MODULE.
* In Tizen watch application, an ambient changed event is added to support ambient mode. Time tick related events are also added to provide an exact time tick for the watch application.
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #APP_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see app_event_type_e
* @see app_event_cb
* @see watch_app_remove_event_handler
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see watch_app_add_event_handler
*/
int watch_app_remove_event_handler(app_event_handler_h event_handler);
* @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system.
* @retval #APP_ERROR_ALREADY_RUNNING The main loop has already started
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see watch_app_main()
* @see watch_app_create_cb()
* @see watch_app_control_cb()
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see watch_app_time_tick_resolution_e
* @see watch_app_get_time_tick_frequency()
*/
otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see watch_app_time_tick_resolution_e
* @see watch_app_set_time_tick_frequency()
*/
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see watch_app_ambient_tick_cb()
*/
int watch_app_set_ambient_tick_type(watch_app_ambient_tick_type_e type);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
* @see watch_app_ambient_tick_cb()
* @see watch_app_set_ambient_tick_type()
*/
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
* @retval #APP_ERROR_OUT_OF_MEMORY Out of Memory
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_current_time(watch_time_h *watch_time);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_delete(watch_time_h watch_time);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_year(watch_time_h watch_time, int *year);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_month(watch_time_h watch_time, int *month);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_day(watch_time_h watch_time, int *day);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_day_of_week(watch_time_h watch_time, int *day_of_week);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_hour(watch_time_h watch_time, int *hour);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_hour24(watch_time_h watch_time, int *hour24);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_minute(watch_time_h watch_time, int *minute);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_second(watch_time_h watch_time, int *second);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_millisecond(watch_time_h watch_time, int *millisecond);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_utc_time(watch_time_h watch_time, struct tm *utc_time);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_utc_timestamp(watch_time_h watch_time, time_t *utc_timestamp);
* otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_time_zone(watch_time_h watch_time, char **time_zone_id);
* @return 0 on success, otherwise a negative error value
* @retval #APP_ERROR_NONE Successful
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_dst_status(watch_time_h watch_time, bool *status);
* @retval #APP_ERROR_OUT_OF_MEMORY Out of memory
* @retval #APP_ERROR_INVALID_CONTEXT Watch app is not initialized properly
* @retval #APP_ERROR_NONE Successful
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_app_get_elm_win(Evas_Object **win);
* @return 0 on success, otherwise a negative error value
* @retval #APP_ERROR_INVALID_PARAMETER Invalid Parameter
* @retval #APP_ERROR_NONE Successful
+ * @retval #APP_ERROR_NOT_SUPPORTED Not supported
*/
int watch_time_get_daylight_time_status(watch_time_h watch_time, bool *daylight);
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(screen_connector_provider)
BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: cmake
Requires: amd-mod-watch
appcore_efl_base_ops ops = appcore_efl_base_get_default_ops();
char *viewer_visibility_str = NULL;
+ CHECK_WATCH_APP_FEATURE();
+
/* override methods */
ops.ui_base.base.create = __on_create;
ops.ui_base.base.control = __on_control;
{
app_event_handler_h handler;
+ CHECK_WATCH_APP_FEATURE();
+
if (event_handler == NULL || callback == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
int ret;
app_event_type_e type;
+ CHECK_WATCH_APP_FEATURE();
+
if (event_handler == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
{
struct _watch_time_s *time_info;
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_delete(watch_time_h watch_time)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_year(watch_time_h watch_time, int *year)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_month(watch_time_h watch_time, int *month)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_day(watch_time_h watch_time, int *day)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_day_of_week(watch_time_h watch_time,
int *day_of_week)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_hour(watch_time_h watch_time, int *hour)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_hour24(watch_time_h watch_time, int *hour24)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_minute(watch_time_h watch_time, int *minute)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_second(watch_time_h watch_time, int *second)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_millisecond(watch_time_h watch_time,
int *millisecond)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
{
time_t timestamp;
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL || utc_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_utc_timestamp(watch_time_h watch_time,
time_t *utc_timestamp)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_time_get_time_zone(watch_time_h watch_time,
char **time_zone_id)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL || watch_time->timezone == NULL
|| time_zone_id == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
EXPORT_API int watch_time_get_dst_status(watch_time_h watch_time, bool *status)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (watch_time == NULL || status == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
EXPORT_API int watch_time_get_daylight_time_status(watch_time_h watch_time, bool *daylight)
{
+ CHECK_WATCH_APP_FEATURE();
+
return watch_time_get_dst_status(watch_time, daylight);
}
Ecore_Wl_Window *wl_win;
char buffer[256];
+ CHECK_WATCH_APP_FEATURE();
+
if (win == NULL)
return watch_app_error(APP_ERROR_INVALID_PARAMETER,
__FUNCTION__, NULL);
EXPORT_API int watch_app_set_ambient_tick_type(watch_app_ambient_tick_type_e type)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (type < WATCH_APP_AMBIENT_TICK_NO_TICK || type > WATCH_APP_AMBIENT_TICK_EVERY_DAY)
return APP_ERROR_INVALID_PARAMETER;
return __set_ambient_tick_type(type);
EXPORT_API int watch_app_get_ambient_tick_type(watch_app_ambient_tick_type_e *type)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (type == NULL)
return APP_ERROR_INVALID_PARAMETER;
return __get_ambient_tick_type(type);
EXPORT_API int watch_app_set_time_tick_frequency(int ticks, watch_app_time_tick_resolution_e type)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (type < WATCH_APP_TIME_TICKS_PER_SECOND || type > WATCH_APP_TIME_TICKS_PER_HOUR)
return APP_ERROR_INVALID_PARAMETER;
return __set_time_tick_frequency(ticks, type);
EXPORT_API int watch_app_get_time_tick_frequency(int *ticks, watch_app_time_tick_resolution_e *type)
{
+ CHECK_WATCH_APP_FEATURE();
+
if (type == NULL || ticks == NULL)
return APP_ERROR_INVALID_PARAMETER;
return __get_time_tick_frequency(ticks, type);
#include <watch_app.h>
#include <app_common.h>
+#include <system_info.h>
#ifdef __cplusplus
extern "C" {
#endif
+#define WATCH_APP_FEATURE "http://tizen.org/feature/watch_app"
+#define CHECK_WATCH_APP_FEATURE() \
+ do { \
+ bool is_supported = false; \
+ if (!system_info_get_platform_bool(WATCH_APP_FEATURE, &is_supported)) { \
+ if (is_supported == false) { \
+ LOGE("[%s] feature is disabled", WATCH_APP_FEATURE); \
+ return APP_ERROR_NOT_SUPPORTED; \
+ } \
+ } \
+ } while (0)
+
int watch_app_error(app_error_e error, const char *function,
const char *description);