--- /dev/null
+/*
+ * Copyright (c) 2018 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 __WATCHFACE_COMPLICATION_DOC_H__
+#define __WATCHFACE_COMPLICATION_DOC_H__
+
+/**
+ * @ingroup CAPI_APPLICATION_FRAMEWORK
+ * @defgroup WATCHFACE_COMPLICATION_MODULE Watchface complication
+ * @brief The watchface complication provides feature to receive and request watchface complication data.
+ * It also provides editable management feature to request edit for complication and design elements to editor.
+ * @section WATCHFACE_COMPLICATION_MODULE_HEADER Required Header
+ * \#include <watchface-complication.h>
+ * \#include <watchface-editable.h>
+ *
+ * @section WATCHFACE_COMPLICATION_MODULE_OVERVIEW Overview
+ * The watch applications can request data shared by other watchface complication provider applications using watchface complication.
+ * And the watchface complication provider application can share data with watchface application using watchface complication.
+ * However, only service applications can provide their own data to the watch applicaiton.
+ * The watch application also can request editing about their resources like complication and design elements to editor using watchface complication. *
+ *
+ * @section WATCHFACE_COMPLICATION_MODULE_FEATURE Related Features
+ * This API is related with the following features:
+ * - http://tizen.org/feature/watch_app
+ * 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>
+ */
+
+/**
+ * @ingroup WATCHFACE_COMPLICATION_MODULE
+ * @defgroup WATCHFACE_COMPLICATION_COMPLICATION_MODULE Watchface complication
+ * @brief All watch applications can request data shared by other watchface complication provider applications using watchface complication.
+ * @section WATCHFACE_COMPLICATION_COMPLICATION_MODULE_HEADER Required Header
+ * \#include <watchface-complication.h>
+ *
+ * @section WATCHFACE_COMPLICATION_COMPLICATION_MODULE_OVERVIEW Overview
+ * It provides watchface complication data request and receive service.
+ */
+
+/**
+ * @ingroup WATCHFACE_COMPLICATION_MODULE
+ * @defgroup WATCHFACE_COMPLICATION_EDITABLE_MODULE Watchface editable
+ * @brief All watch applications can request editing for their resources like complication and design elements to editor using watchface editable.
+ * @section WATCHFACE_COMPLICATION_EDITABLE_MODULE_HEADER Required Header
+ * \#include <watchface-editable.h>
+ *
+ * @section WATCHFACE_COMPLICATION_EDITABLE_MODULE_OVERVIEW Overview
+ * It provides service that request editting watchface editable data to editor and receive result from editor.
+ */
+
+/**
+ * @ingroup WATCHFACE_COMPLICATION_MODULE
+ * @defgroup WATCHFACE_COMPLICATION_PROVIDER_MODULE Watchface complication provider
+ * @brief All service applications can receive data request from the watch application and sends data to the watchface application using watchface complication provider.
+ * @section WATCHFACE_COMPLICATION_PROVIDER_MODULE Required Header
+ * \#include <watchface-complication-provider.h>
+ *
+ * @section WATCHFACE_COMPLICATION_PROVIDER_MODULE_OVERVIEW Overview
+ * It provides service that receive requests and sends data to the watch application.
+ */
+
+#endif /* __WATCHFACE_COMPLICATION_DOC_H__ */
* limitations under the License.
*/
-#ifndef WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_COMMON_H_
-#define WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_COMMON_H_
+#ifndef __TIZEN_APPFW_WATCHFACE_COMMON_H__
+#define __TIZEN_APPFW_WATCHFACE_COMMON_H__
#include <tizen.h>
WATCHFACE_COMPLICATION_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
WATCHFACE_COMPLICATION_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No data available */
WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
WATCHFACE_COMPLICATION_ERROR_DB = TIZEN_ERROR_COMPLICATION | 0x1, /**< Database error */
WATCHFACE_COMPLICATION_ERROR_DBUS = TIZEN_ERROR_COMPLICATION | 0x2, /**< DBUS error */
WATCHFACE_COMPLICATION_ERROR_EDIT_NOT_READY = TIZEN_ERROR_COMPLICATION | 0x3, /**< Edit not ready */
WATCHFACE_COMPLICATION_ERROR_EXIST_ID = TIZEN_ERROR_COMPLICATION | 0x4, /**< ID already exist */
+ WATCHFACE_COMPLICATION_ERROR_NOT_EXIST = TIZEN_ERROR_COMPLICATION | 0x5, /**< Not exist */
} watchface_complication_error_e;
/**
}
#endif
-#endif // WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_COMMON_H_
+#endif /* __TIZEN_APPFW_WATCHFACE_COMMON_H__ */
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../watchface-complication/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../watchface-common/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+++ /dev/null
-/*
- * Copyright (c) 2018 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 WATCHFACE_COMPLICATION_PROVIDER_INCLUDE_WATCHFACE_COMPLICATION_PROVIDER_MANAGER_H_
-#define WATCHFACE_COMPLICATION_PROVIDER_INCLUDE_WATCHFACE_COMPLICATION_PROVIDER_MANAGER_H_
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // WATCHFACE_COMPLICATION_PROVIDER_INCLUDE_WATCHFACE_COMPLICATION_PROVIDER_MANAGER_H_
* limitations under the License.
*/
-#ifndef WATCHFACE_COMPLICATION_PROVIDER_INCLUDE_WATCHFACE_COMPLICATION_PROVIDER_H_
-#define WATCHFACE_COMPLICATION_PROVIDER_INCLUDE_WATCHFACE_COMPLICATION_PROVIDER_H_
+#ifndef __TIZEN_APPFW_WATCHFACE_COMPLICATION_PROVIDER_H__
+#define __TIZEN_APPFW_WATCHFACE_COMPLICATION_PROVIDER_H__
#include <tizen.h>
#include <app_control.h>
-#include "watchface-complication/include/watchface-complication.h"
+
+#include <watchface-complication.h>
#ifdef __cplusplus
extern "C" {
*/
/**
- * @addtogroup WATCHFACE_COMPLICATION_MODULE
+ * @addtogroup WATCHFACE_COMPLICATION_PROVIDER_MODULE
* @{
*/
+/**
+ * @brief Called when a watchface complication requests data update.
+ * @details Watchface application which sends an update request will receive
+ * share_data through watchface_complication_updated_cb()'s data
+ * parameter after this callback is finished.
+ * @since_tizen 5.0
+ * @remarks The @a share_data should not be released.
+ * @param[in] provider_id The id of the provider
+ * The @a provider_id can be used only in the callback. To use outside, make a copy.
+ * @param[in] req_appid The name of the watchface that update request
+ * The @a req_appid can be used only in the callback. To use outside, make a copy.
+ * @param[in] type Complication Type
+ * @param[in] context The data set in the setting app for the provider
+ * The @a context can be used only in the callback. To use outside, make a copy.
+ * @param[in] share_data The data to update. This data will be shared with
+ * watchface application.
+ * The @a share_data is managed by the platform and will be released after this callback is finished.
+ * @param[in] user_data The user data passed from the callback function
+ * @see watchface_complication_provider_add_update_requested_cb()
+ * @see watchface_complication_updated_cb()
+ *
+ * @par Sample code:
+ * @code
+#include <watchface-complication-provider.h>
+void _watchface_complication_provider_update_requested_cb(
+ const char *provider_id, const char *req_appid,
+ watchface_complication_type_e type, const bundle *context,
+ bundle *shared_data, void *user_data)
+{
+ char num_str[128] = {0, };
+ int num = rand();
+
+ if (type == WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT) {
+ watchface_complication_provider_data_set_type(shared_data,
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT);
+ if (strcmp(provider_id, AIR_POLLUTION_PROVIDER_ID) == 0) {
+ snprintf(num_str, sizeof(num_str), "air %d", num % 200);
+ watchface_complication_provider_data_set_short_text(
+ shared_data, num_str);
+ } else if (strcmp(provider_id, BATTERY_PROVIDER_ID) == 0) {
+ snprintf(num_str, sizeof(num_str),
+ "battery %d", num % 100);
+ watchface_complication_provider_data_set_short_text(
+ shared_data, num_str);
+ }
+ }
+}
+
+bool app_create(void *data)
+{
+ watchface_complication_provider_add_update_requested_cb(
+ BATTERY_PROVIDER_ID,
+ _watchface_complication_provider_update_requested_cb,
+ NULL);
+ watchface_complication_provider_add_update_requested_cb(
+ AIR_POLLUTION_PROVIDER_ID,
+ _watchface_complication_provider_update_requested_cb,
+ NULL);
+ return true;
+}
+* @endcode
+*/
typedef void (*watchface_complication_provider_update_requested_cb)(
const char *provider_id, const char *req_appid,
watchface_complication_type_e type, const bundle *context,
bundle *share_data, void *user_data);
+/**
+ * @brief Adds the callback function to be executed when the update requested.
+ * @since_tizen 5.0
+ * @param[in] provider_id The id of the provider
+ * @param[in] callback The callback function
+ * @param[in] user_data The user data passed from the callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_DB Database error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_complication_provider_remove_update_requested_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-complication-provider.h>
+{
+ watchface_complication_provider_add_update_request_cb("PROVIDER_ID",
+ _watchface_complication_provider_update_requested_cb, NULL);
+}
+ * @endcode
+ */
int watchface_complication_provider_add_update_requested_cb(
const char *provider_id,
watchface_complication_provider_update_requested_cb callback,
void *user_data);
+
+/**
+ * @brief Removes a callback function.
+ * @since_tizen 5.0
+ * @param[in] provider_id The id of the provider
+ * @param[in] callback The callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_complication_provider_add_update_requested_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-complication-provider.h>
+{
+ watchface_complication_provider_remove_update_request_cb("PROVIDER_ID",
+ _watchface_complication_provider_update_requested_cb, NULL);
+}
+ * @endcode
+ */
int watchface_complication_provider_remove_update_requested_cb(
const char *provider_id,
watchface_complication_provider_update_requested_cb callback);
+
+/**
+ * @brief Notifys to the complication that there is an update.
+ * @details Complication automatically requests data when notify is received.
+ * @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/datasharing
+ * @param[in] updated_provider_id The id of the provider
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-complication-provider.h>
+{
+ const char *provider_id = "org.tizen.comp_provider/battery";
+
+ watchface_complication_provider_notify_update(provider_id);
+}
+ * @endcode
+ */
int watchface_complication_provider_notify_update(
const char *updated_provider_id);
/**
* @brief Sends reply to the editor.
- * @details Using this API, setup app can sends new context data to the editor
+ * @details Using this function, setup app can sends new context data to the editor
* @since_tizen 5.0
- * @remarks This API is for complication provider's setup application which
+ * @privilege http://tizen.org/privilege/datasharing
+ * @remarks This function is for complication provider's setup application which
* speicified in provider app's manifest file with setup-appid attribute.
* @param[in] handle The editable handle
* @param[in] context The new context data of complication provider.
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see complication_provider_setup_get_context()
* @par Sample code:
* @code
/**
* @brief Checks whether watch app request editing or not.
- * @details Using this API, setup app can tell what kind of UI should be displayed
+ * @details Using this function, setup app can tell what kind of UI should be displayed
* @since_tizen 5.0
- * @remarks This API is for complication provider's setup application which
+ * @remarks This function is for complication provider's setup application which
* speicified in provider app's manifest file with setup-appid attribute.
* @param[in] handle The editable handle
* @param[out] is_editing The value that tell it's editing mode.
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see complication_provider_setup_reply_to_editor()
* @par Sample code:
* @code
* @details Context data will be passed to the complication provider application
* through the app_control event callaback's app_control_h handle parameter
* @since_tizen 5.0
- * @remarks This API is for complication provider's setup application which
+ * @remarks This function is for complication provider's setup application which
* speicified in provider app's manifest file with setup-appid attribute.
+ * @remarks The @a context should be released using bundle_free().
* @param[in] handle The editable handle
* @param[out] context app's setup context data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see complication_provider_setup_reply_to_editor()
* @par Sample code:
* @code
/**
* @brief Sets shared data type.
* @details Developer can set different set of data for shared data depends on data type.
- * COMPLICATION_SHORT_TEXT : short text, icon, title, extra
- * COMPLICATION_LONG_TEXT : long text, icon, title, extra
- * COMPLICATION_RANGED_VALUE : short text, icon, title, current, min, max, extra
- * COMPLICATION_TIME : time, short text, icon, extra
- * COMPLICATION_ICON : icon_path, extra
- * COMPLICATION_IMAGE : image_path, extra
+ * WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT : short text, icon, title, extra
+ * WATCHFACE_COMPLICATION_TYPE_LONG_TEXT : long text, icon, title, extra
+ * WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE : short text, icon, title, current, min, max, extra
+ * WATCHFACE_COMPLICATION_TYPE_TIME : time, short text, icon, extra
+ * WATCHFACE_COMPLICATION_TYPE_ICON : icon_path, extra
+ * WATCHFACE_COMPLICATION_TYPE_IMAGE : image_path, extra
* @since_tizen 5.0
* @param[in] shared_data The data which will be shared with watch application
* @param[in] type The data type of shared_data
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_SHORT_TEXT);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT);
// Sets short text type data.
}
* @endcode
/**
* @brief Sets short text data for shared data.
* @since_tizen 5.0
- * @remarks Short text data can be added only for #COMPLICATION_SHORT_TEXT,
- * #COMPLICATION_RANGED_VALUE, #COMPLICATION_TIME type shared data.
+ * @remarks @a short_text data can be added only for #WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ * #WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE, #WATCHFACE_COMPLICATION_TYPE_TIME type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] short_text The short text data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_SHORT_TEXT);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT);
watchface_complication_provider_data_set_short_text(shared_data, "text data");
}
* @endcode
/**
* @brief Sets long text data for shared data.
* @since_tizen 5.0
- * @remarks Long text data can be added only for #COMPLICATION_LONG_TEXT type shared data.
+ * @remarks @a long_text can be added only for #WATCHFACE_COMPLICATION_TYPE_LONG_TEXT type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] long_text The long text data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_LONG_TEXT);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_LONG_TEXT);
watchface_complication_provider_data_set_long_text(shared_data, "long text data");
}
* @endcode
/**
* @brief Sets title data for shared data.
* @since_tizen 5.0
- * @remarks Long text data can be added only for #COMPLICATION_SHORT_TEXT,
- * #COMPLICATION_LONG_TEXT, ECOMPLICATION_RANGED_VALUE type shared data.
+ * @remarks @a title can be added only for #WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ * #WATCHFACE_COMPLICATION_TYPE_LONG_TEXT, EWATCHFACE_COMPLICATION_TYPE_RANGED_VALUE type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] title The title text data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_LONG_TEXT);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_LONG_TEXT);
watchface_complication_provider_data_set_title(shared_data, "title");
}
* @endcode
/**
* @brief Sets timestamp data for shared data.
* @since_tizen 5.0
- * @remarks timestamp data can be added only for #COMPLICATION_TIME type shared data.
+ * @remarks @a timestamp can be added only for #WATCHFACE_COMPLICATION_TYPE_TIME type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] timestamp The timestamp data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
time_t seconds;
seconds = time(NULL);
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_TIME);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_TIME);
watchface_complication_provider_data_set_timestamp(shared_data, seconds);
}
* @endcode
/**
* @brief Sets image path data for shared data.
* @since_tizen 5.0
- * @remarks timestamp data can be added only for #COMPLICATION_IMAGE type shared data.
+ * @remarks @a image_path can be added only for #WATCHFACE_COMPLICATION_TYPE_IMAGE type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] image_path The image path data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_TIME);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_IMAGE);
watchface_complication_provider_data_set_image_path(shared_data, "path");
}
* @endcode
/**
* @brief Sets ranged value data for shared data.
* @since_tizen 5.0
- * @remarks timestamp data can be added only for #COMPLICATION_IMAGE type shared data.
+ * @remarks @a min_value, @a max_value, @a current_value can be added only for #WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] current_value The current value
* @param[in] min_value The minimum value
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_TIME);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE);
watchface_complication_provider_data_set_ranged_value(shared_data, 50.0, 0.0, 100.0);
}
* @endcode
/**
* @brief Sets icon path data for shared data.
* @since_tizen 5.0
- * @remarks timestamp data can be added only for #COMPLICATION_SHORT_TEXT,
- * #COMPLICATION_LONG_TEXT, #COMPLICATION_TIME, #COMPLICATION_ICON type shared data.
+ * @remarks @a icon_path can be added only for #WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ * #WATCHFACE_COMPLICATION_TYPE_LONG_TEXT, #WATCHFACE_COMPLICATION_TYPE_TIME, #WATCHFACE_COMPLICATION_TYPE_ICON type shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] icon_path The icon path data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_TIME);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_ICON);
watchface_complication_provider_data_set_icon_path(shared_data, "path");
}
* @endcode
/**
* @brief Sets extra data for shared data.
* @since_tizen 5.0
- * @remarks timestamp data can be added to every type of shared data.
+ * @remarks @a extra_data can be added to every type of shared data.
* @param[in] shared_data The data which will be shared with watch application
* @param[in] extra_data The extra data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_provider_data_set_type()
* @par Sample code:
* @code
#include <watchface-complication-provider.h>
-int __on_update_request(const char *provider_id, const char *req_appid,
- watchface_complication_type_e type, const bundle *context, bundle *shared_data,
+int _watchface_complication_provider_update_requested_cb(const char *provider_id,
+ const char *req_appid, watchface_complication_type_e type,
+ const bundle *context, bundle *shared_data, void *user_data)
{
- watchface_complication_provider_data_set_type(shared_data, COMPLICATION_TIME);
+ watchface_complication_provider_data_set_type(shared_data, WATCHFACE_COMPLICATION_TYPE_TIME);
watchface_complication_provider_data_set_extra_data(shared_data, "extra");
}
* @endcode
/**
* @brief Checks whether app is launched by complication touch or not.
* @since_tizen 5.0
- * @remarks is_touch_launch is true when provider app is launched by
- * watchface_complication_touch_launch API.
+ * @remarks @a is_touch_launch is true when provider app is launched by watchface_complication_touch_launch().
* @param[in] handle The app control handle
* @param[out] is_touch_launch The value that tell it's launched by touch.
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
- * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_touch_launch()
* @see watchface_complication_provider_touch_launch_get_provider_id()
* @see watchface_complication_provider_touch_launch_get_complication_type()
/**
* @brief Gets provider id of touched complication.
* @since_tizen 5.0
+ * @remarks The @a provider_id should be freed using free().
* @param[in] handle The app control handle
* @param[out] provider_id The provider id of touched complication
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_touch_launch()
* @see watchface_complication_provider_is_touch_launch()
* @see watchface_complication_provider_touch_launch_get_complication_type()
&context);
// Do something
}
+
+ free(provider_id);
}
* @endcode
*/
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_touch_launch()
* @see watchface_complication_provider_is_touch_launch()
* @see watchface_complication_provider_touch_launch_get_provider_id()
/**
* @brief Gets complication context of touched complication.
* @since_tizen 5.0
- * @remarks context is customized information about complication setup.
+ * @remarks @a context is customized information about complication setup.
* complication setup can be generated by complication setup app and
* complication setup app can be specified with complication provider
* app's manifest xml file.
+ * @remarks The @a context should be released using bundle_free().
* @param[in] handle The app control handle
* @param[out] context The complication context of touched complication
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_touch_launch()
* @see watchface_complication_provider_is_touch_launch()
* @see watchface_complication_provider_touch_launch_get_provider_id()
#endif
-#endif // WATCHFACE_COMPLICATION_PROVIDER_INCLUDE_WATCHFACE_COMPLICATION_PROVIDER_H_
+#endif /* __TIZEN_APPFW_WATCHFACE_COMPLICATION_PROVIDER_H__ */
* limitations under the License.
*/
-#ifndef WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_COMPLICATION_H_
-#define WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_COMPLICATION_H_
+#ifndef __TIZEN_APPFW_WATCHFACE_COMPLICATION_H__
+#define __TIZEN_APPFW_WATCHFACE_COMPLICATION_H__
#include <tizen.h>
#include <bundle.h>
*/
/**
- * @addtogroup WATCHFACE_COMPLICATION_MODULE
+ * @addtogroup WATCHFACE_COMPLICATION_COMPLICATION_MODULE
* @{
*/
* @since_tizen 5.0
*/
typedef void *complication_h;
+
+/**
+ * @brief Called when the complication is updated.
+ * @since_tizen 5.0
+ * @param[in] complication_id A number that identifies the complication
+ * @param[in] provider_id The name of the provider
+ * The @a provider_id can be used only in the callback. To use outside, make a copy.
+ * @param[in] type The type shown in the complication
+ * @param[in] data The data of the complication provided by the provider
+ * The @a data can be used only in the callback. To use outside, make a copy.
+ * @param[in] user_data The user data passed from the callback function
+ */
typedef void (*watchface_complication_updated_cb)(
int complication_id,
const char *provider_id,
const bundle *data,
void *user_data);
+/**
+ * @brief Gets the id of provider in the complication.
+ * @since_tizen 5.0
+ * @remarks The @a cur_provider should be released using free().
+ * @param[in] handle Complication handle
+ * @param[out] cur_provider The name of the provider supplying the data
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @pre Complication handle should be created by watchface_complication_create().
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+ int comp_id = 1;
+ complication_h complication;
+ const char *cur_provider_id;
+
+ ret = watchface_complication_create(comp_id, "org.tizen.sample",
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT, WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ WATCHFACE_COMPLICATION_SHAPE_TYPE_CIRCLE, &complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || complication == NULL)
+ return ret;
+
+ ret = watchface_complication_get_cur_provider_id(complication, &cur_provider_id);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return ret;
+}
+ * @endcode
+ */
int watchface_complication_get_cur_provider_id(complication_h handle,
- char **cur_provider);
+ char **cur_provider);
+
+/**
+ * @brief Gets the currently set type of the complication.
+ * @since_tizen 5.0
+ * @param[in] handle Complication handle
+ * @param[out] cur_type The type shown in the complication
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+ int comp_id = 1;
+ complication_h complication;
+ watchface_complication_type_e cur_type;
+
+ ret = watchface_complication_create(comp_id, "org.tizen.sample",
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT, WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ WATCHFACE_COMPLICATION_SHAPE_TYPE_CIRCLE, &complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || complication == NULL)
+ return ret;
+
+ ret = watchface_complication_get_cur_type(complication, &cur_type);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return ret;
+}
+ * @endcode
+ */
int watchface_complication_get_cur_type(complication_h handle,
watchface_complication_type_e *cur_type);
-int watchface_complication_get_support_types(complication_h handle, int *support_types);
+/**
+ * @brief Adds the callback function to use for complication update.
+ * @since_tizen 5.0
+ * @param[in] handle Complication handle
+ * @param[in] cb The callback function
+ * @param[in] user_data The user data to pass to the callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @pre Complication handle should be created by watchface_complication_create().
+ * @see watchface_complication_updated_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+ int comp_id = 1;
+ complication_h complication;
+
+ ret = watchface_complication_create(comp_id, "org.tizen.sample",
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT, WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ WATCHFACE_COMPLICATION_SHAPE_TYPE_CIRCLE, &complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || complication == NULL)
+ return ret;
+
+ ret = watchface_complication_add_updated_cb(complication,
+ _watchface_complication_updated_cb, NULL);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return ret;
+}
+ * @endcode
+ */
int watchface_complication_add_updated_cb(complication_h handle,
watchface_complication_updated_cb cb,
void *user_data);
+
+/**
+ * @brief Removes the callback function.
+ * @since_tizen 5.0
+ * @param[in] handle Complication handle
+ * @param[in] cb The callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_complication_updated_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+
+ ret = watchface_complication_remove_updated_cb(complication,
+ _watchface_complication_updated_cb);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return ret;
+}
+ * @endcode
+ */
int watchface_complication_remove_updated_cb(complication_h handle,
watchface_complication_updated_cb cb);
+
+/**
+ * @brief Sends request the provider to update the complication.
+ * @since_tizen 5.0
+ * @remarks The watchface complication provider application can declare
+ * privileges for specific provider id in manifest xml file, in that case,
+ * the watchface application needs those privileges to use this function.
+ * If your app doesn't have those privileges, this function will return #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED.
+ * @privilege http://tizen.org/privilege/appmanager.launch
+ * @privilege http://tizen.org/privilege/datasharing
+ * @param[in] handle Complication handle
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_DB Database error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+ int comp_id = 1;
+ complication_h complication;
+ int support_types;
+
+ ret = watchface_complication_create(comp_id, "org.tizen.sample",
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT, WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ WATCHFACE_COMPLICATION_SHAPE_TYPE_CIRCLE, &complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || complication == NULL)
+ return ret;
+
+ ret = watchface_complication_send_update_request(complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return ret;
+}
+ * @endcode
+ */
int watchface_complication_send_update_request(complication_h handle);
+
+/**
+ * @brief Creates a complication handle.
+ * @details The default provider and type are the items to set for initial display.
+ * User should not enter null as the default provider and will receive an error.
+ * If user selects the other provider and type, they are no longer used.
+ * You can specify support_types by combining the types you want to show in the complication.
+ * @since_tizen 5.0
+ * @remarks The @a created_handle should be released using watchface_complication_destroy().
+ * @param[in] complication_id A number that identifies the complication
+ * @param[in] default_provider_id The default provider id
+ * @param[in] default_type The default type to display
+ * @param[in] support_types The type shown in the complication
+ * @param[in] type The shape type of the complication
+ * @param[out] created_handle Complication handle on success
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EXIST_ID Already exist @a complication_id
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_EXIST Provider does not exist
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_DB Database error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_complication_type_e
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+ int comp_id = 1;
+ complication_h complication;
+
+ ret = watchface_complication_create(comp_id, "org.tizen.sample",
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
+ WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT|WATCHFACE_COMPLICATION_TYPE_ICON,
+ WATCHFACE_COMPLICATION_SHAPE_TYPE_CIRCLE, &complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || complication == NULL)
+ return ret;
+}
+ * @endcode
+ */
int watchface_complication_create(int complication_id,
const char *default_provider_id,
watchface_complication_type_e default_type,
int support_types,
watchface_complication_shape_type_e type,
complication_h *created_handle);
+
+/**
+ * @brief Destroys a complication handle.
+ * @since_tizen 5.0
+ * @param[in] handle Complication handle
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @pre Complication handle should be created by watchface_complication_create().
+ * @see watchface_complication_create()
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ int ret;
+ complication_h complication;
+
+ // Create complication
+
+ // Do something
+
+ ret = watchface_complication_destroy(complication);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+}
+ * @endcode
+ */
int watchface_complication_destroy(complication_h handle);
/**
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
/**
* @brief Gets short text from complication data.
* @since_tizen 5.0
+ * @remarks The @a short_text should be freed using free().
* @param[in] data The data received from complication provider app
* @param[out] short_text The short text data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
watchface_complication_type_e type;
watchface_complication_data_get_type(data, &type);
- if (type == COMPLICATION_SHORT_TEXT)
+ if (type == WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT)
watchface_complication_data_get_short_text(data, &value);
}
* @endcode
/**
* @brief Gets long text from complication data.
* @since_tizen 5.0
+ * @remarks The @a long_text should be freed using free().
* @param[in] data The data received from complication provider app
* @param[out] long_text The long text data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
watchface_complication_type_e type;
watchface_complication_data_get_type(data, &type);
- if (type == COMPLICATION_LONG_TEXT)
+ if (type == WATCHFACE_COMPLICATION_TYPE_LONG_TEXT)
watchface_complication_data_get_long_text(data, &value);
}
* @endcode
/**
* @brief Gets title text from complication data.
* @since_tizen 5.0
+ * @remarks The @a title should be freed using free().
* @param[in] data The data received from complication provider app
* @param[out] title The title text data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
watchface_complication_type_e type;
watchface_complication_data_get_type(data, &type);
- if (type == COMPLICATION_LONG_TEXT)
+ if (type == WATCHFACE_COMPLICATION_TYPE_LONG_TEXT)
watchface_complication_data_get_long_text(data, &value);
}
* @endcode
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
/**
* @brief Gets image path from complication data.
* @since_tizen 5.0
+ * @remarks The @a image_path should be freed using free().
* @param[in] data The data received from complication provider app
* @param[out] image_path The image path data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
watchface_complication_type_e type;
watchface_complication_data_get_type(data, &type);
- if (type == COMPLICATION_IMAGE_PATH)
+ if (type == WATCHFACE_COMPLICATION_TYPE_IMAGE)
watchface_complication_data_get_image_path(data, &value);
}
* @endcode
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
watchface_complication_type_e type;
watchface_complication_data_get_type(data, &type);
- if (type == COMPLICATION_IMAGE_PATH)
+ if (type == WATCHFACE_COMPLICATION_TYPE_IMAGE)
watchface_complication_data_get_ranged_value(data, &cur_val, &min_val, &max_val);
}
* @endcode
/**
* @brief Gets icon path from complication data.
* @since_tizen 5.0
+ * @remarks The @a icon_path should be freed using free().
* @param[in] data The data received from complication provider app
* @param[out] icon_path The icon path data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
watchface_complication_type_e type;
watchface_complication_data_get_type(data, &type);
- if (type == COMPLICATION_ICON_PATH)
+ if (type == WATCHFACE_COMPLICATION_TYPE_ICON)
watchface_complication_data_get_icon_path(data, &value);
}
* @endcode
/**
* @brief Gets extra data from complication data.
* @since_tizen 5.0
+ * @remarks The @a extra_data should be freed using free().
* @param[in] data The data received from complication provider app
* @param[out] extra_data The extra data
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_type_e
* @see watchface_complication_updated_cb()
* @par Sample code:
/**
* @brief Launchs current complication's provider application.
- * @details This API launchs the provider application with extra data,
+ * @details This function launchs the provider application with extra data,
* so that provider can tell it is launched by touching.
* @since_tizen 5.0
+ * @remarks The watchface complication provider application can declare
+ * privileges for specific provider id in manifest xml file, in that case,
+ * the watchface application needs those privileges to use this function.
+ * If your app doesn't have those privileges, this function will return #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED.
+ * @privilege http://tizen.org/privilege/appmanager.launch
+ * @privilege http://tizen.org/privilege/datasharing
* @param[in] handle The complication handle
* @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR IO Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_DB Database error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_provider_is_touch_launch()
* @see watchface_complication_provider_get_touch_launch_provider_id()
* @see watchface_complication_provider_get_touch_launch_type()
*/
int watchface_complication_touch_launch(complication_h handle);
+/**
+ * @brief The complication allowed list handle.
+ * @since_tizen 5.0
+ */
typedef struct complication_allowed_list_ *complication_allowed_list_h;
+
/**
* @brief Creates allowed list.
- * @details The allowed list created by this API is provider list which
+ * @details The allowed list created by this function is provider list which
* will be shown on the editor app's candidate provider list.
* @since_tizen 5.0
- * @remarks Created allowed list should be applied with
- * watchface_complication_allowed_list_apply() API
- * @remarks Created allowed list should be destroyed after applied
+ * @remarks Created allowed list should be applied with watchface_complication_allowed_list_apply().
+ * Created allowed list should be destroyed after applied.
* @param[in] handle The complication allowed list handle
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_destroy()
* @see watchface_complication_allowed_list_add()
* @see watchface_complication_allowed_list_del()
* @brief Destroys allowed list.
* @since_tizen 5.0
* @param[in] handle The complication allowed list handle
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_create()
* @see watchface_complication_allowed_list_add()
* @see watchface_complication_allowed_list_del()
/**
* @brief Adds provider info to the allowed list.
- * @details Using this API the complication can add provider id and types
+ * @details Using this function the complication can add provider id and types
* which will be shown on the editor app's candidate provider list.
* @since_tizen 5.0
* @param[in] handle The complication allowed list handle
* @param[in] provider_id The complication provider id
- * @param[in] types The complication types
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #COMPLICATION_ERROR_EXIST_ID The provider id is already exists in allowed list
+ * @param[in] types The complication types, values of #complication_type_e combiled with bitwise 'or'
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EXIST_ID The provider id is already exists in allowed list
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_create()
* @see watchface_complication_allowed_list_destroy()
* @see watchface_complication_allowed_list_del()
{
complication_allowed_list_h handle;
int ret = watchface_complication_allowed_list_create(&handle);
- if (ret == COMPLICATION_ERROR_NONE)
+ if (ret == WATCHFACE_COMPLICATION_ERROR_NONE)
ret = watchface_complication_allowed_list_add(handle, provider_id, types);
}
* @endcode
* @since_tizen 5.0
* @param[in] handle The complication allowed list handle
* @param[in] provider_id The complication provider id
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_NO_DATA No data
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_create()
* @see watchface_complication_allowed_list_destroy()
* @see watchface_complication_allowed_list_add()
{
complication_allowed_list_h handle;
int ret = watchface_complication_allowed_list_create(&handle);
- if (ret == COMPLICATION_ERROR_NONE) {
+ if (ret == WATCHFACE_COMPLICATION_ERROR_NONE) {
ret = watchface_complication_allowed_list_add(handle, provider_id, types);
- if (ret == COMPLICATION_ERROR_EXIST_ID) {
+ if (ret == WATCHFACE_COMPLICATION_ERROR_EXIST_ID) {
watchface_complication_allowed_list_del(handle, provider_id);
watchface_complication_allowed_list_add(handle, provider_id, types);
}
const char *provider_id);
/**
- * @brief Gets nth item of the allowed list.
+ * @brief Gets n-th item of the allowed list.
* @since_tizen 5.0
+ * @remarks The @a provider_id should be freed using free().
* @param[in] handle The complication allowed list handle
+ * @param[in] index Index
* @param[out] provider_id The complication provider id
- * @param[out] types The complication types
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_IO_ERROR IO Error
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @param[out] types The complication types, values of #complication_type_e combiled with bitwise 'or'
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_create()
* @see watchface_complication_allowed_list_destroy()
* @see watchface_complication_allowed_list_add()
{
complication_allowed_list_h handle;
int ret = watchface_complication_allowed_list_create(&handle);
- if (ret == COMPLICATION_ERROR_NONE) {
+ if (ret == WATCHFACE_COMPLICATION_ERROR_NONE) {
ret = watchface_complication_allowed_list_add(handle, provider_id, types);
- if (ret == COMPLICATION_ERROR_EXIST_ID) {
+ if (ret == WATCHFACE_COMPLICATION_ERROR_EXIST_ID) {
watchface_complication_allowed_list_del(handle, provider_id);
watchface_complication_allowed_list_add(handle, provider_id, types);
}
char **provider_id, int *types);
/**
- * @brief Applys allowed list.
+ * @brief Applys the allowed list to a complication.
+ * @details After using this function, the editor will display providers included in the allowed list handle.
* @since_tizen 5.0
- * @param[in] handle The complication allowed list handle
+ * @param[in] handle The complication handle
* @param[in] list_handle The allowed list handle
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_DB Database error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_create()
* @see watchface_complication_allowed_list_destroy()
* @see watchface_complication_allowed_list_add()
#include <watchface-complication.h>
{
- complication_allowed_list_h handle;
- int ret = watchface_complication_allowed_list_create(&handle);
- if (ret == COMPLICATION_ERROR_NONE) {
- ret = watchface_complication_allowed_list_add(handle, provider_id, types);
- if (ret == COMPLICATION_ERROR_EXIST_ID) {
- watchface_complication_allowed_list_del(handle, provider_id);
- watchface_complication_allowed_list_add(handle, provider_id, types);
+ complication_h handle;
+ complication_allowed_list_h allowed_list;
+
+ // create complication handle
+
+ int ret = watchface_complication_allowed_list_create(&allowed_list);
+ if (ret == WATCHFACE_COMPLICATION_ERROR_NONE) {
+ ret = watchface_complication_allowed_list_add(allowed_list, provider_id, types);
+ if (ret == WATCHFACE_COMPLICATION_ERROR_EXIST_ID) {
+ watchface_complication_allowed_list_del(allowed_list, provider_id);
+ watchface_complication_allowed_list_add(allowed_list, provider_id, types);
}
- watchface_complication_allowed_list_get_nth(handle, 0, &n_provider_id, &n_types);
- watchface_complication_allowed_list_apply(handle, list_handle);
+ watchface_complication_allowed_list_get_nth(allowed_list, 0, &n_provider_id, &n_types);
+ watchface_complication_allowed_list_apply(handle, allowed_list);
}
}
* @endcode
* @brief Removes applied allowed list.
* @since_tizen 5.0
* @param[in] handle The complication allowed list handle
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_complication_allowed_list_create()
* @see watchface_complication_allowed_list_destroy()
* @see watchface_complication_allowed_list_add()
#include <watchface-complication.h>
{
- complication_allowed_list_h handle;
- int ret = watchface_complication_allowed_list_create(&handle);
- if (ret == COMPLICATION_ERROR_NONE) {
- ret = watchface_complication_allowed_list_add(handle, provider_id, types);
- if (ret == COMPLICATION_ERROR_EXIST_ID) {
- watchface_complication_allowed_list_del(handle, provider_id);
- watchface_complication_allowed_list_add(handle, provider_id, types);
+ complication_h handle;
+ complication_allowed_list_h allowed_list;
+
+ // create complication handle
+
+ int ret = watchface_complication_allowed_list_create(&allowed_list);
+ if (ret == WATCHFACE_COMPLICATION_ERROR_NONE) {
+ ret = watchface_complication_allowed_list_add(allowed_list, provider_id, types);
+ if (ret == WATCHFACE_COMPLICATION_ERROR_EXIST_ID) {
+ watchface_complication_allowed_list_del(allowed_list, provider_id);
+ watchface_complication_allowed_list_add(allowed_list, provider_id, types);
}
- watchface_complication_allowed_list_get_nth(handle, 0, &n_provider_id, &n_types);
- watchface_complication_allowed_list_apply(handle, list_handle);
+ watchface_complication_allowed_list_get_nth(allowed_list, 0, &n_provider_id, &n_types);
+ watchface_complication_allowed_list_apply(handle, allowed_list);
watchface_complication_allowed_list_clear(handle);
}
}
}
#endif
-#endif // WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_COMPLICATION_H_
+#endif /* __TIZEN_APPFW_WATCHFACE_COMPLICATION_H__ */
* limitations under the License.
*/
-#ifndef WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_EDITABLE_H_
-#define WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_EDITABLE_H_
+#ifndef __TIZEN_APPFW_WATCHFACE_EDITABLE_H__
+#define __TIZEN_APPFW_WATCHFACE_EDITABLE_H__
#include <tizen.h>
#include <glib.h>
#include <bundle.h>
-#include "watchface-complication.h"
+#include <watchface-complication.h>
#ifdef __cplusplus
extern "C" {
WATCHFACE_EDITABLE_EDIT_STATE_CANCEL /**< Cancel */
} watchface_editable_edit_state_e;
+/**
+ * @brief Called when an editable requests an edit.
+ * @since_tizen 5.0
+ * @param[in] handle The editable handle
+ * The @a handle can be used only in the callback.
+ * @param[in] selected_idx Index
+ * @param[in] state Editable state
+ * @param[in] user_data The user data passed from the callback function
+ * @see watchface_editable_edit_state_e
+ */
typedef void (*watchface_editable_update_requested_cb)(
- const watchface_editable_h handle, int selected_idx,
- const watchface_editable_edit_state_e state, void *user_data);
-typedef void (*watchface_editable_edit_ready_cb)(watchface_editable_container_h handle,
- const char *editor_appid, void *user_data);
+ const watchface_editable_h handle,
+ int selected_idx,
+ const watchface_editable_edit_state_e state,
+ void *user_data);
+/**
+ * @brief Called when the editor is ready to edit.
+ * @since_tizen 5.0
+ * @remarks The @a handle should not be released.
+ * @remarks The @a handle can be used only in the callback.
+ * @param[in] handle The editable container handle
+ * @param[in] editor_appid The name of editor
+ * The @a editor_appid can be used only in the callback. To use outside, make a copy.
+ * @param[in] user_data The user data passed from the callback function
+ * @see editable_on_edit_ready_cb_add()
+ */
+typedef void (*watchface_editable_edit_ready_cb)(
+ watchface_editable_container_h handle,
+ const char *editor_appid,
+ void *user_data);
/**
* @brief The candidates list handle.
* @since_tizen 5.0
* @remarks Created candidates list should be destroyed after used.
* @param[in] handle The candidates list handle
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_candidates_list_add()
* @see watchface_editable_candidates_list_destroy()
* @see watchface_editable_add_design_element()
#include <watchface-complication.h>
{
complication_candidates_list_h handle;
+
int ret = watchface_editable_candidates_list_create(&handle);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
}
* @endcode
*/
* watchface_editable_candidates_list_destroy() API is called.
* @param[in] handle The candidates list handle
* @param[in] candidate The candidate data
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_candidates_list_create()
* @see watchface_editable_candidates_list_destroy()
* @see watchface_editable_add_design_element()
* @par Sample code:
* @code
#include <watchface-complication.h>
-_onwatchface_editable_edit_ready_cb(editable_container_h handle,
+_watchface_editable_edit_ready_cb(editable_container_h handle,
const char *editor_appid, void *user_data)
{
+ watchface_editable_geo_h geo;
complication_candidates_list_h list_handle;
- int ret = watchface_editable_candidates_list_create(&list_handle);
- bundle *candidate = bundle_create();
+ bundle *candidate;
+ int ret;
+
+ ret = watchface_editable_candidates_list_create(&list_handle);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+
+ candidate = bundle_create();
+ if (candidate == NULL)
+ goto err;
bundle_add_str(candidate, "TEST_COLOR", "RED");
- watchface_editable_candidates_list_add(list_handle, candidate);
+
+ ret = watchface_editable_candidates_list_add(list_handle, candidate);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
candidate = bundle_create();
+ if (candidate == NULL)
+ goto err;
bundle_add_str(candidate, "TEST_COLOR", "YELLOW");
- watchface_editable_candidates_list_add(list_handle, candidate);
- watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx,
+ ret = watchface_editable_candidates_list_add(list_handle, candidate);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
+
+ watchface_editable_geometry_create(&geo);
+ watchface_editable_geometry_set(geo, 50, 50, 100, 100);
+ ret = watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx,
complication_candidates_list_h, geo, "Color");
+ watchface_editable_geometry_destroy(geo);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
+
+err:
+ if (candidate)
+ bundle_free(candidate);
+
watchface_editable_candidates_list_destroy(list_handle);
}
* @endcode
*/
int watchface_editable_candidates_list_add(
- complication_candidates_list_h handle, bundle *candidate);
+ complication_candidates_list_h handle, bundle *candidate);
/**
* @brief Destroys candidates list.
* @since_tizen 5.0
* @param[in] handle The complication allowed list handle
- * @return #COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
+ * otherwise an error code (see WATCHFACE_COMPLICATION_ERROR_XXX) on failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_candidates_list_add()
* @see watchface_editable_candidates_list_create()
* @see watchface_editable_add_design_element()
_watchface_editable_edit_ready_cb(editable_container_h handle,
const char *editor_appid, void *user_data)
{
+ watchface_editable_geo_h geo;
complication_candidates_list_h list_handle;
- int ret = watchface_editable_candidates_list_create(&list_handle);
- bundle *candidate = bundle_create();
+ bundle *candidate;
+ int ret;
+
+ ret = watchface_editable_candidates_list_create(&list_handle);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+
+ candidate = bundle_create();
+ if (candidate == NULL)
+ goto err;
bundle_add_str(candidate, "TEST_COLOR", "RED");
- watchface_editable_candidates_list_add(list_handle, candidate);
+
+ ret = watchface_editable_candidates_list_add(list_handle, candidate);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
candidate = bundle_create();
+ if (candidate == NULL)
+ goto err;
bundle_add_str(candidate, "TEST_COLOR", "YELLOW");
- watchface_editable_candidates_list_add(list_handle, candidate);
- watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx,
- complication_candidates_list_h, geo, "Color");
+ ret = watchface_editable_candidates_list_add(list_handle, candidate);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
+
+ watchface_editable_geometry_create(&geo);
+ watchface_editable_geometry_set(geo, 50, 50, 100, 100);
+ ret = watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx,
+ complication_candidates_list_h, geo, "Color");
+ watchface_editable_geometry_destroy(geo);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
+
+err:
+ if (candidate)
+ bundle_free(candidate);
+
watchface_editable_candidates_list_destroy(list_handle);
}
* @endcode
/**
* @brief Adds the design element to the editable container handle.
- * @details The design element will be displayed on the editor app's
- * editables list
+ * @details The design element will be displayed on the editor app's editables list.
* @since_tizen 5.0
* @param[in] handle The editable container
* @param[in] editable_id Editable id
* @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EXIST_ID The given @a editable_id already exists
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_edit_ready_cb()
* @see watchface_editable_candidates_list_add()
* @see watchface_editable_candidates_list_create()
_watchface_editable_edit_ready_cb(watchface_editable_container_h handle,
const char *editor_appid, void *user_data)
{
- GList *candidatelist = NULL;
watchface_editable_geo_h geo;
- int cur_idx = 0;
bundle *selected_data = NULL;
-
+ bundle *candidate;
complication_candidates_list_h list_handle;
- int ret = watchface_editable_candidates_list_create(&list_handle);
- bundle *candidate = bundle_create();
+ int ret;
+ int cur_idx = 0;
+
+ ret = watchface_editable_candidates_list_create(&list_handle);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+
+ candidate = bundle_create();
+ if (candidate == NULL)
+ goto err;
bundle_add_str(candidate, "TEST_COLOR", "RED");
- watchface_editable_candidates_list_add(list_handle, candidate);
+
+ ret = watchface_editable_candidates_list_add(list_handle, candidate);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
candidate = bundle_create();
+ if (candidate == NULL)
+ goto err;
bundle_add_str(candidate, "TEST_COLOR", "YELLOW");
- watchface_editable_candidates_list_add(list_handle, candidate);
+
+ ret = watchface_editable_candidates_list_add(list_handle, candidate);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
watchface_editable_load_current_data(COLOR_EDIT, &selected_data);
if (selected_data) {
watchface_editable_geometry_create(&geo);
watchface_editable_geometry_set(geo, 50, 50, 100, 100);
- watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx,
+ ret = watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx,
list_handle, geo, "Color");
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
watchface_editable_geometry_destroy(geo);
+
+ ret = watchface_editable_request_edit(handle,
+ _watchface_editable_update_requested_cb, user_data);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ goto err;
+
+err:
+ if (candidate)
+ bundle_free(candidate);
+
watchface_editable_candidates_list_destroy(list_handle);
- watchface_editable_request_edit(handle, _on_editable_update, user_data);
}
* @endcode
*/
int editable_id, int cur_data_idx,
complication_candidates_list_h list_handle,
watchface_editable_geo_h geo, const char *editable_name);
+
+/**
+ * @brief Adds a complication to the editable container handle.
+ * @since_tizen 5.0
+ * @param[in] handle The editable container handle
+ * @param[in] editable_id Editable id
+ * @param[in] comp Complication handle
+ * @param[in] geo Position of editable
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EXIST_ID The given @a editable_id already exists
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_edit_ready_cb(watchface_editable_container_h handle,
+ const char *editor_appid, void *user_data)
+{
+ int comp_id = 1;
+ complication_h comp;
+ watchface_editable_geo_h geo;
+
+ // create complication
+ watchface_complication_create(,,,&comp);
+
+ // set geometry
+ watchface_editable_geometry_create(&geo);
+ watchface_editable_geometry_set(geo, 50, 50, 100, 100);
+ watchface_editable_add_complication(handle, comp_id, comp, geo);
+ watchface_editable_geometry_destroy(geo);
+
+}
+ * @endcode
+ */
+int watchface_editable_add_complication(watchface_editable_container_h handle,
+ int editable_id, complication_h comp,
+ watchface_editable_geo_h geo);
+
+/**
+ * @brief Requests editor to edit.
+ * @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/datasharing
+ * @param[in] handle The editable container handle
+ * @param[in] cb The callback function
+ * @param[in] user_data The user data to pass to the callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_edit_ready_cb(watchface_editable_container_h handle,
+ const char *editor_appid, void *user_data)
+{
+ int comp_id = 1;
+ int design_element_id = 2;
+ complication_h comp;
+ bundle *design_element;
+ complication_candidates_list_h candidates_list = NULL;
+ watchface_editable_geo_h geo;
+
+ watchface_editable_geometry_create(&geo);
+ watchface_editable_geometry_set(geo, 50, 50, 100, 100);
+
+ // create, add complication
+ watchface_editable_add_complication(handle, comp_id, comp, geo);
+ watchface_editable_geometry_destroy(geo);
+
+ // create, add design element
+ // make a candidatelist
+ watchface_editable_candidates_list_create(&candidates_list);
+ design_element = bundle_create();
+ bundle_add_str(design_element, "TEST_COLOR", "Blue");
+ watchface_editable_candidates_list_add(candidates_list, design_element);
+ watchface_editable_add_design_element(handle, design_element_id, 0, candidatelist, geo, "Color");
+ watchface_editable_candidates_list_destroy(candidates_list);
+
+ watchface_editable_request_edit(handle, _watchface_editable_update_requested_cb, user_data);
+}
+ * @endcode
+ */
+int watchface_editable_request_edit(watchface_editable_container_h handle,
+ watchface_editable_update_requested_cb cb,
+ void *user_data);
+
+/**
+ * @brief Adds the callback function to request edit.
+ * @since_tizen 5.0
+ * @param[in] cb The callback function
+ * @param[in] user_data The user data to pass to the callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O Error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editable_edit_ready_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+{
+ watchface_editable_add_edit_ready_cb(_watchface_editable_edit_ready_cb, NULL);
+}
+ * @endcode
+ */
+int watchface_editable_add_edit_ready_cb(watchface_editable_edit_ready_cb cb,
+ void *user_data);
+
+/**
+ * @brief Removes the callback function to request edit.
+ * @since_tizen 5.0
+ * @param[in] cb The callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editable_edit_ready_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+{
+ watchface_editable_remove_edit_ready_cb(_watchface_edit_ready_cb);
+}
+ * @endcode
+ */
+int watchface_editable_remove_edit_ready_cb(watchface_editable_edit_ready_cb cb);
+
+/**
+ * @brief Gets the name of the editable.
+ * @since_tizen 5.0
+ * @remarks The @a editable_name should be freed using free().
+ * @param[in] handle The editable handle
+ * @param[out] editable_name Name of editable
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ char *name;
+
+ ret = watchface_editable_get_editable_name(handle, &name);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || name == NULL)
+ return;
+
+ free(name);
+}
+ * @endcode
+ */
int watchface_editable_get_editable_name(const watchface_editable_h handle,
char **editable_name);
+
+/**
+ * @brief Sets the name in editable.
+ * @since_tizen 5.0
+ * @param[in] handle The editable handle
+ * @param[in] editable_name Name of editable
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ const char *name = "Editor";
+
+ ret = watchface_editable_set_editable_name(ed, name);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+}
+ * @endcode
+ */
int watchface_editable_set_editable_name(const watchface_editable_h handle,
const char *editable_name);
-int watchface_editable_get_nth_data(const watchface_editable_h handle, int nth,
+
+/**
+ * @brief Retrieves the n-th data of editable.
+ * @since_tizen 5.0
+ * @remarks The @a nth_data should be freed using bundle_free().
+ * @param[in] handle The editable handle
+ * @param[in] n Index
+ * @param[in] nth_data Bundle data
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ int n = 1;
+ bundle *data;
+
+ ret = watchface_editable_get_nth_data(handle, n, &data);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || data == NULL);
+ return;
+
+ bundle_free(data);
+}
+ * @endcode
+ */
+int watchface_editable_get_nth_data(const watchface_editable_h handle, int n,
bundle **nth_data);
+
+/**
+ * @brief Retrieves the current data in editable.
+ * @since_tizen 5.0
+ * @remarks The @a cur_data should be freed using bundle_free().
+ * @param[in] handle The editable handle
+ * @param[out] cur_data Current data of bundle type
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ bundle *data;
+
+ ret = watchface_editable_get_cur_data(handle, &data);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || data == NULL);
+ return;
+
+ bundle_free(data);
+}
+ * @endcode
+ */
int watchface_editable_get_cur_data(const watchface_editable_h handle,
bundle **cur_data);
+
+/**
+ * @brief Gets the index of the current data.
+ * @since_tizen 5.0
+ * @param[in] handle The editable handle
+ * @param[in] idx Index
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ int cur_idx = 0;
+
+ ret = watchface_editable_get_cur_data_idx(handle, &cur_idx);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+}
+ * @endcode
+ */
int watchface_editable_get_cur_data_idx(const watchface_editable_h handle, int *idx);
+
+/**
+ * @brief Sets the index of the current data.
+ * @since_tizen 5.0
+ * @param[in] handle The editable handle
+ * @param[in] idx Index
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ int cur_idx = 1;
+
+ ret = watchface_editable_set_cur_data_idx(handle, cur_idx);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+}
+ * @endcode
+ */
+int watchface_editable_set_cur_data_idx(const watchface_editable_h handle, int idx);
+
+/**
+ * @brief Gets the id of editable.
+ * @since_tizen 5.0
+ * @param[in] handle The editable handle
+ * @param[out] editable_id Id
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ int ed_id = 0;
+
+ ret = watchface_editable_get_editable_id(handle, &ed_id);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+}
+ * @endcode
+ */
int watchface_editable_get_editable_id(const watchface_editable_h handle,
int *editable_id);
-int watchface_editable_get_geometry(const watchface_editable_h handle,
- watchface_editable_geo_h *geo);
-int watchface_editable_add_complication(watchface_editable_container_h handle,
- int editable_id, complication_h comp,
- watchface_editable_geo_h geo);
+/**
+ * @brief Gets the geometry of the editable.
+ * @since_tizen 5.0
+ * @remarks The @a geo should be released using watchface_editable_geometry_destroy().
+ * @param[in] handle The editable handle
+ * @param[out] geo Geometry of the editable
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+_watchface_editable_update_requested_cb(const watchface_editable_h handle,
+ int selected_idx, const watchface_editable_edit_state_e state,
+ void *user_data)
+{
+ int ret;
+ watchface_editable_geo_h geo;
-int watchface_editable_request_edit(watchface_editable_container_h handle,
- watchface_editable_update_requested_cb cb,
- void *user_data);
-int watchface_editable_add_edit_ready_cb(watchface_editable_edit_ready_cb cb,
- void *user_data);
+ ret = watchface_editable_get_geometry(handle, &geo);
+ if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
+ return;
+}
+ * @endcode
+ */
+int watchface_editable_get_geometry(const watchface_editable_h handle,
+ watchface_editable_geo_h *geo);
-int watchface_editable_remove_edit_ready_cb(watchface_editable_edit_ready_cb cb);
+/**
+ * @brief Gets the editable information for the specified id.
+ * @since_tizen 5.0
+ * @remarks The @a current_data should be freed using bundle_free().
+ * @param[in] editable_id Id of editable
+ * @param[in] current_data Bundle data containing current information
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data available
+ * @retval #WATCHFACE_COMPLICATION_ERROR_DB Database error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editable.h>
+{
+ int color_edit = 1;
+ bundle *selected_data = NULL;
+ watchface_editable_load_current_data(color_edit, &selected_data);
+}
+ * @endcode
+ */
int watchface_editable_load_current_data(int editable_id,
bundle **current_data);
+
/**
* @brief Creates geometry handle for editables.
* @since_tizen 5.0
* @remarks Created handle should be destroyed after used.
+ * @remarks The @a handle should be released using watchface_editable_geometry_destroy().
* @param[out] handle The editable geometry handle
- * @return #COMPLICATION_ERROR_NONE on success,
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_geometry_destory()
* @see watchface_editable_add_complication()
* @see watchface_editable_add_design_element()
* @brief Destroys editable's geometry handle.
* @since_tizen 5.0
* @param[in] handle The editable geometry handle
- * @return #COMPLICATION_ERROR_NONE on success,
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_geometry_create()
* @see watchface_editable_add_complication()
* @see watchface_editable_add_design_element()
* @param[in] y The editable geometry offset y
* @param[in] w The editable geometry width
* @param[in] h The editable geometry height
- * @return #COMPLICATION_ERROR_NONE on success,
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_geometry_create()
* @see watchface_editable_geometry_destroy()
* @see watchface_editable_add_complication()
* @param[out] y The editable geometry offset y
* @param[out] w The editable geometry width
* @param[out] h The editable geometry height
- * @return #COMPLICATION_ERROR_NONE on success,
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
* otherwise an error code (see COMPLICATION_ERROR_XXX) on failure
- * @retval #COMPLICATION_ERROR_NONE Successful
- * @retval #COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editable_geometry_create()
* @see watchface_editable_geometry_destroy()
* @see watchface_editable_add_complication()
}
#endif
-#endif // WATCHFACE_COMPLICATION_INCLUDE_WATCHFACE_EDITABLE_H_
+#endif /* __TIZEN_APPFW_WATCHFACE_EDITABLE_H__ */
* limitations under the License.
*/
-#ifndef WATCHFACE_EDITOR_INCLUDE_WATCHFACE_EDITOR_H_
-#define WATCHFACE_EDITOR_INCLUDE_WATCHFACE_EDITOR_H_
+#ifndef __TIZEN_APPFW_WATCHFACE_EDITOR_H__
+#define __TIZEN_APPFW_WATCHFACE_EDITOR_H__
#include <tizen.h>
#include <glib.h>
#include <bundle.h>
+
#include <watchface-complication.h>
#include <watchface-editable.h>
*/
/**
- * @addtogroup WATCHFACE_COMPLICATION_MODULE_INTERNAL
- * @{
+ * @brief Editable list handle.
+ * @since_tizen 5.0
*/
-
typedef GList *editable_list_h;
+
+/**
+ * @brief Called when setup application is run.
+ * @since_tizen 5.0
+ * @remarks The @a new_context should not be released.
+ * @param[in] editable_id The editable ID
+ * @param[in] new_context The new context data
+ * The @a new_context can be used only in the callback. To use outside, make a copy.
+ * @param[in] user_data The user data passed from the callback function
+ * @pre #watchface_editor_launch_setup_app()
+ */
typedef void (*watchface_editor_setup_result_cb)(int editable_id,
bundle *new_context, void *user_data);
+
+/**
+ * @brief Called when an edit request occurs.
+ * @since_tizen 5.0
+ * @remarks The @a list should not be released.
+ * @param[in] appid Application ID
+ * The @a appid can be used only in the callback. To use outside, make a copy.
+ * @param[in] list List of editable
+ * The @a list can be used only in the callback. To use outside, make a copy.
+ * @param[in] user_data The user data passed from the callback function
+ * @pre #watchface_editor_on_request_edit_cb_add()
+ */
typedef void (*watchface_editor_request_edit_cb)(const char *appid,
- editable_list_h list_h, void *user_data);
+ editable_list_h list, void *user_data);
+/**
+ * @brief Adds the callback function to edit.
+ * @since_tizen 5.0
+ * @param[in] cb The callback function
+ * @param[in] user_data The user data passed from the callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editor_request_edit_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ watchface_editor_add_request_edit_cb(_watchface_editor_request_edit_cb, NULL);
+}
+ * @endcode
+ */
int watchface_editor_add_request_edit_cb(watchface_editor_request_edit_cb cb,
void *user_data);
+
+/**
+ * @brief Removes the callback function.
+ * @since_tizen 5.0
+ * @param[in] cb The callback function
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editor_request_edit_cb()
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ watchface_editor_remove_request_edit_cb(_watchface_editor_request_edit_cb);
+}
+ * @endcode
+ */
int watchface_editor_remove_request_edit_cb(watchface_editor_request_edit_cb cb);
+
+/**
+ * @brief Applys changes in edit mode.
+ * @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/datasharing
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EDIT_NOT_READY Edit not ready
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ */
int watchface_editor_edit_complete(void);
-int watchface_editor_edit_preview(watchface_editable_h handle, int cur_data_idx);
+
+/**
+ * @brief Displays the preview of the selected index.
+ * @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/datasharing
+ * @param[in] handle The editable handle
+ * @param[in] cur_data_idx Index
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EDIT_NOT_READY Edit not ready
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ const watchface_editable_h handle;
+ int idx = 1;
+
+ //get editable form list
+
+ watchface_editor_edit_preview(handle, idx);
+}
+ * @endcode
+ */
+int watchface_editor_edit_preview(const watchface_editable_h handle, int cur_data_idx);
+
+/**
+ * @brief Cancels without making any changes in edit mode.
+ * @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/datasharing
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_EDIT_NOT_READY Edit not ready
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ */
int watchface_editor_edit_cancel(void);
+
+/**
+ * @brief Informs the watchface that the editor is ready to edit.
+ * @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/datasharing
+ * @param[in] appid Application ID
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ watchface_editor_notify_edit_ready("watchface_appid");
+}
+ * @endcode
+ */
int watchface_editor_notify_edit_ready(const char *appid);
+/**
+ * @brief Copys the editable list.
+ * @since_tizen 5.0
+ * @remarks The @a dest should be released using watchface_editor_editable_list_destroy().
+ * @param[in] source The editable list
+ * @param[out] dest The copied editable list
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see editable_list_h
+ * @see watchface_editor_editable_list_destroy()
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ editable_list_h list;
+ watchface_editor_editable_list_dup(source_list, &list);
+}
+ * @endcode
+ */
int watchface_editor_editable_list_dup(editable_list_h source, editable_list_h *dest);
+
+/**
+ * @brief Destroys list of editable.
+ * @since_tizen 5.0
+ * @param[in] list List of editable
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ watchface_editor_editable_list_destroy(list);
+}
+ * @endcode
+ */
int watchface_editor_editable_list_destroy(editable_list_h list);
+
+/**
+ * @brief Gets the size of the editable list.
+ * @since_tizen 5.0
+ * @param[in] list List of editable
+ * @param[out] size Size of editable list
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see editable_list_h
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ int size;
+ int ret = watchface_editor_editable_list_get_size(list, &size);
+}
+ * @endcode
+ */
int watchface_editor_editable_list_get_size(editable_list_h list, int *size);
+
+/**
+ * @brief Gets the nth editable from the editable list.
+ * @since_tizen 5.0
+ * @remarks The @a handle should not be released.
+ * @param[in] list List of editable
+ * @param[in] n
+ * @param[out] handle The nth editable
+ * The @a handle is managed by the platform and will be released when
+ * watchface_editor_editable_list_destroy() is called or watchface_editor_request_edit_cb() is finished.
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editable_h
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ const watchface_editable_h handle = watchface_editor_editable_list_nth(list, 0);
+}
+ * @endcode
+ */
int watchface_editor_editable_list_get_nth(editable_list_h list,
- int nth, watchface_editable_h *handle);
+ int n, watchface_editable_h *handle);
+
+/**
+ * @brief Gets the size of candidate in editable.
+ * @since_tizen 5.0
+ * @param[in] handle The editable handle
+ * @param[out] size The editable's candidate list size
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editable_h
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ int idx = 1;
+ int size;
+
+ watchface_editable_h handle;
+ watchface_editor_editable_list_nth(list, idx, &handle);
+
+ watchface_editor_editable_candidate_list_get_size(handle, &size);
+ if (candidates < 0)
+ return;
+}
+ * @endcode
+ */
int watchface_editor_editable_candidate_list_get_size(watchface_editable_h handle, int *size);
+
+/**
+ * @brief Gets the nth candidate data from the editable.
+ * @since_tizen 5.0
+ * @remarks The @a data should be released using bundle_free().
+ * @param[in] handle The editable handle
+ * @param[in] n Index
+ * @param[out] data The editable's nth candidate data
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_editable_h
+ * @par Sample code:
+ * @code
+#include <watchface-editor.h>
+{
+ int idx = 1;
+
+ //Get editable handle
+
+ bundle candidate;
+ watchface_editor_editable_candidate_list_get_nth(handle, idx, &candidate);
+ if (candidate == NULL)
+ return;
+}
+ * @endcode
+ */
int watchface_editor_editable_candidate_list_get_nth(
- watchface_editable_h handle, int nth, bundle **data);
+ watchface_editable_h handle, int n, bundle **data);
/**
* @brief Sets editable's contest.
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editor_launch_setup_app()
* @par Sample code:
* @code
/**
* @brief Launchs editable's setup app.
* @since_tizen 5.0
+ * @privilege http://tizen.org/privilege/appmanager.launch
+ * @privilege http://tizen.org/privilege/datasharing
* @param[in] handle The editable handle
* @param[in] cb The setup result callback
* @param[in] user_data The setup result callback's user data
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O error
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editor_is_setup_app_exist()
* @par Sample code:
* @code
* @retval #WATCHFACE_COMPLICATION_ERROR_NONE Successful
* @retval #WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
* @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
* @see watchface_editor_launch_setup_app()
* @par Sample code:
* @code
*/
int watchface_editor_is_setup_app_exist(watchface_editable_h handle, bool *exist);
+/**
+ * @brief Gets the provider's id of the candidate.
+ * @since_tizen 5.0
+ * @remarks The @a provider_id should be released using free().
+ * @param[in] complication
+ * @param[out] provider_id The name of the provider
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data available
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ const char *provider_id = NULL;
+
+ watchface_editor_get_complication_provider_id(complication, &provider_id);
+}
+ * @endcode
+ */
int watchface_editor_get_complication_provider_id(const bundle *complication,
- char **provider_id);
+ char **provider_id);
+
+/**
+ * @brief Gets complication type of the candidate.
+ * @since_tizen 5.0
+ * @param[in] complication
+ * @param[out] cur_type The type shown in the complication
+ * @return #WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NONE Success
+ * @retval #WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NO_DATA No data available
+ * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
+ * @see watchface_complication_type_e
+ * @par Sample code:
+ * @code
+#include <watchface-complication.h>
+{
+ watchface_complication_type_e type;
+
+ watchface_editor_get_complication_type(complication, &type);
+}
+ * @endcode
+ */
int watchface_editor_get_complication_type(const bundle *complication,
- watchface_complication_type_e *cur_type);
+ watchface_complication_type_e *cur_type);
/**
* @}
}
#endif
-#endif // WATCHFACE_EDITOR_INCLUDE_WATCHFACE_EDITOR_H_
+#endif /* __TIZEN_APPFW_WATCHFACE_EDITOR_H__ */