Tizen Native API  4.0
Database

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

Required Header

#include <calendar.h>

Functions

int calendar_db_insert_record (calendar_record_h record, int *record_id)
 Inserts a record into the calendar database.
int calendar_db_get_record (const char *view_uri, int record_id, calendar_record_h *record)
 Gets a record from the calendar database.
int calendar_db_update_record (calendar_record_h record)
 Updates a record in the calendar database.
int calendar_db_delete_record (const char *view_uri, int record_id)
 Deletes a record from the calendar database with related child records.
int calendar_db_get_all_records (const char *view_uri, int offset, int limit, calendar_list_h *record_list)
 Retrieves all records as a list.
int calendar_db_get_records_with_query (calendar_query_h query, int offset, int limit, calendar_list_h *record_list)
 Retrieves records using a query handle.
int calendar_db_get_count (const char *view_uri, int *count)
 Gets the record count of a specific view.
int calendar_db_get_count_with_query (calendar_query_h query, int *count)
 Gets the record count with a query handle.
int calendar_db_insert_records (calendar_list_h record_list, int **record_id_array, int *count)
 Inserts multiple records into the calendar database as a batch operation.
int calendar_db_update_records (calendar_list_h record_list)
 Updates multiple records into the calendar database as a batch operation.
int calendar_db_delete_records (const char *view_uri, int record_id_array[], int count)
 Deletes multiple records with related child records from the calendar database as a batch operation.
int calendar_db_get_current_version (int *calendar_db_version)
 Gets the current calendar database version.
int calendar_db_add_changed_cb (const char *view_uri, calendar_db_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when a record changes.
int calendar_db_remove_changed_cb (const char *view_uri, calendar_db_changed_cb callback, void *user_data)
 Unregisters a callback function.
int calendar_db_get_changes_by_version (const char *view_uri, int calendar_book_id, int calendar_db_version, calendar_list_h *record_list, int *current_calendar_db_version)
 Retrieves records with the given calendar database version.
int calendar_db_insert_vcalendars (const char *vcalendar_stream, int **record_id_array, int *count)
 Inserts a vcalendar stream into the calendar database.
int calendar_db_replace_vcalendars (const char *vcalendar_stream, int *record_id_array, int count)
 Replaces a vcalendar stream in the calendar database.
int calendar_db_replace_record (calendar_record_h record, int record_id)
 Replaces a record in the calendar database.
int calendar_db_replace_records (calendar_list_h record_list, int *record_id_array, int count)
 Replaces multiple records in the calendar database as a batch operation.
int calendar_db_get_last_change_version (int *last_change_version)
 Gets the last successful change version of the database on the current connection.
int calendar_db_get_changes_exception_by_version (const char *view_uri, int original_event_id, int calendar_db_version, calendar_list_h *list)
 Retrieves changed exception records since the given calendar database version. Exceptions are the modified or deleted instances in a recurring event.
int calendar_db_clean_after_sync (int calendar_book_id, int calendar_db_version)
 Cleans the data after sync.
int calendar_db_link_record (int base_id, int record_id)
 Links a record to another record.
int calendar_db_unlink_record (int record_id)
 Unlinks a record from base record.

Typedefs

typedef void(* calendar_db_changed_cb )(const char *view_uri, void *user_data)
 Called when a designated view changes.

Defines

#define CALENDAR_CONNECT_FLAG_NONE   0x00000000
 Definition for a calendar connect flag.
#define CALENDAR_CONNECT_FLAG_RETRY   0x00000001
 Definition for a calendar connect flag.
#define DEFAULT_EVENT_CALENDAR_BOOK_ID   1
 Definition for a default event calendar book database ID.
#define DEFAULT_TODO_CALENDAR_BOOK_ID   2
 Definition for a default to-do calendar book database ID.
#define DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID   3
 Definition for a default birthday calendar book database ID.
#define CALENDAR_TODO_NO_DUE_DATE   INT64_MAX
 Definition for no due date of a to-do.
#define CALENDAR_TODO_NO_START_DATE   (-INT64_MAX)
 Definition for no start date of a to-do.
#define CALENDAR_RECORD_NO_UNTIL   INT64_MAX
 Definition for no until of a record.
#define CALENDAR_RECORD_NO_COORDINATE   1000.0
 Definition for no coordinate(latitude/longitude) of a record.

Define Documentation

#define CALENDAR_CONNECT_FLAG_NONE   0x00000000

Definition for a calendar connect flag.

Since :
2.3
#define CALENDAR_CONNECT_FLAG_RETRY   0x00000001

Definition for a calendar connect flag.

Since :
2.3
#define CALENDAR_RECORD_NO_COORDINATE   1000.0

Definition for no coordinate(latitude/longitude) of a record.

Since :
2.3
#define CALENDAR_RECORD_NO_UNTIL   INT64_MAX

Definition for no until of a record.

Since :
2.3
#define CALENDAR_TODO_NO_DUE_DATE   INT64_MAX

Definition for no due date of a to-do.

Since :
2.3
#define CALENDAR_TODO_NO_START_DATE   (-INT64_MAX)

Definition for no start date of a to-do.

Since :
2.3

Definition for a default birthday calendar book database ID.

Since :
2.3

Definition for a default event calendar book database ID.

Since :
2.3

Definition for a default to-do calendar book database ID.

Since :
2.3

Typedef Documentation

typedef void(* calendar_db_changed_cb)(const char *view_uri, void *user_data)

Called when a designated view changes.

Since :
2.3
Parameters:
[in]view_uriThe view URI
[in]user_dataThe user data passed from the callback registration function
See also:
calendar_db_add_changed_cb()

Function Documentation

int calendar_db_add_changed_cb ( const char *  view_uri,
calendar_db_changed_cb  callback,
void *  user_data 
)

Registers a callback function to be invoked when a record changes.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Remarks:
If successive change notification produced on the view_uri are identical, then they are coalesced into a single notification if the older notification has not yet been called because default main loop is doing something. But it means that a callback function is not called to reliably count of change. This API supports only _calendar_book view view, _calendar_event view view, _calendar_todo view view.
Parameters:
[in]view_uriThe view URI of the record to subscribe for change notifications
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
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_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service using calendar_connect().
Postcondition:
calendar_db_changed_cb() will be invoked when the designated view changes.
See also:
calendar_connect()
calendar_db_changed_cb()
calendar_db_remove_changed_cb()
int calendar_db_clean_after_sync ( int  calendar_book_id,
int  calendar_db_version 
)

Cleans the data after sync.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]calendar_book_idThe calendar book ID
[in]calendar_db_versionThe calendar database version
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
int calendar_db_delete_record ( const char *  view_uri,
int  record_id 
)

