Tizen Native API
9.0
|
The MMI Common API provides common functions for sending and receiving data and signals to/from the MMI framework.
Required Header
#include <mmi.h>
Overview
The MMI Common API allows you to:
- create/destroy various types of data objects that can be transferred between MMI nodes, workflows and applications
- create/destroy attributes that are used to set the properties of MMI nodes and workflows
- create/destroy signals that are used to notify MMI nodes and workflows about events
- serialize/deserialize data objects, attributes, and signals
Functions | |
int | mmi_attribute_create (mmi_primitive_value_h value, const char *name, mmi_attribute_h *attribute) |
Creates a new MMI attribute with a given primitive value and name. | |
int | mmi_attribute_set_name (mmi_attribute_h attribute, const char *name) |
Sets the name of an MMI attribute. | |
int | mmi_attribute_get_name (mmi_attribute_h attribute, char **name) |
Retrieves the name of an MMI attribute. | |
int | mmi_attribute_get_value (mmi_attribute_h attribute, mmi_primitive_value_h *value) |
Retrieves the primitive value of an MMI attribute. | |
int | mmi_attribute_clone (mmi_attribute_h attribute, mmi_attribute_h *cloned) |
Clones an existing MMI attribute. | |
int | mmi_attribute_destroy (mmi_attribute_h attribute) |
Destroys an MMI attribute. | |
int | mmi_attribute_to_bytes (mmi_attribute_h attribute, unsigned char **bytes, size_t *length) |
Converts an MMI attribute to a byte array. | |
int | mmi_attribute_from_bytes (const unsigned char *bytes, size_t length, mmi_attribute_h *attribute) |
Reconstructs an MMI attribute from a byte array. | |
int | mmi_attribute_create_string_array (const char *name, const char *strings[], size_t count, mmi_attribute_h *attribute) |
Creates a new MMI attribute containing a string array. | |
int | mmi_data_create_bool (bool value, mmi_data_h *data) |
Creates a boolean data object. | |
int | mmi_data_create_int (int value, mmi_data_h *data) |
Creates an integer data object. | |
int | mmi_data_create_float (float value, mmi_data_h *data) |
Creates a float data object. | |
int | mmi_data_create_text (const char *value, mmi_data_h *data) |
Creates a text data object. | |
int | mmi_data_create_audio (const void *ptr, size_t len, mmi_data_h *data) |
Creates an audio data object. | |
int | mmi_data_create_video (const void *ptr, size_t len, mmi_data_h *data) |
Creates a video data object. | |
int | mmi_data_create_user_identification (const void *ptr, size_t len, mmi_data_h *data) |
Creates a user identification data object. | |
int | mmi_data_create_coordinate (int x, int y, mmi_data_h *data) |
Creates a coordinate data object. | |
int | mmi_data_create_bounding_box (int x, int y, int w, int h, mmi_data_h *data) |
Creates a bounding box data object. | |
int | mmi_data_create_array (mmi_data_h *array_handle) |
Creates a new data array handle. | |
int | mmi_data_add_array_element (mmi_data_h array_handle, mmi_data_h element) |
Adds an element to a data array. | |
int | mmi_data_create_struct (mmi_data_h *struct_handle) |
Creates a new data structure handle. | |
int | mmi_data_set_struct_element (mmi_data_h struct_handle, const char *name, mmi_data_h element) |
Sets an element in a data structure. | |
int | mmi_data_get_type (mmi_data_h data, mmi_data_type_e *type) |
Retrieves the type of a data handle. | |
int | mmi_data_get_bool (mmi_data_h data, bool *value) |
Retrieves the boolean value from a data handle. | |
int | mmi_data_get_int (mmi_data_h data, int *value) |
Retrieves the integer value from a data handle. | |
int | mmi_data_get_float (mmi_data_h data, float *value) |
Retrieves the floating-point value from a data handle. | |
int | mmi_data_get_text (mmi_data_h data, const char **text) |
Retrieves the text string from a data handle. | |
int | mmi_data_get_audio (mmi_data_h data, const void **ptr, size_t *len) |
Retrieves the audio data from a data handle. | |
int | mmi_data_get_video (mmi_data_h data, const void **ptr, size_t *len) |
Retrieves the video data from a data handle. | |
int | mmi_data_get_user_identification (mmi_data_h data, const void **ptr, size_t *len) |
Retrieves the user identification data from a data handle. | |
int | mmi_data_get_coordinate (mmi_data_h data, int *x, int *y) |
Retrieves the coordinate data from a data handle. | |
int | mmi_data_get_bounding_box (mmi_data_h data, int *x, int *y, int *w, int *h) |
Retrieves the bounding box of the given data. | |
int | mmi_data_get_array_count (mmi_data_h array, size_t *count) |
Gets the number of elements in the array. | |
int | mmi_data_get_array_element (mmi_data_h array, size_t index, mmi_data_h *element) |
Retrieves an element from the array at the specified index. | |
int | mmi_data_get_struct_element (mmi_data_h struct_handle, const char *name, mmi_data_h *element) |
Retrieves an element from the structure by its name. | |
int | mmi_data_get_struct_count (mmi_data_h struct_handle, size_t *count) |
Gets the number of elements in the structure. | |
int | mmi_data_get_struct_element_name (mmi_data_h struct_handle, size_t index, const char **name) |
Retrieves the name of the element at the specified index in the structure. | |
int | mmi_data_get_struct_element_value (mmi_data_h struct_handle, size_t index, mmi_data_h *element) |
Retrieves the of the element at the specified index in the structure. | |
int | mmi_data_to_bytes (mmi_data_h data, unsigned char **bytes, size_t *length) |
Converts the MMI data handle to a byte array. | |
int | mmi_data_from_bytes (unsigned char *bytes, size_t length, mmi_data_h *data) |
Creates an MMI data handle from a byte array. | |
int | mmi_data_destroy (mmi_data_h data) |
Destroys the given MMI data handle. | |
int | mmi_primitive_value_create_int (int data, mmi_primitive_value_h *handle) |
Creates a primitive value handle for an integer. | |
int | mmi_primitive_value_create_float (float data, mmi_primitive_value_h *handle) |
Creates a primitive value handle for a floating-point number. | |
int | mmi_primitive_value_create_string (const char *data, mmi_primitive_value_h *handle) |
Creates a primitive value handle for a string. | |
int | mmi_primitive_value_create_bool (bool data, mmi_primitive_value_h *handle) |
Creates a primitive value handle for a boolean. | |
int | mmi_primitive_value_create_array (mmi_primitive_value_h *handle) |
Creates a primitive value handle for an array. | |
int | mmi_primitive_value_add_array_element (mmi_primitive_value_h array, mmi_primitive_value_h element) |
Adds an element to a primitive value array. | |
int | mmi_primitive_value_get_type (mmi_primitive_value_h handle, mmi_primitive_value_type_e *type) |
Gets the type of the primitive value. | |
int | mmi_primitive_value_get_int (mmi_primitive_value_h handle, int *value) |
Gets the integer value from the primitive value. | |
int | mmi_primitive_value_get_float (mmi_primitive_value_h handle, float *value) |
Gets the floating-point value from the primitive value. | |
int | mmi_primitive_value_get_string (mmi_primitive_value_h handle, const char **string) |
Gets the string value from the primitive value. | |
int | mmi_primitive_value_get_bool (mmi_primitive_value_h handle, bool *value) |
Gets the boolean value from the primitive value. | |
int | mmi_primitive_value_get_array_count (mmi_primitive_value_h array, size_t *count) |
Gets the count of elements in the array. | |
int | mmi_primitive_value_get_array_element (mmi_primitive_value_h array, size_t index, mmi_primitive_value_h *element) |
Gets the element at the specified index in the array. | |
int | mmi_primitive_value_clone (mmi_primitive_value_h handle, mmi_primitive_value_h *cloned) |
Clones a primitive value handle. | |
int | mmi_primitive_value_destroy (mmi_primitive_value_h handle) |
Destroys a primitive value handle. | |
int | mmi_primitive_value_to_bytes (mmi_primitive_value_h handle, unsigned char **bytes, size_t *size) |
Converts a primitive value handle to a byte array. | |
int | mmi_primitive_value_from_bytes (unsigned char *bytes, size_t size, mmi_primitive_value_h *handle) |
Creates a primitive value handle from a byte array. | |
int | mmi_signal_parameter_create (mmi_primitive_value_h value, const char *name, mmi_signal_parameter_h *parameter) |
Creates a new signal parameter. | |
int | mmi_signal_parameter_get_name (mmi_signal_parameter_h parameter, char **name) |
Retrieves the name of a signal parameter. | |
int | mmi_signal_parameter_get_value (mmi_signal_parameter_h parameter, mmi_primitive_value_h *value) |
Retrieves the primitive value of a signal parameter. | |
int | mmi_signal_parameter_clone (mmi_signal_parameter_h parameter, mmi_signal_parameter_h *cloned) |
Clones a signal parameter. | |
int | mmi_signal_parameter_destroy (mmi_signal_parameter_h parameter) |
Destroys a signal parameter. | |
int | mmi_signal_create (const char *name, mmi_signal_h *handle) |
Creates a new signal. | |
int | mmi_signal_add_parameter (mmi_signal_h handle, mmi_signal_parameter_h parameter) |
Adds a parameter to a signal. | |
int | mmi_signal_get_name (mmi_signal_h handle, char **name) |
Retrieves the name of a signal. | |
int | mmi_signal_get_parameter_count (mmi_signal_h handle, int *count) |
Retrieves the number of parameters in a signal. | |
int | mmi_signal_get_parameter (mmi_signal_h handle, int index, mmi_signal_parameter_h *parameter) |
Retrieves a parameter from a signal by index. | |
int | mmi_signal_destroy (mmi_signal_h handle) |
Destroys a signal. | |
Typedefs | |
typedef struct mmi_attribute_s * | mmi_attribute_h |
Handle for MMI attributes. | |
typedef struct mmi_data_s * | mmi_data_h |
Handle for MMI data. | |
typedef struct mmi_primitive_value_s * | mmi_primitive_value_h |
Handle for MMI primitive value. | |
typedef struct mmi_signal_parameter_s * | mmi_signal_parameter_h |
Handle for MMI signal parameter. | |
typedef struct mmi_signal_s * | mmi_signal_h |
Handle for MMI signal. |
Typedef Documentation
typedef struct mmi_attribute_s* mmi_attribute_h |
Handle for MMI attributes.
This handle represents an attribute of a workflow or a node
- Since :
- 9.0
typedef struct mmi_data_s* mmi_data_h |
Handle for MMI data.
This handle represents a data that can flow among nodes in MMI framework.
- Since :
- 9.0
typedef struct mmi_primitive_value_s* mmi_primitive_value_h |
Handle for MMI primitive value.
This handle represents a primitive value that an attribute can store within the MMI framework.
- Since :
- 9.0
typedef struct mmi_signal_s* mmi_signal_h |
Handle for MMI signal.
This handle represents a signal that can be sent to a workflow or a node within the MMI framework.
- Since :
- 9.0
typedef struct mmi_signal_parameter_s* mmi_signal_parameter_h |
Handle for MMI signal parameter.
This handle represents a parameter that a signal can embed within the MMI framework.
- Since :
- 9.0
Enumeration Type Documentation
enum mmi_data_type_e |
Enumeration for MMI data types.
This enumeration defines the different data types supported by the MMI framework.
- Since :
- 9.0
- Enumerator:
enum mmi_error_e |
Enumerations for MMI error codes.
- Since :
- 9.0
- Enumerator:
Enumeration for primitive value types.
This enumeration defines the different types of primitive values supported by the MMI framework.
- Since :
- 9.0
Function Documentation
int mmi_attribute_clone | ( | mmi_attribute_h | attribute, |
mmi_attribute_h * | cloned | ||
) |
Clones an existing MMI attribute.
This function creates a deep copy of the specified MMI attribute.
- Since :
- 9.0
- Remarks:
- The cloned should be released using mmi_attribute_destroy().
- Parameters:
-
[in] attribute The attribute handle to clone. [out] cloned A pointer to store the handle of the cloned attribute.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_attribute_h attribute; // Indicates the handle of the attribute mmi_attribute_h cloned = NULL; mmi_attribute_clone(attribute, &cloned); ... mmi_attribute_destroy(cloned);
int mmi_attribute_create | ( | mmi_primitive_value_h | value, |
const char * | name, | ||
mmi_attribute_h * | attribute | ||
) |
Creates a new MMI attribute with a given primitive value and name.
This function initializes a new MMI attribute with the provided primitive value and name.
- Since :
- 9.0
- Remarks:
- The attribute should be released using mmi_attribute_destroy().
- Parameters:
-
[in] value The primitive value to set for the attribute. [in] name The name to assign to the attribute. [out] attribute A pointer to store the newly created attribute handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h value; // Indicates the primitive value to be set in the attribute mmi_attribute_h attribute = NULL; mmi_attribute_create(value, "Name", &attribute); ... mmi_attribute_destroy(attribute);
int mmi_attribute_create_string_array | ( | const char * | name, |
const char * | strings[], | ||
size_t | count, | ||
mmi_attribute_h * | attribute | ||
) |
Creates a new MMI attribute containing a string array.
This function initializes a new MMI attribute with the provided string array and name.
- Since :
- 9.0
- Remarks:
- The attribute should be released using mmi_attribute_destroy().
- Parameters:
-
[in] name The name to assign to the attribute. [in] strings The array of strings to set for the attribute. [in] count The number of strings in the array. [out] attribute A pointer to store the newly created attribute handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_attribute_h attribute = NULL; const char *commands[] = {"Open", "Close"}; mmi_attribute_create_string_array("COMMANDS", commands, 2, &attribute); ... mmi_attribute_destroy(attribute);
int mmi_attribute_destroy | ( | mmi_attribute_h | attribute | ) |
Destroys an MMI attribute.
This function releases all resources associated with the specified MMI attribute.
- Since :
- 9.0
- Parameters:
-
[in] attribute The attribute handle to destroy.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_attribute_from_bytes | ( | const unsigned char * | bytes, |
size_t | length, | ||
mmi_attribute_h * | attribute | ||
) |
Reconstructs an MMI attribute from a byte array.
This function deserializes the specified byte array into an MMI attribute.
- Since :
- 9.0
- Remarks:
- The attribute should be released using mmi_attribute_destroy().
- Parameters:
-
[in] bytes The byte array to deserialize. [in] length The length of the byte array. [out] attribute A pointer to store the reconstructed attribute handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... unsigned char *bytes; // Indicates the byte array to be converted size_t size; // Indicates the size of the byte array mmi_attribute_h attribute = NULL; mmi_attribute_from_bytes(bytes, size, &attribute); ... mmi_attribute_destroy(attribute);
int mmi_attribute_get_name | ( | mmi_attribute_h | attribute, |
char ** | name | ||
) |
Retrieves the name of an MMI attribute.
This function fetches the name associated with the specified MMI attribute.
- Since :
- 9.0
- Remarks:
- The name should be released using free().
- Parameters:
-
[in] attribute The attribute handle from which to retrieve the name. [out] name A pointer to store the retrieved name.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_attribute_h attribute; // Indicates the handle of the attribute char *name = NULL; mmi_attribute_get_name(attribute, &name): ... free(name);
int mmi_attribute_get_value | ( | mmi_attribute_h | attribute, |
mmi_primitive_value_h * | value | ||
) |
Retrieves the primitive value of an MMI attribute.
This function fetches the primitive value stored in the specified MMI attribute.
- Since :
- 9.0
- Remarks:
- The value should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] attribute The attribute handle from which to retrieve the value. [out] value A pointer to store the retrieved primitive value handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_attribute_h attribute; // Indicates the handle of the attribute mmi_primitive_value_h value = NULL; mmi_attribute_get_value(attribute, &value); ... mmi_primitive_value_destroy(value);
int mmi_attribute_set_name | ( | mmi_attribute_h | attribute, |
const char * | name | ||
) |
Sets the name of an MMI attribute.
This function updates the name of the specified MMI attribute.
- Since :
- 9.0
- Parameters:
-
[in] attribute The attribute handle whose name needs to be updated. [in] name The new name to assign to the attribute.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_attribute_to_bytes | ( | mmi_attribute_h | attribute, |
unsigned char ** | bytes, | ||
size_t * | length | ||
) |
Converts an MMI attribute to a byte array.
This function serializes the specified MMI attribute into a byte array.
- Since :
- 9.0
- Remarks:
- The bytes should be released using free().
- Parameters:
-
[in] attribute The attribute handle to serialize. [out] bytes A pointer to store the serialized byte array. [out] length A pointer to store the length of the serialized byte array.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_attribute_h attribute; // Indicates the handle of the attribute unsigned char *bytes = nullptr; size_t size = 0; mmi_attribute_to_bytes(attribute, &bytes, &size); ... free(bytes);
int mmi_data_add_array_element | ( | mmi_data_h | array_handle, |
mmi_data_h | element | ||
) |
Adds an element to a data array.
This function adds a new element to the specified data array.
- Since :
- 9.0
- Parameters:
-
[in] array_handle The handle to the data array where the element will be added. [in] element The handle to the element to be added to the array.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
int mmi_data_create_array | ( | mmi_data_h * | array_handle | ) |
Creates a new data array handle.
This function allocates memory for a new data array handle and initializes it.
- Since :
- 9.0
- Remarks:
- The array_handle should be released using mmi_data_destroy().
- Parameters:
-
[out] array_handle A pointer to the newly created data array handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h array_handle = NULL; mmi_data_create_array(&array_handle); ... mmi_data_destroy(array_handle);
int mmi_data_create_audio | ( | const void * | ptr, |
size_t | len, | ||
mmi_data_h * | data | ||
) |
Creates an audio data object.
This function creates an audio data object with the specified buffer and length.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] ptr The pointer to the audio buffer. [in] len The length of the audio buffer. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... const void *ptr; // Indicates the address of the data to be stored in the data object. size_t len; // Indicates the length of the data to be stored in the data object. mmi_data_h data = NULL; mmi_data_create_audio(ptr, len, &data); ... mmi_data_destroy(data);
int mmi_data_create_bool | ( | bool | value, |
mmi_data_h * | data | ||
) |
Creates a boolean data object.
This function creates a boolean data object with the specified value.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] value The boolean value to set in the data object. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data = NULL; mmi_data_create_bool(true, &data); ... mmi_data_destroy(data);
int mmi_data_create_bounding_box | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
mmi_data_h * | data | ||
) |
Creates a bounding box data object.
This function creates a bounding box data object with the specified x, y, width, and height values.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] x The x-coordinate value. [in] y The y-coordinate value. [in] w The width value. [in] h The height value. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data = NULL; mmi_data_create_bounding_box(0, 0, 10, 10, &data); ... mmi_data_destroy(data);
int mmi_data_create_coordinate | ( | int | x, |
int | y, | ||
mmi_data_h * | data | ||
) |
Creates a coordinate data object.
This function creates a coordinate data object with the specified x and y values.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] x The x-coordinate value. [in] y The y-coordinate value. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data = NULL; mmi_data_create_coordinate(0, 0, &data); ... mmi_data_destroy(data);
int mmi_data_create_float | ( | float | value, |
mmi_data_h * | data | ||
) |
Creates a float data object.
This function creates a float data object with the specified value.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] value The float value to set in the data object. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data = NULL; mmi_data_create_float(3.14f, &data); ... mmi_data_destroy(data);
int mmi_data_create_int | ( | int | value, |
mmi_data_h * | data | ||
) |
Creates an integer data object.
This function creates an integer data object with the specified value.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] value The integer value to set in the data object. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data = NULL; mmi_data_create_int(3, &data); ... mmi_data_destroy(data);
int mmi_data_create_struct | ( | mmi_data_h * | struct_handle | ) |
Creates a new data structure handle.
This function allocates memory for a new data structure handle and initializes it.
- Since :
- 9.0
- Remarks:
- The struct_handle should be released using mmi_data_destroy().
- Parameters:
-
[out] struct_handle A pointer to the newly created data structure handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h struct_handle = NULL; mmi_data_create_struct(&struct_handle); ... mmi_data_destroy(struct_handle);
int mmi_data_create_text | ( | const char * | value, |
mmi_data_h * | data | ||
) |
Creates a text data object.
This function creates a text data object with the specified value.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] value The text value to set in the data object. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... const char *value; // Indicates the text to be set in the data object. mmi_data_h data = NULL; mmi_data_create_text(value, &data); ... mmi_data_destroy(data);
int mmi_data_create_user_identification | ( | const void * | ptr, |
size_t | len, | ||
mmi_data_h * | data | ||
) |
Creates a user identification data object.
This function creates a user identification data object with the specified buffer and length.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] ptr The pointer to the user identification buffer. [in] len The length of the user identification buffer. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... const void *ptr; // Indicates the address of the data to be stored in the data object. size_t len; // Indicates the length of the data to be stored in the data object. mmi_data_h data = NULL; mmi_data_create_user_identification(ptr, len, &data); ... mmi_data_destroy(data);
int mmi_data_create_video | ( | const void * | ptr, |
size_t | len, | ||
mmi_data_h * | data | ||
) |
Creates a video data object.
This function creates a video data object with the specified buffer and length.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] ptr The pointer to the video buffer. [in] len The length of the video buffer. [out] data A pointer to store the handle of the created data object.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... const void *ptr; // Indicates the address of the data to be stored in the data object. size_t len; // Indicates the length of the data to be stored in the data object. mmi_data_h data = NULL; mmi_data_create_video(ptr, len, &data); ... mmi_data_destroy(data);
int mmi_data_destroy | ( | mmi_data_h | data | ) |
Destroys the given MMI data handle.
This function destroys the specified MMI data handle and releases associated resources.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the MMI data.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_data_from_bytes | ( | unsigned char * | bytes, |
size_t | length, | ||
mmi_data_h * | data | ||
) |
Creates an MMI data handle from a byte array.
This function creates an MMI data handle from the provided byte array.
- Since :
- 9.0
- Remarks:
- The data should be released using mmi_data_destroy().
- Parameters:
-
[in] bytes The byte array containing the data. [in] length The length of the byte array. [out] data A pointer to store the resulting MMI data handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... unsigned char *bytes; // Indicates the byte array to be converted size_t size; // Indicates the size of the byte array mmi_data_h data = NULL; mmi_data_from_bytes(bytes, size, &data); ... mmi_data_destroy(data);
int mmi_data_get_array_count | ( | mmi_data_h | array, |
size_t * | count | ||
) |
Gets the number of elements in the array.
This function retrieves the total count of elements present in the specified array.
- Since :
- 9.0
- Parameters:
-
[in] array The handle to the array object. [out] count Pointer to a size_t where the element count will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
int mmi_data_get_array_element | ( | mmi_data_h | array, |
size_t | index, | ||
mmi_data_h * | element | ||
) |
Retrieves an element from the array at the specified index.
This function retrieves a handle to the element located at the specified index in the array.
- Since :
- 9.0
- Remarks:
- The element should not be released. The element is available until struct_handle is released.
- Parameters:
-
[in] array The handle to the array object. [in] index The index of the element to retrieve. [out] element Pointer to a mmi_data_h where the element handle will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the handle of the data mmi_data_h element = NULL; mmi_data_get_array_element(data, 1, &element); ...
int mmi_data_get_audio | ( | mmi_data_h | data, |
const void ** | ptr, | ||
size_t * | len | ||
) |
Retrieves the audio data from a data handle.
This function retrieves the audio data stored in the specified data handle.
- Since :
- 9.0
- Remarks:
- The ptr should not be released. The ptr is available until data is released.
- Parameters:
-
[in] data The handle to the data from which the audio data will be retrieved. [out] ptr A pointer to the variable where the audio data will be stored. [out] len A pointer to the variable where the length of the audio data will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the data handle const void *ptr = NULL; size_t len = 0; mmi_data_get_audio(data, &ptr, &len);
int mmi_data_get_bool | ( | mmi_data_h | data, |
bool * | value | ||
) |
Retrieves the boolean value from a data handle.
This function retrieves the boolean value stored in the specified data handle.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the data from which the boolean value will be retrieved. [out] value A pointer to the variable where the boolean value will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_data_get_bounding_box | ( | mmi_data_h | data, |
int * | x, | ||
int * | y, | ||
int * | w, | ||
int * | h | ||
) |
Retrieves the bounding box of the given data.
This function retrieves the bounding box coordinates (x, y, width, height) of the specified data.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the data object. [out] x Pointer to an integer where the x-coordinate will be stored. [out] y Pointer to an integer where the y-coordinate will be stored. [out] w Pointer to an integer where the width will be stored. [out] h Pointer to an integer where the height will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
int mmi_data_get_coordinate | ( | mmi_data_h | data, |
int * | x, | ||
int * | y | ||
) |
Retrieves the coordinate data from a data handle.
This function retrieves the coordinate data stored in the specified data handle.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the data from which the coordinate data will be retrieved. [out] x A pointer to the variable where the x-coordinate value will be stored. [out] y A pointer to the variable where the y-coordinate value will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_data_get_float | ( | mmi_data_h | data, |
float * | value | ||
) |
Retrieves the floating-point value from a data handle.
This function retrieves the floating-point value stored in the specified data handle.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the data from which the floating-point value will be retrieved. [out] value A pointer to the variable where the floating-point value will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_data_get_int | ( | mmi_data_h | data, |
int * | value | ||
) |
Retrieves the integer value from a data handle.
This function retrieves the integer value stored in the specified data handle.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the data from which the integer value will be retrieved. [out] value A pointer to the variable where the integer value will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_data_get_struct_count | ( | mmi_data_h | struct_handle, |
size_t * | count | ||
) |
Gets the number of elements in the structure.
This function retrieves the total count of elements present in the specified structure.
- Since :
- 9.0
- Parameters:
-
[in] struct_handle The handle to the structure object. [out] count Pointer to a size_t where the element count will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
int mmi_data_get_struct_element | ( | mmi_data_h | struct_handle, |
const char * | name, | ||
mmi_data_h * | element | ||
) |
Retrieves an element from the structure by its name.
This function retrieves a handle to the element in the structure identified by the specified name.
- Since :
- 9.0
- Remarks:
- The element should not be released. The element is available until struct_handle is released.
- Parameters:
-
[in] struct_handle The handle to the structure object. [in] name The name of the element to retrieve. [out] element Pointer to a mmi_data_h where the element handle will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the handle of the data mmi_data_h element = NULL; mmi_data_get_struct_element(data, "element_1", &element); ...
int mmi_data_get_struct_element_name | ( | mmi_data_h | struct_handle, |
size_t | index, | ||
const char ** | name | ||
) |
Retrieves the name of the element at the specified index in the structure.
This function retrieves the name of the element located at the specified index in the structure.
- Since :
- 9.0
- Remarks:
- The name should not be released. The name is available until struct_handle is released.
- Parameters:
-
[in] struct_handle The handle to the structure object. [in] index The index of the element whose name is to be retrieved. [out] name Pointer to a const char pointer where the name will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the handle of the data structure char *name = NULL; mmi_data_get_struct_element_name(data, 1, &name): ...
int mmi_data_get_struct_element_value | ( | mmi_data_h | struct_handle, |
size_t | index, | ||
mmi_data_h * | element | ||
) |
Retrieves the of the element at the specified index in the structure.
This function retrieves a handle to the value of the element located at the specified index in the structure.
- Since :
- 9.0
- Remarks:
- The element should not be released. The element is available until struct_handle is released.
- Parameters:
-
[in] struct_handle The handle to the structure object. [in] index The index of the element whose value is to be retrieved. [out] element Pointer to a mmi_data_h where the element handle will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the handle of the data structure mmi_data_h element = NULL; mmi_data_get_struct_element_value(data, 1, &element); ...
int mmi_data_get_text | ( | mmi_data_h | data, |
const char ** | text | ||
) |
Retrieves the text string from a data handle.
This function retrieves the text string stored in the specified data handle.
- Since :
- 9.0
- Remarks:
- The text should not be released. The text is available until data is released.
- Parameters:
-
[in] data The handle to the data from which the text string will be retrieved. [out] text A pointer to the variable where the text string will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the data handle const char *text = NULL; mmi_data_get_text(data, &text);
int mmi_data_get_type | ( | mmi_data_h | data, |
mmi_data_type_e * | type | ||
) |
Retrieves the type of a data handle.
This function retrieves the type of the specified data handle.
- Since :
- 9.0
- Parameters:
-
[in] data The handle to the data whose type is to be retrieved. [out] type A pointer to the variable where the type will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_data_get_user_identification | ( | mmi_data_h | data, |
const void ** | ptr, | ||
size_t * | len | ||
) |
Retrieves the user identification data from a data handle.
This function retrieves the user identification data stored in the specified data handle.
- Since :
- 9.0
- Remarks:
- The ptr should not be released. The ptr is available until data is released.
- Parameters:
-
[in] data The handle to the data from which the user identification data will be retrieved. [out] ptr A pointer to the variable where the user identification data will be stored. [out] len A pointer to the variable where the length of the user identification data will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the data handle const void *ptr = NULL; size_t len = 0; mmi_data_get_user_identification(data, &ptr, &len);
int mmi_data_get_video | ( | mmi_data_h | data, |
const void ** | ptr, | ||
size_t * | len | ||
) |
Retrieves the video data from a data handle.
This function retrieves the video data stored in the specified data handle.
- Since :
- 9.0
- Remarks:
- The ptr should not be released. The ptr is available until data is released.
- Parameters:
-
[in] data The handle to the data from which the video data will be retrieved. [out] ptr A pointer to the variable where the video data will be stored. [out] len A pointer to the variable where the length of the video data will be stored.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the data handle const void *ptr = NULL; size_t len = 0; mmi_data_get_video(data, &ptr, &len);
int mmi_data_set_struct_element | ( | mmi_data_h | struct_handle, |
const char * | name, | ||
mmi_data_h | element | ||
) |
Sets an element in a data structure.
This function sets the value of an element in the specified data structure.
- Since :
- 9.0
- Parameters:
-
[in] struct_handle The handle to the data structure where the element will be set. [in] name The name of the element to be set. [in] element The handle to the element to be set in the structure.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
int mmi_data_to_bytes | ( | mmi_data_h | data, |
unsigned char ** | bytes, | ||
size_t * | length | ||
) |
Converts the MMI data handle to a byte array.
This function converts the given MMI data handle into a byte array representation.
- Since :
- 9.0
- Remarks:
- The bytes should be released using free().
- Parameters:
-
[in] data The handle to the MMI data. [out] bytes A pointer to store the resulting byte array. [out] length A pointer to store the length of the byte array.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_data_h data; // Indicates the handle of the data unsigned char *bytes = nullptr; size_t size = 0; mmi_data_to_bytes(data, &bytes, &size); ... free(bytes);
int mmi_primitive_value_add_array_element | ( | mmi_primitive_value_h | array, |
mmi_primitive_value_h | element | ||
) |
Adds an element to a primitive value array.
This function adds an element to a primitive value array.
- Since :
- 9.0
- Parameters:
-
[in] array The handle of the array to which the element will be added. [in] element The handle of the element to be added to the array.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_clone | ( | mmi_primitive_value_h | handle, |
mmi_primitive_value_h * | cloned | ||
) |
Clones a primitive value handle.
This function creates a copy of the given primitive value handle.
- Since :
- 9.0
- Remarks:
- The cloned should be released using mmi_attribute_destroy().
- Parameters:
-
[in] handle The handle of the primitive value to be cloned. [out] cloned A pointer to store the cloned primitive value handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h value; // Indicates the handle of the primitive value mmi_primitive_value_h cloned = NULL; mmi_primitive_value_clone(value, &cloned); ... mmi_primitive_value_destroy(cloned);
int mmi_primitive_value_create_array | ( | mmi_primitive_value_h * | handle | ) |
Creates a primitive value handle for an array.
This function creates a handle for an array primitive value.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_primitive_value_destroy().
- Parameters:
-
[out] handle Pointer to the handle which will be populated with the newly created handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h handle = NULL; mmi_primitive_value_create_array(&handle); ... mmi_primitive_value_destroy(handle);
int mmi_primitive_value_create_bool | ( | bool | data, |
mmi_primitive_value_h * | handle | ||
) |
Creates a primitive value handle for a boolean.
This function creates a handle for a boolean primitive value.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] data The boolean value to be stored in the handle. [out] handle Pointer to the handle which will be populated with the newly created handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h handle = NULL; mmi_primitive_value_create_bool(true, &handle); ... mmi_primitive_value_destroy(handle);
int mmi_primitive_value_create_float | ( | float | data, |
mmi_primitive_value_h * | handle | ||
) |
Creates a primitive value handle for a floating-point number.
This function creates a handle for a floating-point primitive value.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] data The floating-point value to be stored in the handle. [out] handle Pointer to the handle which will be populated with the newly created handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h handle = NULL; mmi_primitive_value_create_float(3.14, &handle); ... mmi_primitive_value_destroy(handle);
int mmi_primitive_value_create_int | ( | int | data, |
mmi_primitive_value_h * | handle | ||
) |
Creates a primitive value handle for an integer.
This function creates a handle for an integer primitive value.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] data The integer value to be stored in the handle. [out] handle Pointer to the handle which will be populated with the newly created handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h handle = NULL; mmi_primitive_value_create_int(3, &handle); ... mmi_primitive_value_destroy(handle);
int mmi_primitive_value_create_string | ( | const char * | data, |
mmi_primitive_value_h * | handle | ||
) |
Creates a primitive value handle for a string.
This function creates a handle for a string primitive value.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] data The string value to be stored in the handle. [out] handle Pointer to the handle which will be populated with the newly created handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h handle = NULL; mmi_primitive_value_create_string("Test", &handle); ... mmi_primitive_value_destroy(handle);
int mmi_primitive_value_destroy | ( | mmi_primitive_value_h | handle | ) |
Destroys a primitive value handle.
This function frees the resources associated with the given primitive value handle.
- Since :
- 9.0
- Parameters:
-
[in] handle The handle of the primitive value to be destroyed.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_from_bytes | ( | unsigned char * | bytes, |
size_t | size, | ||
mmi_primitive_value_h * | handle | ||
) |
Creates a primitive value handle from a byte array.
This function deserializes a byte array into a primitive value handle.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] bytes The byte array containing the serialized primitive value. [in] size The size of the byte array. [out] handle A pointer to store the resulting primitive value handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... unsigned char *bytes; // Indicates the byte array to be converted size_t size; // Indicates the size of the byte array mmi_primitive_value_h value = NULL; mmi_primitive_value_from_bytes(bytes, size, &value); ... mmi_primitive_value_destroy(data);
int mmi_primitive_value_get_array_count | ( | mmi_primitive_value_h | array, |
size_t * | count | ||
) |
Gets the count of elements in the array.
This function retrieves the number of elements in the array represented by the given handle.
- Since :
- 9.0
- Parameters:
-
[in] array The handle to the array. [out] count A pointer to store the number of elements in the array.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_get_array_element | ( | mmi_primitive_value_h | array, |
size_t | index, | ||
mmi_primitive_value_h * | element | ||
) |
Gets the element at the specified index in the array.
This function retrieves the element at the specified index in the array represented by the given handle.
- Since :
- 9.0
- Remarks:
- The element should not be released. The element is available until struct_handle is released.
- Parameters:
-
[in] array The handle to the array. [in] index The index of the element to retrieve. [out] element A pointer to store the handle of the retrieved element.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_primitive_value_h value; // Indicates the handle of the primitive value mmi_primitive_value_h element = NULL; mmi_primitive_value_get_array_element(value, 1, &element); ...
int mmi_primitive_value_get_bool | ( | mmi_primitive_value_h | handle, |
bool * | value | ||
) |
Gets the boolean value from the primitive value.
This function retrieves the boolean value stored in the primitive value represented by the given handle.
- Since :
- 9.0
- Parameters:
-
[in] handle The handle to the primitive value. [out] value A pointer to store the boolean value.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_get_float | ( | mmi_primitive_value_h | handle, |
float * | value | ||
) |
Gets the floating-point value from the primitive value.
This function retrieves the floating-point value stored in the primitive value represented by the given handle.
- Since :
- 9.0
- Parameters:
-
[in] handle The handle to the primitive value. [out] value A pointer to store the floating-point value.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_get_int | ( | mmi_primitive_value_h | handle, |
int * | value | ||
) |
Gets the integer value from the primitive value.
This function retrieves the integer value stored in the primitive value represented by the given handle.
- Since :
- 9.0
- Parameters:
-
[in] handle The handle to the primitive value. [out] value A pointer to store the integer value.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_get_string | ( | mmi_primitive_value_h | handle, |
const char ** | string | ||
) |
Gets the string value from the primitive value.
This function retrieves the string value stored in the primitive value represented by the given handle.
- Since :
- 9.0
- Remarks:
- The string should not be released. The string is available until data is released.
- Parameters:
-
[in] handle The handle to the primitive value. [out] string A pointer to store the string value.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_primitive_value_h value; // Indicates the primitive value handle const char *string = NULL; mmi_primitive_value_get_string(value, &string);
int mmi_primitive_value_get_type | ( | mmi_primitive_value_h | handle, |
mmi_primitive_value_type_e * | type | ||
) |
Gets the type of the primitive value.
This function retrieves the type of the primitive value represented by the given handle.
- Since :
- 9.0
- Parameters:
-
[in] handle The handle to the primitive value. [out] type A pointer to store the type of the primitive value.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_primitive_value_to_bytes | ( | mmi_primitive_value_h | handle, |
unsigned char ** | bytes, | ||
size_t * | size | ||
) |
Converts a primitive value handle to a byte array.
This function serializes the given primitive value handle into a byte array.
- Since :
- 9.0
- Remarks:
- The bytes should be released using free().
- Parameters:
-
[in] handle The handle of the primitive value to be converted. [out] bytes A pointer to store the resulting byte array. [out] size A pointer to store the size of the byte array.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h value; // Indicates the handle of the primitive value unsigned char *bytes = nullptr; size_t size = 0; mmi_primitive_value_to_bytes(value, &bytes, &size); ... free(bytes);
int mmi_signal_add_parameter | ( | mmi_signal_h | handle, |
mmi_signal_parameter_h | parameter | ||
) |
Adds a parameter to a signal.
This function adds the given parameter to the specified signal.
- Since :
- 9.0
- Parameters:
-
[in] handle The signal handle to which the parameter will be added. [in] parameter The parameter handle to add to the signal.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_signal_create | ( | const char * | name, |
mmi_signal_h * | handle | ||
) |
Creates a new signal.
This function creates a new signal with the given name.
- Since :
- 9.0
- Remarks:
- The handle should be released using mmi_signal_destroy().
- Parameters:
-
[in] name The name of the signal. [out] handle A pointer to store the newly created signal handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_signal_h handle = NULL; mmi_signal_create("Name", &handle); ... mmi_signal_destroy(handle);
int mmi_signal_destroy | ( | mmi_signal_h | handle | ) |
Destroys a signal.
This function destroys the given signal and releases its resources.
- Since :
- 9.0
- Parameters:
-
[in] handle The signal handle to destroy.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_signal_get_name | ( | mmi_signal_h | handle, |
char ** | name | ||
) |
Retrieves the name of a signal.
This function retrieves the name associated with the given signal.
- Since :
- 9.0
- Remarks:
- The name should be released using free().
- Parameters:
-
[in] handle The signal handle. [out] name A pointer to store the name of the signal.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_signal_h handle; // Indicates the handle of the signal char *name = NULL; mmi_signal_get_name(handle, &name): ... free(name);
int mmi_signal_get_parameter | ( | mmi_signal_h | handle, |
int | index, | ||
mmi_signal_parameter_h * | parameter | ||
) |
Retrieves a parameter from a signal by index.
This function retrieves the parameter at the specified index from the given signal.
- Since :
- 9.0
- Remarks:
- The parameter should be released using mmi_signal_parameter_destroy().
- Parameters:
-
[in] handle The signal handle. [in] index The index of the parameter to retrieve. [out] parameter A pointer to store the retrieved parameter handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
- Example
#include <mmi.h> ... mmi_signal_h handle; // Indicates the handle of the signal mmi_signal_parameter_h parameter = NULL; mmi_signal_get_parameter(handle, 1, ¶meter); ... mmi_signal_parameter_destroy(parameter);
int mmi_signal_get_parameter_count | ( | mmi_signal_h | handle, |
int * | count | ||
) |
Retrieves the number of parameters in a signal.
This function retrieves the count of parameters currently associated with the given signal.
- Since :
- 9.0
- Parameters:
-
[in] handle The signal handle. [out] count A pointer to store the number of parameters.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_signal_parameter_clone | ( | mmi_signal_parameter_h | parameter, |
mmi_signal_parameter_h * | cloned | ||
) |
Clones a signal parameter.
This function creates a deep copy of the given signal parameter.
- Since :
- 9.0
- Remarks:
- The cloned should be released using mmi_signal_parameter_destroy().
- Parameters:
-
[in] parameter The signal parameter handle to clone. [out] cloned A pointer to store the cloned parameter handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_signal_parameter_h parameter; // Indicates the handle of the signal parameter mmi_signal_parameter_h cloned = NULL; mmi_signal_parameter_clone(parameter, &cloned); ... mmi_signal_parameter_destroy(cloned);
int mmi_signal_parameter_create | ( | mmi_primitive_value_h | value, |
const char * | name, | ||
mmi_signal_parameter_h * | parameter | ||
) |
Creates a new signal parameter.
This function creates a new signal parameter with the given primitive value and name.
- Since :
- 9.0
- Remarks:
- The parameter should be released using mmi_signal_parameter_destroy().
- Parameters:
-
[in] value The primitive value to associate with the parameter. [in] name The name of the parameter. [out] parameter A pointer to store the newly created parameter handle.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_primitive_value_h value; // Indicates the primitive value to be set in the signal_parameter mmi_signal_parameter_h parameter = NULL; mmi_signal_parameter_create(value, "Name", ¶meter); ... mmi_signal_parameter_destroy(parameter);
int mmi_signal_parameter_destroy | ( | mmi_signal_parameter_h | parameter | ) |
Destroys a signal parameter.
This function destroys the given signal parameter and releases its resources.
- Since :
- 9.0
- Parameters:
-
[in] parameter The signal parameter handle to destroy.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter
int mmi_signal_parameter_get_name | ( | mmi_signal_parameter_h | parameter, |
char ** | name | ||
) |
Retrieves the name of a signal parameter.
This function retrieves the name associated with the given signal parameter.
- Since :
- 9.0
- Remarks:
- The name should be released using free().
- Parameters:
-
[in] parameter The signal parameter handle. [out] name A pointer to store the name of the parameter.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_signal_parameter_h parameter; // Indicates the handle of the signal parameter char *name = NULL; mmi_signal_parameter_get_name(parameter, &name): ... free(name);
int mmi_signal_parameter_get_value | ( | mmi_signal_parameter_h | parameter, |
mmi_primitive_value_h * | value | ||
) |
Retrieves the primitive value of a signal parameter.
This function retrieves the primitive value associated with the given signal parameter.
- Since :
- 9.0
- Remarks:
- The value should be released using mmi_primitive_value_destroy().
- Parameters:
-
[in] parameter The signal parameter handle. [out] value A pointer to store the primitive value of the parameter.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MMI_ERROR_NONE Successful MMI_ERROR_NOT_SUPPORTED Not supported MMI_ERROR_INVALID_PARAMETER Invalid parameter MMI_ERROR_OUT_OF_MEMORY Out of memory
- Example
#include <mmi.h> ... mmi_signal_parameter_h parameter; // Indicates the handle of the signal parameter mmi_primitive_value_h value = NULL; mmi_signal_parameter_get_value(parameter, &value); ... mmi_primitive_value_destroy(value);