Tizen Native API  5.0
Query

The calendar query API provides the set of the definitions and interfaces that enable you to handle query.

Required Header

#include <calendar.h>

Functions

int calendar_query_create (const char *view_uri, calendar_query_h *query)
 Creates a query handle.
int calendar_query_destroy (calendar_query_h query)
 Destroys a query handle.
int calendar_query_set_projection (calendar_query_h query, unsigned int property_id_array[], int count)
 Adds property IDs for projection.
int calendar_query_set_distinct (calendar_query_h query, bool set)
 Sets the "distinct" option for projection.
int calendar_query_set_filter (calendar_query_h query, calendar_filter_h filter)
 Sets the filter for a query.
int calendar_query_set_sort (calendar_query_h query, unsigned int property_id, bool is_ascending)
 Sets the sort mode for a query.

Function Documentation

int calendar_query_create ( const char *  view_uri,
calendar_query_h *  query 
)

Creates a query handle.

Since :
2.3
Remarks:
You must release query using calendar_query_destroy().
Parameters:
[in]view_uriThe view URI of a query
[out]queryThe filter handle
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to initialize.
See also:
calendar_query_destroy()
int calendar_query_destroy ( calendar_query_h  query)

Destroys a query handle.

Since :
2.3
Parameters:
[in]queryThe query handle
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
See also:
calendar_query_create()
int calendar_query_set_distinct ( calendar_query_h  query,
bool  set 
)

Sets the "distinct" option for projection.

Since :
2.3
Parameters:
[in]queryThe query handle
[in]setIf true it is set, otherwise if false it is unset
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
int calendar_query_set_filter ( calendar_query_h  query,
calendar_filter_h  filter 
)

Sets the filter for a query.

Since :
2.3
Parameters:
[in]queryThe query handle
[in]filterThe filter handle
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_NO_DATARequested data does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
See also:
calendar_query_add_operator()
int calendar_query_set_projection ( calendar_query_h  query,
unsigned int  property_id_array[],
int  count 
)

Adds property IDs for projection.

Property IDs can be of one of the properties of view_uri which is used in calendar_query_create().

Since :
2.3
Parameters:
[in]queryThe query handle
[in]property_id_arrayThe property ID array
[in]countThe number of property IDs
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
int calendar_query_set_sort ( calendar_query_h  query,
unsigned int  property_id,
bool  is_ascending 
)

Sets the sort mode for a query.

Since :
2.3
Parameters:
[in]queryThe query handle
[in]property_idThe property ID to sort
[in]is_ascendingIf true it sorts in the ascending order, otherwise if false it sorts in the descending order
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported