Tizen Native API
6.0
|
All watch applications can request editing for their resources like complication and design elements to editor using watchface editable.
Required Header
#include <watchface-editable.h>
Overview
It provides service that request editing watchface editable data to editor and receive result from editor.
Functions | |
int | watchface_editable_candidates_list_create (complication_candidates_list_h *handle) |
Creates candidates list. | |
int | watchface_editable_candidates_list_add (complication_candidates_list_h handle, bundle *candidate) |
Adds candidate data to the candidates list. | |
int | watchface_editable_candidates_list_destroy (complication_candidates_list_h handle) |
Destroys candidates list. | |
int | watchface_editable_add_design_element (watchface_editable_container_h handle, int editable_id, int cur_data_idx, complication_candidates_list_h list_handle, watchface_editable_highlight_h highlight, const char *editable_name) |
Adds the design element to the editable container handle. | |
int | watchface_editable_add_complication (watchface_editable_container_h handle, int editable_id, complication_h comp, watchface_editable_highlight_h highlight) |
Adds a complication to the editable container handle. | |
int | watchface_editable_request_edit (watchface_editable_container_h handle, watchface_editable_update_requested_cb cb, void *user_data) |
Requests editor to edit. | |
int | watchface_editable_add_edit_ready_cb (watchface_editable_edit_ready_cb cb, void *user_data) |
Adds the callback function to request edit. | |
int | watchface_editable_remove_edit_ready_cb (watchface_editable_edit_ready_cb cb) |
Removes the callback function to request edit. | |
int | watchface_editable_get_editable_name (const watchface_editable_h handle, char **editable_name) |
Gets the name of the editable. | |
int | watchface_editable_set_editable_name (const watchface_editable_h handle, const char *editable_name) |
Sets the name in editable. | |
int | watchface_editable_get_nth_data (const watchface_editable_h handle, int n, bundle **nth_data) |
Retrieves the n-th data of editable. | |
int | watchface_editable_get_current_data (const watchface_editable_h handle, bundle **cur_data) |
Retrieves the current data in editable. | |
int | watchface_editable_get_current_data_idx (const watchface_editable_h handle, int *idx) |
Gets the index of the current data. | |
int | watchface_editable_get_editable_id (const watchface_editable_h handle, int *editable_id) |
Gets the id of editable. | |
int | watchface_editable_load_current_data (int editable_id, bundle **current_data) |
Gets the editable information for the specified id. | |
int | watchface_editable_highlight_create (watchface_editable_highlight_h *handle, watchface_editable_shape_type_e shape_type) |
Creates editable's highlight info handle. | |
int | watchface_editable_highlight_set_geometry (watchface_editable_highlight_h handle, int x, int y, int w, int h) |
Sets editable's highlight geometry info. | |
int | watchface_editable_highlight_get_geometry (watchface_editable_highlight_h handle, int *x, int *y, int *w, int *h) |
Gets editable's highlight geometry info. | |
int | watchface_editable_highlight_set_shape_type (watchface_editable_highlight_h handle, watchface_editable_shape_type_e shape) |
Sets editable's highlight shape type. | |
int | watchface_editable_highlight_get_shape_type (watchface_editable_highlight_h handle, watchface_editable_shape_type_e *shape) |
Gets editable's highlight shape type. | |
int | watchface_editable_highlight_destroy (watchface_editable_highlight_h handle) |
Destroys editable's highlight info. | |
int | watchface_editable_get_highlight (const watchface_editable_h handle, watchface_editable_highlight_h *highlight) |
Gets editable's highlight handle. | |
Typedefs | |
typedef void * | watchface_editable_h |
The editable handle. | |
typedef void * | watchface_editable_container_h |
The container handle for editable. | |
typedef void * | watchface_editable_highlight_h |
The editable highlight info handle. | |
typedef enum _editable_edit_state | watchface_editable_edit_state_e |
Enumeration for Editable state. | |
typedef enum _editable_shape_type | watchface_editable_shape_type_e |
Enumeration for Editable shape type. | |
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) |
Called when an editable requests an edit. | |
typedef void(* | watchface_editable_edit_ready_cb )(watchface_editable_container_h handle, const char *editor_appid, void *user_data) |
Called when the editor is ready to edit. | |
typedef struct complication_candidates_list_ * | complication_candidates_list_h |
The candidates list handle. |
Typedef Documentation
typedef struct complication_candidates_list_* complication_candidates_list_h |
The candidates list handle.
- Since :
- 5.0
typedef void* watchface_editable_container_h |
The container handle for editable.
- Since :
- 5.0
typedef void(* watchface_editable_edit_ready_cb)(watchface_editable_container_h handle, const char *editor_appid, void *user_data) |
Called when the editor is ready to edit.
- Since :
- 5.0
- Remarks:
- The handle should not be released.
- The handle can be used only in the callback.
- Parameters:
-
[in] handle The editable container handle [in] editor_appid The name of editor The editor_appid can be used only in the callback. To use outside, make a copy. [in] user_data The user data passed from the callback function
typedef enum _editable_edit_state watchface_editable_edit_state_e |
Enumeration for Editable state.
- Since :
- 5.0
typedef void* watchface_editable_h |
The editable handle.
- Since :
- 5.0
typedef void* watchface_editable_highlight_h |
The editable highlight info handle.
- Since :
- 5.0
typedef enum _editable_shape_type watchface_editable_shape_type_e |
Enumeration for Editable shape type.
- Since :
- 5.0
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) |
Called when an editable requests an edit.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable handle The handle can be used only in the callback. [in] selected_idx Index [in] state Editable state [in] user_data The user data passed from the callback function
- See also:
- watchface_editable_edit_state_e
Enumeration Type Documentation
enum _editable_edit_state |
enum _editable_shape_type |
Function Documentation
int watchface_editable_add_complication | ( | watchface_editable_container_h | handle, |
int | editable_id, | ||
complication_h | comp, | ||
watchface_editable_highlight_h | highlight | ||
) |
Adds a complication to the editable container handle.
- Since :
- 5.0
- Remarks:
- If watch application developer want to draw it's own style highlight, put NULL value for highlight parameter and draw highlight in watchface_editable_update_requested_cb(). Otherwise system editor will draw highlight.
- Parameters:
-
[in] handle The editable container handle [in] editable_id Editable id [in] comp Complication handle [in] highlight Highlight information. It could be NULL
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_EXIST_ID The given editable_id already exists
- Sample code:
#include <watchface-editable.h> void _watchface_editable_edit_ready_cb(watchface_editable_container_h handle, const char *editor_appid, void *user_data) { int comp_id = 1; watchface_editable_highlight_h hi; watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); watchface_editable_highlight_set_geometry(hi, 50, 50, 100, 100); // add the created complication watchface_editable_add_complication(handle, comp_id, comp, hi); watchface_editable_highlight_destroy(hi); }
int watchface_editable_add_design_element | ( | watchface_editable_container_h | handle, |
int | editable_id, | ||
int | cur_data_idx, | ||
complication_candidates_list_h | list_handle, | ||
watchface_editable_highlight_h | highlight, | ||
const char * | editable_name | ||
) |
Adds the design element to the editable container handle.
The design element will be displayed on the editor app's editables list.
- Since :
- 5.0
- Remarks:
- If watch application developer want to draw it's own style highlight, put NULL value for highlight parameter and draw highlight in watchface_editable_update_requested_cb(). Otherwise system editor will draw highlight.
- Parameters:
-
[in] handle The editable container [in] editable_id Editable id [in] cur_data_idx The index of the currently set data [in] list_handle List of candidate data [in] highlight Highlight information. It could be NULL [in] editable_name Name of editable
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_EXIST_ID The given editable_id already exists WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_edit_ready_cb()
- watchface_editable_candidates_list_add()
- watchface_editable_candidates_list_create()
- watchface_editable_request_edit()
- watchface_editable_update_requested_cb()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_create()
- watchface_editable_highlight_destroy()
- Sample code:
#include <watchface-editable.h> void _watchface_editable_edit_ready_cb(watchface_editable_container_h handle, const char *editor_appid, void *user_data) { complication_candidates_list_h list_handle; watchface_editable_highlight_h hi; bundle *candidate1; bundle *candidate2; int ret; ret = watchface_editable_candidates_list_create(&list_handle); if (ret != WATCHFACE_COMPLICATION_ERROR_NONE) return; candidate1 = bundle_create(); bundle_add_str(candidate1, "TEST_COLOR", "RED"); watchface_editable_candidates_list_add(list_handle, candidate1); bundle_free(candidate1); candidate2 = bundle_create(); bundle_add_str(candidate2, "TEST_COLOR", "YELLOW"); watchface_editable_candidates_list_add(list_handle, candidate2); bundle_free(candidate2); watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); watchface_editable_highlight_set_geometry(hi, 50, 50, 100, 100); ret = watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx, list_handle, hi, "Color"); watchface_editable_highlight_destroy(hi); watchface_editable_candidates_list_destroy(list_handle); }
int watchface_editable_add_edit_ready_cb | ( | watchface_editable_edit_ready_cb | cb, |
void * | user_data | ||
) |
Adds the callback function to request edit.
- Since :
- 5.0
- Parameters:
-
[in] cb The callback function [in] user_data The user data to pass to the callback function
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O Error WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_edit_ready_cb()
- Sample code:
#include <watchface-editable.h> { watchface_editable_add_edit_ready_cb(_watchface_editable_edit_ready_cb, NULL); }
int watchface_editable_candidates_list_add | ( | complication_candidates_list_h | handle, |
bundle * | candidate | ||
) |
Adds candidate data to the candidates list.
- Since :
- 5.0
- Remarks:
- Created candidate data will be freed when watchface_editable_candidates_list_destroy() API is called.
- Parameters:
-
[in] handle The candidates list handle [in] candidate The candidate data
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_candidates_list_create()
- watchface_editable_candidates_list_destroy()
- watchface_editable_add_design_element()
- Sample code:
#include <watchface-complication.h> void _watchface_editable_edit_ready_cb(editable_container_h handle, const char *editor_appid, void *user_data) { complication_candidates_list_h list_handle; watchface_editable_highlight_h hi; bundle *candidate1; bundle *candidate2; int ret; ret = watchface_editable_candidates_list_create(&list_handle); if (ret != WATCHFACE_COMPLICATION_ERROR_NONE) return; candidate1 = bundle_create(); bundle_add_str(candidate1, "TEST_COLOR", "RED"); watchface_editable_candidates_list_add(list_handle, candidate1); bundle_free(candidate1); candidate2 = bundle_create(); bundle_add_str(candidate2, "TEST_COLOR", "YELLOW"); watchface_editable_candidates_list_add(list_handle, candidate2); bundle_free(candidate2); watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); watchface_editable_highlight_set_geometry(hi, 50, 50, 100, 100); ret = watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx, list_handle, hi, "Color"); watchface_editable_highlight_destroy(hi); watchface_editable_candidates_list_destroy(list_handle); }
Creates candidates list.
The candidates list created by this function will be shown on the editor app's candidates list.
- Since :
- 5.0
- Remarks:
- Created candidates list should be destroyed after used.
- Parameters:
-
[in] handle The candidates list handle
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_candidates_list_add()
- watchface_editable_candidates_list_destroy()
- watchface_editable_add_design_element()
- Sample code:
#include <watchface-complication.h> { complication_candidates_list_h handle; int ret = watchface_editable_candidates_list_create(&handle); if (ret != WATCHFACE_COMPLICATION_ERROR_NONE) return; }
Destroys candidates list.
- Since :
- 5.0
- Parameters:
-
[in] handle The complication allowed list handle
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- watchface_editable_candidates_list_add()
- watchface_editable_candidates_list_create()
- watchface_editable_add_design_element()
- Sample code:
#include <watchface-complication.h> void _watchface_editable_edit_ready_cb(editable_container_h handle, const char *editor_appid, void *user_data) { complication_candidates_list_h list_handle; bundle *candidate1; bundle *candidate2; int ret; ret = watchface_editable_candidates_list_create(&list_handle); if (ret != WATCHFACE_COMPLICATION_ERROR_NONE) return; candidate1 = bundle_create(); bundle_add_str(candidate1, "TEST_COLOR", "RED"); watchface_editable_candidates_list_add(list_handle, candidate1); bundle_free(candidate1); candidate2 = bundle_create(); bundle_add_str(candidate2, "TEST_COLOR", "YELLOW"); watchface_editable_candidates_list_add(list_handle, candidate2); bundle_free(candidate2); watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); watchface_editable_highlight_set_geometry(hi, 50, 50, 100, 100); ret = watchface_editable_add_design_element(handle, COLOR_EDIT, cur_idx, list_handle, hi, "Color"); watchface_editable_highlight_destroy(hi); watchface_editable_candidates_list_destroy(list_handle); }
int watchface_editable_get_current_data | ( | const watchface_editable_h | handle, |
bundle ** | cur_data | ||
) |
Retrieves the current data in editable.
- Since :
- 5.0
- Remarks:
- The cur_data should be freed using bundle_free().
- Parameters:
-
[in] handle The editable handle [out] cur_data Current data of bundle type
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_NO_DATA No data WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- Sample 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_current_data(handle, &data); if (ret != WATCHFACE_COMPLICATION_ERROR_NONE || data == NULL); return; bundle_free(data); }
int watchface_editable_get_current_data_idx | ( | const watchface_editable_h | handle, |
int * | idx | ||
) |
Gets the index of the current data.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable handle [in] idx Index
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample 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_current_data_idx(handle, &cur_idx); if (ret != WATCHFACE_COMPLICATION_ERROR_NONE) return; }
int watchface_editable_get_editable_id | ( | const watchface_editable_h | handle, |
int * | editable_id | ||
) |
Gets the id of editable.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable handle [out] editable_id Id
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample 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; }
int watchface_editable_get_editable_name | ( | const watchface_editable_h | handle, |
char ** | editable_name | ||
) |
Gets the name of the editable.
- Since :
- 5.0
- Remarks:
- The editable_name should be freed using free().
- Parameters:
-
[in] handle The editable handle [out] editable_name Name of editable
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory WATCHFACE_COMPLICATION_ERROR_NO_DATA No data
- Sample 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); }
int watchface_editable_get_highlight | ( | const watchface_editable_h | handle, |
watchface_editable_highlight_h * | highlight | ||
) |
Gets editable's highlight handle.
- Since :
- 5.0
- Remarks:
- The highlight should be release usinig watchface_editable_highlight_destroy().
- Parameters:
-
[in] handle The editable handle [out] highlight The editable's highlight handle
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_create()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_get_geometry()
- watchface_editable_highlight_set_shape_type()
- watchface_editable_highlight_get_shape_type()
- watchface_editable_highlight_destroy()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; int ret = watchface_editable_get_highlight(ed, &handle); watchface_editable_highlight_destroy(handle); }
int watchface_editable_get_nth_data | ( | const watchface_editable_h | handle, |
int | n, | ||
bundle ** | nth_data | ||
) |
Retrieves the n-th data of editable.
- Since :
- 5.0
- Remarks:
- The nth_data should be freed using bundle_free().
- Parameters:
-
[in] handle The editable handle [in] n Index [in] nth_data Bundle data
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_NO_DATA No data WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- Sample 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); }
int watchface_editable_highlight_create | ( | watchface_editable_highlight_h * | handle, |
watchface_editable_shape_type_e | shape_type | ||
) |
Creates editable's highlight info handle.
- Since :
- 5.0
- Remarks:
- The handle should be freed using watchface_editable_highlight_destroy().
- Parameters:
-
[out] handle The editable's highlight handle [in] shape_type The editable's highlight shape type
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_get_geometry()
- watchface_editable_highlight_set_shape_type()
- watchface_editable_highlight_get_shape_type()
- watchface_editable_highlight_destroy()
- watchface_editable_get_highlight()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; int ret = watchface_editable_highlight_create(&handle, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); }
Destroys editable's highlight info.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable's highlight handle
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_create()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_set_shape_type()
- watchface_editable_highlight_get_shape_type()
- watchface_editable_get_highlight()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; int ret = watchface_editable_highlight_create(&handle, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); ret = watchface_editable_highlight_destroy(handle); }
int watchface_editable_highlight_get_geometry | ( | watchface_editable_highlight_h | handle, |
int * | x, | ||
int * | y, | ||
int * | w, | ||
int * | h | ||
) |
Gets editable's highlight geometry info.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable's highlight handle [out] x The editable geometry x [out] y The editable geometry y [out] w The editable geometry w [out] h The editable geometry h
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_create()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_set_shape_type()
- watchface_editable_highlight_get_shape_type()
- watchface_editable_highlight_destroy()
- watchface_editable_get_highlight()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; int x, y, w, h; int ret = watchface_editable_get_highlight(ed, &handle); ret = watchface_editable_highlight_get_geometry(handle, &x, &y, &w, &h); }
int watchface_editable_highlight_get_shape_type | ( | watchface_editable_highlight_h | handle, |
watchface_editable_shape_type_e * | shape | ||
) |
Gets editable's highlight shape type.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable's highlight handle [out] shape The editable shape type
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_create()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_get_geometry()
- watchface_editable_highlight_destroy()
- watchface_editable_get_highlight()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; watchface_editable_shape_type_e shape; int ret = watchface_editable_get_highlight(ed, &handle); ret = watchface_editable_highlight_get_shape_type(handle, &shape); }
int watchface_editable_highlight_set_geometry | ( | watchface_editable_highlight_h | handle, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Sets editable's highlight geometry info.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable's highlight handle [out] x The editable geometry offset x [out] y The editable geometry offset y [out] w The editable geometry width [out] h The editable geometry height
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_create()
- watchface_editable_highlight_get_geometry()
- watchface_editable_highlight_set_shape_type()
- watchface_editable_highlight_get_shape_type()
- watchface_editable_highlight_destroy()
- watchface_editable_get_highlight()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; int ret = watchface_editable_highlight_create(&handle, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); ret = watchface_editable_highlight_set_geometry(handle, 50, 50, 100, 100); }
int watchface_editable_highlight_set_shape_type | ( | watchface_editable_highlight_h | handle, |
watchface_editable_shape_type_e | shape | ||
) |
Sets editable's highlight shape type.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable's highlight handle [in] shape The editable shape type
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE on success, otherwise an error code (see watchface_complication_error_e) on failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Successful WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- watchface_editable_highlight_create()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_get_geometry()
- watchface_editable_highlight_get_shape_type()
- watchface_editable_highlight_destroy()
- watchface_editable_get_highlight()
- Sample code:
#include <watchface-complication.h> { watchface_editable_highlight_h handle; int ret = watchface_editable_highlight_create(&handle, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); ret = watchface_editable_highlight_set_shape_type(handle, WATCHFACE_EDITABLE_SHAPE_TYPE_RECT); }
int watchface_editable_load_current_data | ( | int | editable_id, |
bundle ** | current_data | ||
) |
Gets the editable information for the specified id.
- Since :
- 5.0
- Remarks:
- The current_data should be freed using bundle_free().
- Parameters:
-
[in] editable_id Id of editable [in] current_data Bundle data containing current information
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_NO_DATA No data available WATCHFACE_COMPLICATION_ERROR_DB Database error WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <watchface-editable.h> { int color_edit = 1; bundle *selected_data = NULL; watchface_editable_load_current_data(color_edit, &selected_data); }
Removes the callback function to request edit.
- Since :
- 5.0
- Parameters:
-
[in] cb The callback function
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- watchface_editable_edit_ready_cb()
- Sample code:
#include <watchface-editable.h> { watchface_editable_remove_edit_ready_cb(_watchface_edit_ready_cb); }
int watchface_editable_request_edit | ( | watchface_editable_container_h | handle, |
watchface_editable_update_requested_cb | cb, | ||
void * | user_data | ||
) |
Requests editor to edit.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/datasharing
- Parameters:
-
[in] handle The editable container handle [in] cb The callback function [in] user_data The user data to pass to the callback function
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIED Permission denied WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY Out of memory WATCHFACE_COMPLICATION_ERROR_IO_ERROR I/O Error
- See also:
- watchface_editable_update_requested_cb()
- watchface_editable_highlight_set_geometry()
- watchface_editable_highlight_create()
- watchface_editable_highlight_destroy()
- Sample code:
#include <watchface-editable.h> void _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; bundle *design_element; complication_candidates_list_h candidates_list = NULL; watchface_editable_highlight_h hi; watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); watchface_editable_highlight_set_geometry(hi, 50, 50, 100, 100); // create, add complication watchface_editable_add_complication(handle, comp_id, comp, hi); // 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"); // set editable geometry information for design element watchface_editable_highlight_set_geometry(hi, 100, 50, 100, 100); watchface_editable_candidates_list_add(candidates_list, design_element); watchface_editable_add_design_element(handle, design_element_id, 0, candidatelist, hi, "Color"); watchface_editable_candidates_list_destroy(candidates_list); watchface_editable_highlight_destroy(hi); watchface_editable_request_edit(handle, _watchface_editable_update_requested_cb, user_data); }
int watchface_editable_set_editable_name | ( | const watchface_editable_h | handle, |
const char * | editable_name | ||
) |
Sets the name in editable.
- Since :
- 5.0
- Parameters:
-
[in] handle The editable handle [in] editable_name Name of editable
- Returns:
- WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
- Return values:
-
WATCHFACE_COMPLICATION_ERROR_NONE Success WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED Not supported WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample 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; }