Tizen Native API  5.5
Common

The calendar common API provides the set of definitions and interfaces to initialize and deinitialize.

Required Header

#include <calendar.h>

Functions

int calendar_connect (void)
 Connects to the calendar service.
int calendar_disconnect (void)
 Disconnects from the calendar service.
int calendar_connect_on_thread (void)
 Connects to the calendar service on a thread.
int calendar_disconnect_on_thread (void)
 Disconnects from the calendar service on a thread.
int calendar_connect_with_flags (unsigned int flags)
 Connects to the calendar service.

Enumeration Type Documentation

Enumeration for calendar errors.

Since :
2.3
Enumerator:
CALENDAR_ERROR_NONE 

Successful

CALENDAR_ERROR_OUT_OF_MEMORY 

Out of memory

CALENDAR_ERROR_INVALID_PARAMETER 

Invalid parameter

CALENDAR_ERROR_NO_DATA 

Requested data does not exist

CALENDAR_ERROR_NOW_IN_PROGRESS 

Operation now in progress

CALENDAR_ERROR_ALREADY_IN_PROGRESS 

Operation already in progress

CALENDAR_ERROR_NOT_PERMITTED 

Operation not permitted

CALENDAR_ERROR_FILE_NO_SPACE 

FS is full

CALENDAR_ERROR_PERMISSION_DENIED 

Permission denied

CALENDAR_ERROR_DB_FAILED 

No access to the database

CALENDAR_ERROR_ITERATOR_END 

Iterator is on the last position

CALENDAR_ERROR_DB_RECORD_NOT_FOUND 

Database not found

CALENDAR_ERROR_IPC 

Unknown IPC error

CALENDAR_ERROR_SYSTEM 

Error from another modules

CALENDAR_ERROR_NOT_SUPPORTED 

Not supported (Since 4.0)


Function Documentation

int calendar_connect ( void  )

Connects to the calendar service.

Since :
2.3
Remarks:
Opening the connection is necessary to access the calendar database and perform operations such as fetching, inserting, or updating records.
The execution of calendar_connect() and calendar_disconnect() could slow down your application, so you are recommended not to call them frequently.
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
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
See also:
calendar_disconnect()

Connects to the calendar service on a thread.

Since :
2.3
Remarks:
Opening a connection is necessary to access the calendar database and perform operations such as fetching, inserting, or updating records.
On a thread environment with calendar_connect(), request in one thread could fail, while another request connection is working in the other thread. To prevent request failure, calendar_connect_on_thread() is recommended.
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
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
See also:
calendar_disconnect_on_thread()
int calendar_connect_with_flags ( unsigned int  flags)

Connects to the calendar service.

Since :
2.3
Remarks:
Opening a connection is necessary to access the calendar database and perform operations such as fetching, inserting, or updating records.
Before the calendar-service daemon is ready, if you call calendar_connect(), it could fail. It is recommended to call this API with CALENDAR_CONNECT_FLAG_RETRY flags in such a situation.
Parameters:
[in]flagscalendar_connect_flag
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_OUT_OF_MEMORYOut of memory
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
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
See also:
calendar_disconnect(), CALENDAR_CONNECT_FLAG_RETRY
int calendar_disconnect ( void  )

Disconnects from the calendar service.

Since :
2.3
Remarks:
If there is no open connection, this function returns CALENDAR_ERROR_DB_FAILED.
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_IPCUnknown IPC error
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
See also:
calendar_connect()

Disconnects from the calendar service on a thread.

Since :
2.3
Remarks:
If there is no open connection, this function returns CALENDAR_ERROR_DB_FAILED.
Returns:
0 on success, otherwise a negative error value
Return values:
CALENDAR_ERROR_NONESuccessful
CALENDAR_ERROR_DB_FAILEDDatabase operation failure
CALENDAR_ERROR_INVALID_PARAMETERInvalid parameter
CALENDAR_ERROR_NOT_PERMITTEDOperation not permitted
CALENDAR_ERROR_SYSTEMInternal system module error
CALENDAR_ERROR_NOT_SUPPORTEDNot supported
See also:
calendar_connect_on_thread()