Deletes a record from the calendar database with related child records.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]view_uriThe view URI of a record
[in]record_idThe record ID to be deleted
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_insert_record()
int calendar_db_delete_records ( const char *  view_uri,
int  record_id_array[],
int  count 
)

Deletes multiple records with related child records from the calendar database as a batch operation.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]view_uriThe view URI of the records to delete
[in]record_id_arrayThe record IDs to delete
[in]countThe number of records
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_IPCUnknown IPC error
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 open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_insert_records()
calendar_db_delete_records()
int calendar_db_get_all_records ( const char *  view_uri,
int  offset,
int  limit,
calendar_list_h *  record_list 
)

Retrieves all records as a list.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Remarks:
You must release record_list using calendar_list_destroy().
Parameters:
[in]view_uriThe view URI to get records from
[in]offsetThe index from which results are received
[in]limitThe maximum number of results(value 0 is used for all records)
[out]record_listThe record list
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_list_destroy()
int calendar_db_get_changes_by_version ( const char *  view_uri,
int  calendar_book_id,
int  calendar_db_version,
calendar_list_h *  record_list,
int *  current_calendar_db_version 
)

Retrieves records with the given calendar database version.

This function finds all the changed records since the given calendar_db_version.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Remarks:
You must release change_record_list using calendar_list_destroy().
Parameters:
[in]view_uriThe view URI to get records from
[in]calendar_book_idThe calendar book ID to filter
[in]calendar_db_versionThe calendar database version
[out]record_listThe record list
[out]current_calendar_db_versionThe current calendar database version
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_list_destroy()
int calendar_db_get_changes_exception_by_version ( const char *  view_uri,
int  original_event_id,
int  calendar_db_version,
calendar_list_h *  list 
)

Retrieves changed exception records since the given calendar database version. Exceptions are the modified or deleted instances in a recurring event.

This function finds all the changed records since the given calendar_db_version.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Remarks:
You must release change_record_list using calendar_list_destroy().
Parameters:
[in]view_uriThe view URI to get records from
[in]original_event_idThe original event ID
[in]calendar_db_versionThe calendar database version starting from which to get records
[out]listThe record list
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_list_destroy()
int calendar_db_get_count ( const char *  view_uri,
int *  count 
)

Gets the record count of a specific view.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Parameters:
[in]view_uriThe view URI to get records from
[out]countThe number of records
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service using calendar_connect2().
See also:
calendar_connect()
int calendar_db_get_count_with_query ( calendar_query_h  query,
int *  count 
)

Gets the record count with a query handle.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Parameters:
[in]queryThe query handle used for filtering the results
[out]countThe number of records
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service using calendar_connect2().
See also:
calendar_connect2()
int calendar_db_get_current_version ( int *  calendar_db_version)

