Tizen Native API
5.0
|
The Media Controller Search API provides functions for search for the media controller server.
Required Header
#include <media_controller_metadata.h>
Overview
The Media Controller Search API allows you to create handle for searching (mc_search_create()).
You can set and get search conditions (mc_search_set_condition() and mc_search_foreach_condition()).
And copy the search by using mc_search_clone(). And if you don't use handle anymore, you have to destroy it(mc_search_destroy()).
Functions | |
int | mc_search_create (mc_search_h *search) |
Creates a media controller search handle. | |
int | mc_search_set_condition (mc_search_h search, mc_content_type_e content_type, mc_search_category_e category, const char *search_keyword, bundle *data) |
Sets the information to search. | |
int | mc_search_destroy (mc_search_h search) |
Destroys search. | |
int | mc_search_foreach_condition (mc_search_h search, mc_search_condition_cb callback, void *user_data) |
Retrieves all search conditions. | |
int | mc_search_clone (mc_search_h src, mc_search_h *dst) |
Clones a media controller search handle. | |
Typedefs | |
typedef bool(* | mc_search_condition_cb )(mc_content_type_e content_type, mc_search_category_e category, const char *search_keyword, bundle *data, void *user_data) |
Called for every search condition information in the obtained list of search. |
Typedef Documentation
typedef bool(* mc_search_condition_cb)(mc_content_type_e content_type, mc_search_category_e category, const char *search_keyword, bundle *data, void *user_data) |
Called for every search condition information in the obtained list of search.
Iterates over a search list.
- Since :
- 5.0
- Remarks:
- The callback is called in the main loop. The search_keyword and data should not be released by the application.
The search_keyword and data can be used only in the callback. To use outside, make a copy.
- Parameters:
-
[in] content_type The content type to search [in] category The category to search [in] search_keyword The key word to search [in] data The extra data [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop, otherwisefalse
to break out of the loop
- Precondition:
- mc_search_foreach_condition() will invoke this function.
- See also:
- mc_search_foreach_condition()
Function Documentation
int mc_search_clone | ( | mc_search_h | src, |
mc_search_h * | dst | ||
) |
Clones a media controller search handle.
This function copies the media controller search handle from a source to destination. The mc_search_h is created internally and available through media controller search functions.
- Since :
- 5.0
- Remarks:
- The dst should be released using
mc_search_destroy()
.
- Parameters:
-
[in] src The source handle to the media controller search [out] dst The destination handle to the media controller search
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- mc_search_destroy()
int mc_search_create | ( | mc_search_h * | search | ) |
Creates a media controller search handle.
- Since :
- 5.0
- Remarks:
- The search should be released using
mc_search_destroy()
.
- Parameters:
-
[out] search The handle to search
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
int mc_search_destroy | ( | mc_search_h | search | ) |
Destroys search.
- Since :
- 5.0
- Parameters:
-
[in] search The handle to search
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_INVALID_OPERATION Invalid operation
- Precondition:
- Create a media controller search handle by calling mc_search_create().
- See also:
- mc_search_create()
int mc_search_foreach_condition | ( | mc_search_h | search, |
mc_search_condition_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all search conditions.
This function gets all search conditions set. The callback function will be invoked for every retrieved search condition. If there were no search conditions set with mc_search_set_condition(), this function will return MEDIA_CONTROLLER_ERROR_NONE, and the callback will not be invoked.
- Since :
- 5.0
- Parameters:
-
[in] search The handle to search [in] callback The callback function to be invoked. [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- Create a media controller search handle by calling mc_search_create().
- Set the search conditions by calling mc_search_set_condition().
int mc_search_set_condition | ( | mc_search_h | search, |
mc_content_type_e | content_type, | ||
mc_search_category_e | category, | ||
const char * | search_keyword, | ||
bundle * | data | ||
) |
Sets the information to search.
Sets the information to search. You can set various search condition by calling this function for the same search handle.
But it's not allowed to set more than 20 conditions. If you try to set more than 20 conditions, this function will return MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER.
- Since :
- 5.0
- Parameters:
-
[in] search The handle to search [in] content_type The content type to search [in] category The category to search [in] search_keyword The key word to search [in] data The extra data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
- Precondition:
- mc_search_create()
- See also:
- mc_search_foreach_condition()