Tizen Native API
6.0
|
The contacts Query API provides the set of definitions and interfaces that enable application developers to make query to get list.
Required Header
#include <contacts.h>
Functions | |
int | contacts_query_create (const char *view_uri, contacts_query_h *query) |
Creates a query. | |
int | contacts_query_destroy (contacts_query_h query) |
Destroys a query. | |
int | contacts_query_set_projection (contacts_query_h query, unsigned int property_id_array[], int count) |
Adds property IDs for projection. | |
int | contacts_query_set_distinct (contacts_query_h query, bool set) |
Sets the "distinct" option for projection. | |
int | contacts_query_set_filter (contacts_query_h query, contacts_filter_h filter) |
Sets a filter for query. | |
int | contacts_query_set_sort (contacts_query_h query, unsigned int property_id, bool is_ascending) |
Sets a sort mode for query. |
Function Documentation
int contacts_query_create | ( | const char * | view_uri, |
contacts_query_h * | query | ||
) |
Creates a query.
- Since :
- 3.0
- Remarks:
- You must release query using contacts_query_destroy().
- Parameters:
-
[in] view_uri The view URI of a query [out] query The filter handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_OUT_OF_MEMORY Out of memory CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error
- Precondition:
- contacts_connect() should be called to initialize
- See also:
- contacts_query_destroy()
int contacts_query_destroy | ( | contacts_query_h | query | ) |
Destroys a query.
- Since :
- 3.0
- Parameters:
-
[in] query The query handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error
- See also:
- contacts_query_create()
int contacts_query_set_distinct | ( | contacts_query_h | query, |
bool | set | ||
) |
Sets the "distinct" option for projection.
- Since :
- 3.0
- Parameters:
-
[in] query The query handle [in] set Set true
to set the distinct option for projection, otherwisefalse
to unset the distinct option
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error
int contacts_query_set_filter | ( | contacts_query_h | query, |
contacts_filter_h | filter | ||
) |
Sets a filter for query.
- Since :
- 3.0
- Parameters:
-
[in] query The query handle [in] filter The filter handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error
- See also:
- contacts_filter_create()
int contacts_query_set_projection | ( | contacts_query_h | query, |
unsigned int | property_id_array[], | ||
int | count | ||
) |
Adds property IDs for projection.
- Since :
- 3.0
- Parameters:
-
[in] query The query handle [in] property_id_array The property ID array [in] count The number of property IDs
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error
int contacts_query_set_sort | ( | contacts_query_h | query, |
unsigned int | property_id, | ||
bool | is_ascending | ||
) |
Sets a sort mode for query.
- Since :
- 3.0
- Parameters:
-
[in] query The query handle [in] property_id The property ID to sort [in] is_ascending Set true
for ascending sort mode, otherwisefalse
for descending sort mode
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error