Tizen Native API  5.5

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

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]handleThe editable container handle
[in]editor_appidThe name of editor The editor_appid can be used only in the callback. To use outside, make a copy.
[in]user_dataThe user data passed from the callback function
See also:
watchface_editable_add_edit_ready_cb()

Enumeration for Editable state.

Since :
5.0
typedef void* watchface_editable_h

The editable handle.

Since :
5.0

The editable highlight info handle.

Since :
5.0

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]handleThe editable handle The handle can be used only in the callback.
[in]selected_idxIndex
[in]stateEditable state
[in]user_dataThe user data passed from the callback function
See also:
watchface_editable_edit_state_e

Enumeration Type Documentation

Enumeration for Editable state.

Since :
5.0
Enumerator:
WATCHFACE_EDITABLE_EDIT_STATE_COMPLETE 

Complete

WATCHFACE_EDITABLE_EDIT_STATE_ONGOING 

Ongoing

WATCHFACE_EDITABLE_EDIT_STATE_CANCEL 

Cancel

Enumeration for Editable shape type.

Since :
5.0
Enumerator:
WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE 

Circle

WATCHFACE_EDITABLE_SHAPE_TYPE_RECT 

Rectangle


Function Documentation

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]handleThe editable container handle
[in]editable_idEditable id
[in]compComplication handle
[in]highlightHighlight information. It could be NULL
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_EXIST_IDThe 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]handleThe editable container
[in]editable_idEditable id
[in]cur_data_idxThe index of the currently set data
[in]list_handleList of candidate data
[in]highlightHighlight information. It could be NULL
[in]editable_nameName of editable
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_EXIST_IDThe given editable_id already exists
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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);
}

Adds the callback function to request edit.

Since :
5.0
Parameters:
[in]cbThe callback function
[in]user_dataThe user data to pass to the callback function
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_IO_ERRORI/O Error
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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);
}

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]handleThe candidates list handle
[in]candidateThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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]handleThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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]handleThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid 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]handleThe editable handle
[out]cur_dataCurrent data of bundle type
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_NO_DATANo data
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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]handleThe editable handle
[in]idxIndex
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid 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]handleThe editable handle
[out]editable_idId
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid 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]handleThe editable handle
[out]editable_nameName of editable
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut of memory
WATCHFACE_COMPLICATION_ERROR_NO_DATANo 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);
}

Gets editable's highlight handle.

Since :
5.0
Remarks:
The highlight should be release usinig watchface_editable_highlight_destroy().
Parameters:
[in]handleThe editable handle
[out]highlightThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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]handleThe editable handle
[in]nIndex
[in]nth_dataBundle data
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_NO_DATANo data
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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);
}

Creates editable's highlight info handle.

Since :
5.0
Remarks:
The handle should be freed using watchface_editable_highlight_destroy().
Parameters:
[out]handleThe editable's highlight handle
[in]shape_typeThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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);
}
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]handleThe editable's highlight handle
[out]xThe editable geometry x
[out]yThe editable geometry y
[out]wThe editable geometry w
[out]hThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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_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]handleThe editable's highlight handle
[out]xThe editable geometry offset x
[out]yThe editable geometry offset y
[out]wThe editable geometry width
[out]hThe 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_NONESuccessful
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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_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_idId of editable
[in]current_dataBundle data containing current information
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_NO_DATANo data available
WATCHFACE_COMPLICATION_ERROR_DBDatabase error
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut 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]cbThe callback function
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
See also:
watchface_editable_edit_ready_cb()
Sample code:
#include <watchface-editable.h>
{
    watchface_editable_remove_edit_ready_cb(_watchface_edit_ready_cb);
}

Requests editor to edit.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/datasharing
Parameters:
[in]handleThe editable container handle
[in]cbThe callback function
[in]user_dataThe user data to pass to the callback function
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_PERMISSION_DENIEDPermission denied
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid parameter
WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORYOut of memory
WATCHFACE_COMPLICATION_ERROR_IO_ERRORI/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]handleThe editable handle
[in]editable_nameName of editable
Returns:
WATCHFACE_COMPLICATION_ERROR_NONE if success, other value if failure
Return values:
WATCHFACE_COMPLICATION_ERROR_NONESuccess
WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTEDNot supported
WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETERInvalid 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;
}