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 handle for searching media.
|
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_get_condition_count (mc_search_h search, int *condition_count) |
| Gets the number of conditions to 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
Called for every search condition information in the obtained list of search.
Iterates over a search list.
- Since :
- 5.0
- 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, otherwise false
to break out of the loop
- Precondition:
- mc_search_foreach_condition() will invoke this function.
- See also:
- mc_search_foreach_condition()
Function Documentation
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
- Parameters:
-
[in] | src | The source handle of the media controller search |
[out] | dst | The destination handle of the media controller search |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- mc_search_destroy()
Destroys search.
- Since :
- 5.0
- Parameters:
-
[in] | search | The handle of the media controller search |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- Create a media controller search handle by calling mc_search_create().
- See also:
- mc_search_create()
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 of the media controller 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:
-
- Precondition:
- Create a media controller search handle by calling mc_search_create().
-
Set the search conditions by calling mc_search_set_condition().
- See also:
- mc_search_create()
-
mc_search_set_condition()
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 of the media controller 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:
-
- Precondition:
- mc_search_create()
- See also:
- mc_search_foreach_condition()