const char *extra_data);
/**
- * @brief Sets screen reader text for shared data.
- * @since_tizen 5.0
- * @remarks @a screen_reader_text can be added to every type of shared data.
- * @param[in] shared_data The data which will be shared with watch application
- * @param[in] screen_reader_text The screen reader text
- * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see #watchface_complication_error_e) 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 I/O error
- * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
- * @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)
-{
- watchface_complication_provider_data_set_screen_reader_text(shared_data, "screen reader text");
-}
- * @endcode
- */
-int watchface_complication_provider_data_set_screen_reader_text(
- bundle *shared_data, const char *screen_reader_text);
-
-/**
* @brief Checks whether app is launched by complication touch or not.
* @since_tizen 5.0
* @remarks @a is_touch_launch is true when provider app is launched by watchface_complication_touch_launch().
return _add_bundle_data(shared_data, EXTRA_DATA_KEY, extra_data);
}
-extern "C" EXPORT_API
-int watchface_complication_provider_data_set_screen_reader_text(
- bundle* shared_data, const char* screen_reader_text) {
- if (shared_data == NULL || screen_reader_text == NULL) {
- LOGE("Invalid param");
- return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
- }
-
- return _add_bundle_data(shared_data, SCREEN_READER_TEXT_KEY, screen_reader_text);
-}
-
extern "C" EXPORT_API int watchface_complication_provider_is_touch_launch(
app_control_h handle, bool* is_touch_launch) {
int ret;
#define IMAGE_KEY "__IMAGE_KEY__"
#define DATA_TYPE_KEY "__DATA_TYPE_KEY__"
#define EXTRA_DATA_KEY "__EXTRA_DATA_KEY__"
-#define SCREEN_READER_TEXT_KEY "__SCREEN_READER_TEXT_KEY__"
#define TOUCH_LAUNCH_CONTEXT_KEY "__TOUCH_LAUNCH_CONTEXT_KEY__"
#define TOUCH_LAUNCH_PROVIDER_ID_KEY "__TOUCH_LAUNCH_PROVIDER_ID_KEY__"
#define TOUCH_LAUNCH_TYPE_KEY "__TOUCH_LAUNCH_TYPE_KEY__"
char **extra_data);
/**
- * @brief Gets screen reader text from complication data.
- * @since_tizen 5.0
- * @remarks The @a screen_reader_text should be freed using free().
- * @param[in] data The data received from complication provider app
- * @param[out] screen_reader_text The screen reader text
- * @return #WATCHFACE_COMPLICATION_ERROR_NONE on success,
- * otherwise an error code (see #watchface_complication_error_e) 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_NO_DATA No data
- * @retval #WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported
- * @see watchface_complication_updated_cb()
- * @par Sample code:
- * @code
-#include <watchface-complication.h>
-void _on_complication_update(int complication_id,
- const char *provider_id,
- watchface_complication_type_e type,
- const bundle *data, void *user_data)
-{
- char *screen_reader_text;
- watchface_complication_data_get_screen_reader_text(data, &screen_reader_text);
- ...
- free(screen_reader_text);
-}
- * @endcode
- */
-int watchface_complication_data_get_screen_reader_text(const bundle *data,
- char **screen_reader_text);
-
-/**
* @brief Launches current complication's provider application.
* @details This function launchs the provider application with extra data,
* so that provider can tell it is launched by touching.
return __get_complication_data(data, EXTRA_DATA_KEY, extra_data);
}
-extern "C" EXPORT_API int watchface_complication_data_get_screen_reader_text(
- const bundle* data, char** screen_reader_text) {
- if (data == NULL || screen_reader_text == NULL) {
- LOGE("Invalid data !!");
- return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
- }
-
- return __get_complication_data(data, SCREEN_READER_TEXT_KEY, screen_reader_text);
-}
-
extern "C" EXPORT_API int watchface_complication_touch_launch(
complication_h handle) {
if (handle == NULL)