Gets the current calendar database version.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Parameters:
[out]calendar_db_versionThe calendar database version
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service using calendar_connect().
See also:
calendar_connect()
calendar_db_get_changes_by_version()
int calendar_db_get_last_change_version ( int *  last_change_version)

Gets the last successful change version of the database on the current connection.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Parameters:
[out]last_change_versionThe calendar database version on the current connection
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service using calendar_connect().
See also:
calendar_connect()
calendar_db_get_current_version()
int calendar_db_get_record ( const char *  view_uri,
int  record_id,
calendar_record_h *  record 
)

Gets a record from the calendar database.

This function creates a new record handle from the calendar database by the given record_id.
record will be created and filled with record information.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Remarks:
You must release record using calendar_record_destroy().
Parameters:
[in]view_uriThe view URI of a record
[in]record_idThe record ID
[out]recordThe record handle associated with the record ID
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_record_destroy()
int calendar_db_get_records_with_query ( calendar_query_h  query,
int  offset,
int  limit,
calendar_list_h *  record_list 
)

Retrieves records using a query handle.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Remarks:
You must release record_list using calendar_list_destroy().
Parameters:
[in]queryThe query handle used to filter results
[in]offsetThe index from which results are received
[in]limitThe maximum number of results(value 0 is used for all records)
[out]record_listThe record list
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_list_destroy()
int calendar_db_insert_record ( calendar_record_h  record,
int *  record_id 
)

Inserts a record into the calendar database.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]recordThe record handle
[out]record_idThe record ID
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_update_record()
calendar_db_delete_record()
calendar_db_get_record()
int calendar_db_insert_records ( calendar_list_h  record_list,
int **  record_id_array,
int *  count 
)

Inserts multiple records into the calendar database as a batch operation.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]record_listThe record list handle
[out]record_id_arrayThe array of record IDs
[out]countThe number of record IDs
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
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 open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_update_records()
calendar_db_delete_records()
int calendar_db_insert_vcalendars ( const char *  vcalendar_stream,
int **  record_id_array,
int *  count 
)

Inserts a vcalendar stream into the calendar database.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]vcalendar_streamThe vcalendar stream
[out]record_id_arrayThe record IDs to delete
[out]countThe number of record ID arrays
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_replace_vcalendars()
int calendar_db_link_record ( int  base_id,
int  record_id 
)

Links a record to another record.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]base_idThe base record ID
[in]record_idThe record ID to link to
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
int calendar_db_remove_changed_cb ( const char *  view_uri,
calendar_db_changed_cb  callback,
void *  user_data 
)

Unregisters a callback function.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.read
Parameters:
[in]view_uriThe view URI of the record to subscribe for change notifications
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service using calendar_connect().
See also:
calendar_connect()
calendar_db_changed_cb()
calendar_db_add_changed_cb()
int calendar_db_replace_record ( calendar_record_h  record,
int  record_id 
)

Replaces a record in the calendar database.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]recordThe record handle
[in]record_idThe record ID
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
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 open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_update_record()
calendar_db_delete_record()
calendar_db_get_record()
int calendar_db_replace_records ( calendar_list_h  record_list,
int *  record_id_array,
int  count 
)

Replaces multiple records in the calendar database as a batch operation.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]record_listThe record list handle
[in]record_id_arrayThe record IDs
[in]countThe number of record ID arrays
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
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 open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_update_records()
calendar_db_delete_records()
calendar_db_replace_record()
int calendar_db_replace_vcalendars ( const char *  vcalendar_stream,
int *  record_id_array,
int  count 
)

Replaces a vcalendar stream in the calendar database.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]vcalendar_streamThe vcalendar stream
[in]record_id_arrayThe record IDs to replace
[in]countThe number of record ID arrays
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This function requires an open connection to the calendar service by calendar_connect().
See also:
calendar_connect()
calendar_db_replace_vcalendars()
int calendar_db_unlink_record ( int  record_id)

Unlinks a record from base record.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]record_idThe record ID to unlink
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied
CALENDAR_ERROR_FILE_NO_SPACEFile system is full
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
int calendar_db_update_record ( calendar_record_h  record)

Updates a record in the calendar database.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]recordThe record handle
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_insert_record()
calendar_db_delete_record()
calendar_db_get_record()
int calendar_db_update_records ( calendar_list_h  record_list)

Updates multiple records into the calendar database as a batch operation.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/calendar.write
Parameters:
[in]record_listThe record list handle
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_NO_DATAData does not exist
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method.
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_DB_RECORD_NOT_FOUNDDatabase not found
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
Precondition:
calendar_connect() should be called to open a connection to the calendar service.
See also:
calendar_connect()
calendar_db_insert_records()
calendar_db_delete_records()