SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
+SET(INTERFACE_PREFIX "org.tizen.calendar_service")
+SET(DBUS_INTERFACE "${INTERFACE_PREFIX}.dbus")
SET(CLIENT calendar-service2)
SET(DAEMON calendar-serviced)
EXECUTE_PROCESS(COMMAND build-util/generator.sh)
+CONFIGURE_FILE(${DBUS_INTERFACE}.conf.in ${DBUS_INTERFACE}.conf @ONLY)
+INSTALL(FILES ${DBUS_INTERFACE}.conf DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
+
+ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(server)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/ipc)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/dbus)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client)
FILE(GLOB CLIENT_SRCS
- ${CMAKE_SOURCE_DIR}/common/ipc/*.c
+ ${CMAKE_SOURCE_DIR}/common/dbus/*.c
${CMAKE_SOURCE_DIR}/common/*.c*
*.c)
+SET(CLIENT_SRCS ${CLIENT_SRCS} ${CMAKE_SOURCE_DIR}/common/dbus/cal_dbus.c)
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/common/dbus/cal_dbus.c
+ PROPERTIES GENERATED TRUE)
pkg_check_modules(client_pkgs REQUIRED
glib-2.0
contacts-service2
libtzplatform-config
capi-appfw-package-manager
- pims-ipc
dlog
- capi-base-common)
+ capi-base-common
+ gio-2.0
+ gio-unix-2.0)
INCLUDE_DIRECTORIES(${client_pkgs_INCLUDE_DIRS})
LINK_DIRECTORIES(${client_pkgs_LIBRARY_DIRS})
ADD_DEFINITIONS("-DCAL_IPC_CLIENT")
+ADD_DEFINITIONS("-DCAL_DBUS_INTERFACE=\"${DBUS_INTERFACE}\"")
ADD_LIBRARY(${CLIENT} SHARED ${CLIENT_SRCS})
+ADD_DEPENDENCIES(${CLIENT} GENERATED_DBUS_CODE)
TARGET_LINK_LIBRARIES(${CLIENT} ${client_pkgs_LIBRARIES})
SET_TARGET_PROPERTIES(${CLIENT} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
INSTALL(TARGETS ${CLIENT} DESTINATION ${LIB_INSTALL_DIR})
#include "calendar.h"
#include "cal_internal.h"
+#include "cal_client_dbus.h"
#include "cal_client_handle.h"
#include "cal_client_db_helper.h"
API int calendar_db_insert_record(calendar_record_h record, int* id)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == id, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_insert_record(handle, record, id);
- return ret;
+ return cal_dbus_insert_record(handle, record, id);
}
API int calendar_db_update_record(calendar_record_h record)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_update_record(handle, record);
- return ret;
+ return cal_dbus_update_record(handle, record);
}
API int calendar_db_delete_record(const char* view_uri, int id)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(id < 0, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_delete_record(handle, view_uri, id);
- return ret;
+ return cal_dbus_delete_record(handle, view_uri, id);
}
API int calendar_db_replace_record(calendar_record_h record, int record_id)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_replace_record(handle, record, record_id);
- return ret;
+ return cal_dbus_replace_record(handle, record, record_id);
}
API int calendar_db_get_record(const char* view_uri, int id, calendar_record_h* out_record)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(id < 0, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_record(handle, view_uri, id, out_record);
- return ret;
+ return cal_dbus_get_record(handle, view_uri, id, out_record);
}
API int calendar_db_get_all_records(const char* view_uri, int offset, int limit, calendar_list_h* out_list)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_all_records(handle, view_uri, offset, limit, out_list);
- return ret;
+ return cal_dbus_get_all_records(handle, view_uri, offset, limit, out_list);
}
API int calendar_db_get_records_with_query(calendar_query_h query, int offset, int limit, calendar_list_h* out_list)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_records_with_query(handle, query, offset, limit, out_list);
- return ret;
+ return cal_dbus_get_records_with_query(handle, query, offset, limit, out_list);
}
-API int calendar_db_clean_after_sync(int calendar_book_id, int calendar_db_version)
+API int calendar_db_clean_after_sync(int book_id, int calendar_db_version)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_clean_after_sync(handle, calendar_book_id, calendar_db_version);
- return ret;
+ return cal_dbus_clean_after_sync(handle, book_id, calendar_db_version);
}
API int calendar_db_get_count(const char *view_uri, int *out_count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_count(handle, view_uri, out_count);
- return ret;
+ return cal_dbus_get_count(handle, view_uri, out_count);
}
API int calendar_db_get_count_with_query(calendar_query_h query, int *out_count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_count, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_count_with_query(handle, query, out_count);
- return ret;
+ return cal_dbus_get_count_with_query(handle, query, out_count);
}
API int calendar_db_insert_records(calendar_list_h record_list, int** record_id_array, int* count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == count, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ int list_count = 0;
+ calendar_list_get_count(record_list, &list_count);
+ if (0 == list_count) {
+ DBG("list count is 0");
+ return CALENDAR_ERROR_NONE;
+ }
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_insert_records(handle, record_list, record_id_array, count);
- return ret;
+ return cal_dbus_insert_records(handle, record_list, record_id_array, count);
}
API int calendar_db_update_records(calendar_list_h record_list)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ int list_count = 0;
+ calendar_list_get_count(record_list, &list_count);
+ if (0 == list_count) {
+ DBG("list count is 0");
+ return CALENDAR_ERROR_NONE;
+ }
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_update_records(handle, record_list);
- return ret;
+ return cal_dbus_update_records(handle, record_list);
}
API int calendar_db_delete_records(const char* view_uri, int record_id_array[], int count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_delete_records(handle, view_uri, record_id_array, count);
- return ret;
+ return cal_dbus_delete_records(handle, view_uri, record_id_array, count);
}
API int calendar_db_replace_records(calendar_list_h record_list, int *record_id_array, int count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(count < 1, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ int list_count = 0;
+ calendar_list_get_count(record_list, &list_count);
+ if (0 == list_count) {
+ DBG("list count is 0");
+ return CALENDAR_ERROR_NONE;
+ }
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_replace_records(handle, record_list, record_id_array, count);
- return ret;
+ return cal_dbus_replace_records(handle, record_list, record_id_array, count);
}
-API 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)
+API int calendar_db_get_changes_by_version(const char* view_uri, int book_id,
+ int calendar_db_version, calendar_list_h* record_list, int* current_version)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == current_version, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_changes_by_version(handle, view_uri, calendar_book_id, calendar_db_version, record_list, current_calendar_db_version);
- return ret;
+ return cal_dbus_get_changes_by_version(handle, view_uri, book_id,
+ calendar_db_version, record_list, current_version);
}
-API int calendar_db_get_current_version(int* calendar_db_version)
+API int calendar_db_get_current_version(int* current_version)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == current_version, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_current_version(handle, calendar_db_version);
- return ret;
+ return cal_dbus_get_current_version(handle, current_version);
}
API int calendar_db_add_changed_cb(const char* view_uri, calendar_db_changed_cb callback, void* user_data)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_add_changed_cb(handle, view_uri, callback, user_data);
- return ret;
+ return cal_client_db_add_changed_cb(handle, view_uri, callback, user_data);
}
API int calendar_db_remove_changed_cb(const char* view_uri, calendar_db_changed_cb callback, void* user_data)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_remove_changed_cb(handle, view_uri, callback, user_data);
- return ret;
+ return cal_client_db_remove_changed_cb(handle, view_uri, callback, user_data);
}
API int calendar_db_insert_vcalendars(const char* vcalendar_stream, int **record_id_array, int *count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == vcalendar_stream, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == count, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_insert_vcalendars(handle, vcalendar_stream, record_id_array, count);
- return ret;
+ return cal_dbus_insert_vcalendars(handle, vcalendar_stream, record_id_array, count);
}
API int calendar_db_replace_vcalendars(const char* vcalendar_stream, int *record_id_array, int count)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == vcalendar_stream, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_replace_vcalendars(handle, vcalendar_stream, record_id_array, count);
- return ret;
+ return cal_dbus_replace_vcalendars(handle, vcalendar_stream, record_id_array, count);
}
API int calendar_db_get_last_change_version(int* last_version)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == last_version, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_last_change_version(handle, last_version);
- return ret;
+ return cal_dbus_get_last_change_version(handle, last_version);
}
-API int calendar_db_get_changes_exception_by_version(const char* view_uri, int original_event_id, int calendar_db_version, calendar_list_h* record_list)
+API int calendar_db_get_changes_exception_by_version(const char* view_uri,
+ int original_event_id, int calendar_db_version, calendar_list_h* record_list)
{
+ CAL_FN_CALL();
+
int ret = 0;
calendar_h handle = NULL;
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(original_event_id < 0, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(calendar_db_version < 0, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
ret = cal_client_handle_get_p(&handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
- ret = cal_client_db_get_changes_exception_by_version(handle, view_uri, original_event_id, calendar_db_version, record_list);
- return ret;
+ return cal_dbus_get_changes_exception_by_version(handle, view_uri, original_event_id, calendar_db_version, record_list);
}
*/
#include <stdlib.h>
-#include <pims-ipc.h>
-#include <glib-object.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <unistd.h>
#include "calendar.h"
#include "cal_inotify.h"
#include "cal_view.h"
#include "cal_record.h"
-#include "cal_list.h"
-#include "cal_mutex.h"
-#include "cal_ipc.h"
-#include "cal_ipc_marshal.h"
-#include "cal_client_ipc.h"
#include "cal_handle.h"
-#define __CAL_CLIENT_ACCESS_MAX 10
-#define __CAL_CLIENT_ALLOW_USEC 25000
-
-#define CAL_LIMIT_ACCESS_FRONT(uri) \
- int is_schedule = 0; \
-do { \
- if (CAL_STRING_EQUAL == strncmp(uri, CALENDAR_VIEW_EVENT, strlen(CALENDAR_VIEW_EVENT))) \
- { \
- is_schedule = 1; \
- struct timeval hold = {0}; \
- struct timeval diff = {0}; \
- gettimeofday(&hold, NULL); \
- timersub(&hold, &__g_release_time, &diff); \
- DBG("%ld.%ld sec", diff.tv_sec, diff.tv_usec); \
- if (diff.tv_sec / 1000 == 0 && diff.tv_usec < __CAL_CLIENT_ALLOW_USEC) \
- { \
- if (__g_access_count < __CAL_CLIENT_ACCESS_MAX) \
- { \
- __g_access_count++; \
- DBG("--count (%d)", __g_access_count); \
- } \
- else \
- { \
- DBG("--sleep"); \
- usleep(200000); \
- __g_access_count = 0; \
- timerclear(&__g_release_time); \
- } \
- } \
- else \
- { \
- DBG("--reset"); \
- __g_access_count = 0; \
- timerclear(&__g_release_time); \
- } \
- } \
-} while (0)
-
-#define CAL_LIMIT_ACCESS_BACK \
- do { \
- if (is_schedule) \
- { \
- gettimeofday(&__g_release_time, NULL); \
- } \
- } while (0)
-
-
-static int __g_access_count;
-static struct timeval __g_release_time;
-
-int cal_client_db_insert_record(calendar_h handle, calendar_record_h record, int* id)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
-
- CAL_RECORD_RESET_COMMON((cal_record_s *)record);
- CAL_LIMIT_ACCESS_FRONT(((cal_record_s *)record)->view_uri);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_record(record, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_record() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_INSERT_RECORD, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- int out_id = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- out_id = *(int*)ret_pims;
-
- if (id)
- *id = out_id;
-
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
-}
-
-int cal_client_db_update_record(calendar_h handle, calendar_record_h record)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
-
- CAL_LIMIT_ACCESS_FRONT(((cal_record_s *)record)->view_uri);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_record(record,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_record() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_UPDATE_RECORD, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
-}
-
-int cal_client_db_delete_record(calendar_h handle, const char* view_uri, int id)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(id <= 0, CALENDAR_ERROR_INVALID_PARAMETER, "id(%d) <= 0", id);
-
- CAL_LIMIT_ACCESS_FRONT(view_uri);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(id,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_DELETE_RECORD, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
-}
-
-int cal_client_db_replace_record(calendar_h handle, calendar_record_h record, int record_id)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(record_id < 0, CALENDAR_ERROR_INVALID_PARAMETER, "record_id(%d) < 0", record_id);
-
- CAL_LIMIT_ACCESS_FRONT(((cal_record_s *)record)->view_uri);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_record(record,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_record() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(record_id,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_REPLACE_RECORD, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- ret = CALENDAR_ERROR_IPC;
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- CAL_LIMIT_ACCESS_BACK;
- return ret;
-}
-
-int cal_client_db_get_record(calendar_h handle, const char* view_uri, int id, calendar_record_h* out_record)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(id <= 0, CALENDAR_ERROR_INVALID_PARAMETER, "id(%d) <= 0", id);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(id, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_RECORD, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- ret = cal_ipc_unmarshal_record(outdata, out_record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_all_records(calendar_h handle, const char* view_uri, int offset, int limit, calendar_list_h* out_list)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(offset,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(limit,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_ALL_RECORDS, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
- ret = cal_ipc_unmarshal_list(outdata,out_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_records_with_query(calendar_h handle, calendar_query_h query, int offset, int limit, calendar_list_h* out_list)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_query(query,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_query() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(offset,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(limit,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_RECORDS_WITH_QUERY, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- ret = cal_ipc_unmarshal_list(outdata,out_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_clean_after_sync(calendar_h handle, int calendar_book_id, int calendar_db_version)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(calendar_book_id <= 0, CALENDAR_ERROR_INVALID_PARAMETER, "calendar_book_id(%d) < 0", calendar_book_id);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(calendar_book_id,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(calendar_db_version,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_CLEAN_AFTER_SYNC, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_count(calendar_h handle, const char *view_uri, int *out_count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == out_count, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_COUNT, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- ret = cal_ipc_unmarshal_int(outdata,out_count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_count_with_query(calendar_h handle, calendar_query_h query, int *out_count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_query(query,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_query() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_COUNT_WITH_QUERY, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- ret = cal_ipc_unmarshal_int(outdata, out_count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_insert_records(calendar_h handle, calendar_list_h record_list, int** record_id_array, int* count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_list(record_list,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_INSERT_RECORDS, indata,&outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- if (NULL == count || NULL == record_id_array) {
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_NONE;
- }
-
- *count = *(int *)pims_ipc_data_get(outdata, &size);
- if (*count <= 0) {
- ERR("count(%d) <= 0", *count);
- *count = 0;
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- int *ids = NULL;
- ids = calloc(1, sizeof(int)*(*count));
- if (NULL == ids) {
- ERR("calloc() Fail");
- *count = 0;
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- int i;
- for(i = 0; i < (*count); i++) {
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- free(ids);
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ids[i] = *(int*)ret_pims;
- }
- *record_id_array = ids;
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_update_records(calendar_h handle, calendar_list_h record_list)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_list(record_list,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_UPDATE_RECORDS, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_delete_records(calendar_h handle, const char* view_uri, int record_id_array[], int count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
- int i = 0;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(count <= 0, CALENDAR_ERROR_INVALID_PARAMETER, "count(%d) <= 0", count);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(count,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- for (i = 0; i < count; i++) {
- ret = cal_ipc_marshal_int(record_id_array[i],indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_DELETE_RECORDS, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_replace_records(calendar_h handle, calendar_list_h record_list, int *record_id_array, int count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
- int i = 0;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(count <= 0, CALENDAR_ERROR_INVALID_PARAMETER, "count(%d) <= 0", count);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_list(record_list,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(count,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- for(i = 0; i < count; i++) {
- ret = cal_ipc_marshal_int(record_id_array[i],indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_REPLACE_RECORDS, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_changes_by_version(calendar_h handle, const char* view_uri, int calendar_book_id, int calendar_db_version, calendar_list_h* record_list, int* current_calendar_db_version)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == current_calendar_db_version, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(calendar_book_id,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(calendar_db_version,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_CHANGES_BY_VERSION, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- ret = cal_ipc_unmarshal_list(outdata, record_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
- ret = cal_ipc_unmarshal_int(outdata, current_calendar_db_version);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_current_version(calendar_h handle, int* calendar_db_version)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == calendar_db_version, CALENDAR_ERROR_INVALID_PARAMETER);
-
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- /* make indata */
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_CURRENT_VERSION, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
- ret = cal_ipc_unmarshal_int(outdata, calendar_db_version);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
int cal_client_db_add_changed_cb(calendar_h handle, const char* view_uri, void *callback, void* user_data)
{
CAL_FN_CALL();
type = cal_view_get_type(view_uri);
switch (type) {
case CAL_RECORD_TYPE_CALENDAR:
- ret = cal_inotify_subscribe(CAL_NOTI_TYPE_CALENDAR, CAL_NOTI_CALENDAR_CHANGED, callback, user_data);
+ ret = cal_inotify_subscribe(CAL_NOTI_TYPE_CALENDAR, CAL_NOTI_CALENDAR_CHANGED,
+ callback, user_data);
break;
case CAL_RECORD_TYPE_EVENT:
- ret = cal_inotify_subscribe(CAL_NOTI_TYPE_EVENT, CAL_NOTI_EVENT_CHANGED, callback, user_data);
+ ret = cal_inotify_subscribe(CAL_NOTI_TYPE_EVENT, CAL_NOTI_EVENT_CHANGED,
+ callback, user_data);
break;
case CAL_RECORD_TYPE_TODO:
- ret = cal_inotify_subscribe(CAL_NOTI_TYPE_TODO, CAL_NOTI_TODO_CHANGED, callback, user_data);
+ ret = cal_inotify_subscribe(CAL_NOTI_TYPE_TODO, CAL_NOTI_TODO_CHANGED,
+ callback, user_data);
break;
default:
ERR("Invalid view_uri(%s)", view_uri);
type = cal_view_get_type(view_uri);
switch (type) {
case CAL_RECORD_TYPE_CALENDAR:
- ret = cal_inotify_unsubscribe_with_data(CAL_NOTI_CALENDAR_CHANGED, callback, user_data);
+ ret = cal_inotify_unsubscribe(CAL_NOTI_CALENDAR_CHANGED, callback, user_data);
break;
case CAL_RECORD_TYPE_EVENT:
- ret = cal_inotify_unsubscribe_with_data(CAL_NOTI_EVENT_CHANGED, callback, user_data);
+ ret = cal_inotify_unsubscribe(CAL_NOTI_EVENT_CHANGED, callback, user_data);
break;
case CAL_RECORD_TYPE_TODO:
- ret = cal_inotify_unsubscribe_with_data(CAL_NOTI_TODO_CHANGED, callback, user_data);
+ ret = cal_inotify_unsubscribe(CAL_NOTI_TODO_CHANGED, callback, user_data);
break;
default:
ERR("Invalid view_uri(%s)", view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_inotify_unsubscribe_with_data() Fail(%d)", ret);
+ ERR("cal_inotify_unsubscribe() Fail(%d)", ret);
return ret;
}
return CALENDAR_ERROR_NONE;
}
-
-int cal_client_db_insert_vcalendars(calendar_h handle, const char* vcalendar_stream, int **record_id_array, int *count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == vcalendar_stream, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(vcalendar_stream,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_INSERT_VCALENDARS, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- if (NULL == count || NULL == record_id_array) {
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- *count = *(int*) pims_ipc_data_get(outdata, &size);
- if (*count <= 0) {
- ERR("count(%d) <= 0", *count);
- *count = 0;
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- int *ids = NULL;
- ids = calloc(1, sizeof(int)*(*count));
- if (NULL == ids) {
- ERR("calloc() Fail");
- *count = 0;
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- int i = 0;
- for(i = 0; i < (*count); i++) {
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- free(ids);
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ids[i] = *(int*)ret_pims;
- }
- *record_id_array = ids;
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_replace_vcalendars(calendar_h handle, const char* vcalendar_stream, int *record_id_array, int count)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
- int i = 0;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == vcalendar_stream, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_id_array, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(count <= 0, CALENDAR_ERROR_INVALID_PARAMETER, "count(%d) <= 0", count);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(vcalendar_stream,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(count,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- for(i = 0; i < count; i++) {
- ret = cal_ipc_marshal_int(record_id_array[i],indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_REPLACE_VCALENDARS, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- int transaction_ver = 0;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- transaction_ver = *(int*)ret_pims;
- cal_client_ipc_set_change_version(handle, transaction_ver);
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-int cal_client_db_get_last_change_version(calendar_h handle, int* last_version)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == last_version, CALENDAR_ERROR_INVALID_PARAMETER);
-
- *last_version = 0;
-
- bool result = false;
- ret = cal_client_ipc_client_check_permission(handle, CAL_PERMISSION_READ, &result);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_client_check_permission() Fail (%d)", ret);
- return ret;
- }
- if (false == result) {
- ERR("Permission denied (calendar read)");
- return CALENDAR_ERROR_PERMISSION_DENIED;
- }
-
- *last_version = cal_client_ipc_get_change_version(handle);
- return ret;
-}
-
-int cal_client_db_get_changes_exception_by_version(calendar_h handle, const char* view_uri, int original_event_id, int calendar_db_version, calendar_list_h* record_list)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record_list, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_char(view_uri,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(original_event_id,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
- ret = cal_ipc_marshal_int(calendar_db_version,indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- ret = cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_CHANGES_EXCEPTION, indata, &outdata);
- pims_ipc_data_destroy(indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_call() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- if (NULL == outdata) {
- ERR("outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("pims_ipc_data_get() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- ret = cal_ipc_unmarshal_list(outdata,record_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return ret;
- }
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-
-#ifdef CAL_MEMORY_TEST
-int cal_client_destroy(void)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- /* make indata */
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- return ret;
- }
-
- /* ipc call */
- if (cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_DESTROY, indata, &outdata) != 0) {
- ERR("cal_client_ipc_call() Fail");
- pims_ipc_data_destroy(indata);
- return CALENDAR_ERROR_IPC;
- }
-
- pims_ipc_data_destroy(indata);
-
- if (NULL == outdata) {
- ERR("ipc outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- /* check outdata */
- unsigned int size = 0;
- void *ret_pims = NULL;
- ret_pims = pims_ipc_data_get(outdata, &size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- ret = *(int*)ret_pims;
-
- pims_ipc_data_destroy(outdata);
- return ret;
-}
-#endif /* #ifdef CAL_MEMORY_TEST */
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <gio/gio.h>
+#include <sys/time.h>
+
+#include "cal_internal.h"
+#include "cal_typedef.h"
+#include "cal_view.h"
+#include "cal_dbus_helper.h"
+#include "cal_dbus.h"
+#include "cal_list.h"
+#include "cal_client_handle.h"
+#include "cal_client_reminder.h"
+
+#define __CAL_CLIENT_ACCESS_MAX 10
+#define __CAL_CLIENT_ALLOW_USEC 25000
+#define CAL_LIMIT_ACCESS_FRONT(uri) \
+ DBG("uri[%s]", uri); \
+ int is_schedule = 0; \
+ do { \
+ if (CAL_STRING_EQUAL == strncmp(uri, CALENDAR_VIEW_EVENT, strlen(CALENDAR_VIEW_EVENT))) \
+ { \
+ is_schedule = 1; \
+ struct timeval hold = {0}; \
+ struct timeval diff = {0}; \
+ gettimeofday(&hold, NULL); \
+ timersub(&hold, &__g_release_time, &diff); \
+ DBG("%ld.%ld sec", diff.tv_sec, diff.tv_usec); \
+ if (diff.tv_sec / 1000 == 0 && diff.tv_usec < __CAL_CLIENT_ALLOW_USEC) \
+ { \
+ if (__g_access_count < __CAL_CLIENT_ACCESS_MAX) \
+ { \
+ __g_access_count++; \
+ DBG("--count (%d)", __g_access_count); \
+ } \
+ else \
+ { \
+ DBG("--sleep"); \
+ usleep(200000); \
+ __g_access_count = 0; \
+ timerclear(&__g_release_time); \
+ } \
+ } \
+ else \
+ { \
+ DBG("--reset"); \
+ __g_access_count = 0; \
+ timerclear(&__g_release_time); \
+ } \
+ } \
+ } while (0)
+
+#define CAL_LIMIT_ACCESS_BACK \
+ do { \
+ if (is_schedule) \
+ { \
+ gettimeofday(&__g_release_time, NULL); \
+ } \
+ } while (0)
+
+static int __g_access_count = 0;
+static struct timeval __g_release_time;
+
+static calDbus *cal_dbus_object;
+
+static void _cal_dbus_sub_id_list_free(gpointer data)
+{
+ GDBusConnection *conn = g_dbus_proxy_get_connection(G_DBUS_PROXY(cal_dbus_object));
+ g_dbus_connection_signal_unsubscribe(conn, GPOINTER_TO_UINT(data));
+}
+
+static void _cal_dbus_cleanup(void)
+{
+ CAL_FN_CALL();
+}
+
+static void _cal_dbus_name_owner_notify(GObject *object, GParamSpec *pspec, gpointer user_data)
+{
+ CAL_FN_CALL();
+
+ GDBusProxy *proxy = G_DBUS_PROXY(object);
+ gchar *name_owner = g_dbus_proxy_get_name_owner(proxy);
+
+ if (name_owner) {
+ DBG("name_owner[%s]", name_owner);
+ return;
+ }
+
+ _cal_dbus_cleanup();
+}
+
+void cal_dbus_call_reminder_cb(GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
+{
+ CAL_FN_CALL();
+
+ int stream_size = 0;
+ char *stream = NULL;
+ cal_dbus_utils_gvariant_to_stream(parameters, &stream_size, &stream);
+ DBG("stream[%s]", stream);
+ cal_client_reminder_call_subscribe(stream);
+}
+
+unsigned int cal_dbus_subscribe_signal(char *signal_name, GDBusSignalCallback callback,
+ gpointer user_data, GDestroyNotify user_data_free_func)
+{
+ GDBusConnection *conn = g_dbus_proxy_get_connection(G_DBUS_PROXY(cal_dbus_object));
+
+ return g_dbus_connection_signal_subscribe(conn,
+ NULL,
+ CAL_DBUS_INTERFACE,
+ signal_name,
+ CAL_DBUS_OBJPATH,
+ NULL,
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ callback,
+ user_data,
+ user_data_free_func);
+}
+
+void cal_dbus_unsubscribe_signal(unsigned int id)
+{
+ GDBusConnection *conn = g_dbus_proxy_get_connection(G_DBUS_PROXY(cal_dbus_object));
+ g_dbus_connection_signal_unsubscribe(conn, id);
+}
+
+static int _register_resource(void)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ cal_dbus_call_register_resource_sync(cal_dbus_object, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_register_resource_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+ return ret;
+}
+
+static int _unregister_resource(void)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ cal_dbus_call_unregister_resource_sync(cal_dbus_object, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_register_resource_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+ return ret;
+}
+
+int cal_dbus_start(void)
+{
+ if (cal_dbus_object) {
+ DBG("Already exists");
+ return CALENDAR_ERROR_NONE;
+ }
+
+ GError *error = NULL;
+ cal_dbus_object = cal_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ CAL_DBUS_INTERFACE,
+ CAL_DBUS_OBJPATH,
+ NULL,
+ &error);
+ if (NULL == cal_dbus_object) {
+ ERR("cal_dbus_proxy_new_for_bus_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ _register_resource();
+
+ unsigned int id;
+ id = g_signal_connect(cal_dbus_object, "notify::g-name-owner",
+ G_CALLBACK(_cal_dbus_name_owner_notify), NULL);
+ if (0 == id) {
+ ERR("g_signal_connect() Fail");
+ return CALENDAR_ERROR_IPC;
+ }
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_stop(void)
+{
+ if (NULL == cal_dbus_object) {
+ ERR("No object");
+ return CALENDAR_ERROR_NONE;
+ }
+
+ DBG("[ALL CONNECTION IS CLOSED]");
+
+ _unregister_resource();
+ _cal_dbus_cleanup();
+
+ g_object_unref(cal_dbus_object);
+ cal_dbus_object = NULL;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_recovery(void)
+{
+ CAL_FN_CALL();
+
+ if (cal_dbus_object) {
+ DBG("unref");
+ g_object_unref(cal_dbus_object);
+ cal_dbus_object = NULL;
+ }
+
+ GError *error = NULL;
+ cal_dbus_object = cal_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ CAL_DBUS_INTERFACE,
+ CAL_DBUS_OBJPATH,
+ NULL,
+ &error);
+ if (NULL == cal_dbus_object) {
+ ERR("cal_dbus_proxy_new_for_bus_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ unsigned int id;
+ id = g_signal_connect(cal_dbus_object, "notify::g-name-owner",
+ G_CALLBACK(_cal_dbus_name_owner_notify), NULL);
+ if (0 == id) {
+ ERR("g_signal_connect() Fail");
+ return CALENDAR_ERROR_IPC;
+ }
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_insert_record(calendar_h handle, calendar_record_h record, int *out_id)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+ int id = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ CAL_RECORD_RESET_COMMON((cal_record_s *)record);
+ CAL_LIMIT_ACCESS_FRONT(((cal_record_s *)record)->view_uri);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_record = cal_dbus_utils_record_to_gvariant(record);
+ cal_dbus_call_insert_record_sync(cal_dbus_object, arg_handle, arg_record,
+ &id, &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_insert_record_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_record);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+ if (out_id)
+ *out_id = id;
+ CAL_LIMIT_ACCESS_BACK;
+ return ret;
+}
+
+int cal_dbus_update_record(calendar_h handle, calendar_record_h record)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ CAL_LIMIT_ACCESS_FRONT(((cal_record_s *)record)->view_uri);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_record = cal_dbus_utils_record_to_gvariant(record);
+ cal_dbus_call_update_record_sync(cal_dbus_object, arg_handle, arg_record,
+ &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_update_record_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_record);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+ CAL_LIMIT_ACCESS_BACK;
+ return ret;
+}
+
+int cal_dbus_delete_record(calendar_h handle, const char *view_uri, int id)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ CAL_LIMIT_ACCESS_FRONT(view_uri);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ cal_dbus_call_delete_record_sync(cal_dbus_object, arg_handle, view_uri, id,
+ &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_delete_record_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+ CAL_LIMIT_ACCESS_BACK;
+ return ret;
+}
+
+int cal_dbus_replace_record(calendar_h handle, calendar_record_h record, int id)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ CAL_LIMIT_ACCESS_FRONT(((cal_record_s *)record)->view_uri);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_record = cal_dbus_utils_record_to_gvariant(record);
+ cal_dbus_call_replace_record_sync(cal_dbus_object, arg_handle, arg_record, id,
+ &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_replace_record_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_record);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+ CAL_LIMIT_ACCESS_BACK;
+ return ret;
+}
+
+int cal_dbus_insert_records(calendar_h handle, calendar_list_h list,
+ int** out_ids, int* out_count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int count = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ GVariant *arg_ids = NULL;
+ cal_dbus_call_insert_records_sync(cal_dbus_object, arg_handle, arg_list,
+ &arg_ids, &count, &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_insert_records_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_list);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ cal_client_handle_set_version(handle, version);
+
+ int *ids = NULL;
+ cal_dbus_utils_gvariant_to_ids(arg_ids, count, &ids);
+
+ if (out_ids)
+ *out_ids = ids;
+ else
+ free(ids);
+
+ if (out_count)
+ *out_count = count;
+
+ return ret;
+}
+
+int cal_dbus_update_records(calendar_h handle, calendar_list_h list)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ cal_dbus_call_update_records_sync(cal_dbus_object, arg_handle, arg_list,
+ &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_update_records_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+ return ret;
+}
+
+int cal_dbus_delete_records(calendar_h handle, const char *view_uri, int *ids, int count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == ids, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(0 == count, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_ids = cal_dbus_utils_ids_to_gvariant(ids, count);
+ cal_dbus_call_delete_records_sync(cal_dbus_object, arg_handle, view_uri,
+ arg_ids, count, &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_delete_records_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ cal_client_handle_set_version(handle, version);
+ return ret;
+}
+
+int cal_dbus_replace_records(calendar_h handle, calendar_list_h list, int *ids, int count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == ids, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(0 == count, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ GVariant *arg_ids = cal_dbus_utils_ids_to_gvariant(ids, count);
+ cal_dbus_call_replace_records_sync(cal_dbus_object, arg_handle, arg_list,
+ arg_ids, count, &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_replace_records_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_list);
+ g_variant_unref(arg_ids);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+ return ret;
+}
+
+int cal_dbus_get_record(calendar_h handle, const char *view_uri, int id,
+ calendar_record_h *out_record)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ DBG("uri[%s]", view_uri);
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_record = NULL;
+ cal_dbus_call_get_record_sync(cal_dbus_object, arg_handle, view_uri, id,
+ &arg_record, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_record_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("get_record() Fail(%d)", ret);
+ g_variant_unref(arg_record);
+ *out_record = NULL;
+ return ret;
+ }
+
+ cal_dbus_utils_gvariant_to_record(arg_record, out_record);
+ return ret;
+}
+
+int cal_dbus_get_all_records(calendar_h handle, const char *view_uri,
+ int offset, int limit, calendar_list_h *out_list)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_list = NULL;
+ cal_dbus_call_get_all_records_sync(cal_dbus_object, arg_handle, view_uri,
+ offset, limit, &arg_list, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_all_records_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("get_all_records() Fail(%d)", ret);
+ g_variant_unref(arg_list);
+ *out_list = NULL;
+ return ret;
+ }
+
+ cal_dbus_utils_gvariant_to_list(arg_list, out_list);
+ if (*out_list)
+ calendar_list_first(*out_list);
+ return ret;
+}
+
+int cal_dbus_get_records_with_query(calendar_h handle, calendar_query_h query,
+ int offset, int limit, calendar_list_h* out_list)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_query = cal_dbus_utils_query_to_gvariant(query);
+ GVariant *arg_list = NULL;
+
+ cal_dbus_call_get_records_with_query_sync(cal_dbus_object, arg_handle, arg_query,
+ offset, limit, &arg_list, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_records_with_query_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_query);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ cal_dbus_utils_gvariant_to_list(arg_list, out_list);
+ if (*out_list)
+ calendar_list_first(*out_list);
+ return ret;
+}
+
+int cal_dbus_get_count(calendar_h handle, const char *view_uri, int *out_count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int count = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_count, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ cal_dbus_call_get_count_sync(cal_dbus_object, arg_handle, view_uri,
+ &count, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_count_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ *out_count = count;
+ return ret;
+}
+
+int cal_dbus_get_count_with_query(calendar_h handle, calendar_query_h query, int *out_count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int count = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_count, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_query = cal_dbus_utils_query_to_gvariant(query);
+ cal_dbus_call_get_count_with_query_sync(cal_dbus_object, arg_handle, arg_query,
+ &count, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_count_with_query_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_query);
+ return CALENDAR_ERROR_IPC;
+ }
+ *out_count = count;
+ return ret;
+}
+
+int cal_dbus_get_current_version(calendar_h handle, int *out_version)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_version, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ cal_dbus_call_get_current_version_sync(cal_dbus_object, arg_handle,
+ &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_current_version_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("server return Fail(%d)", ret);
+ g_variant_unref(arg_handle);
+ return ret;
+ }
+
+ *out_version = version;
+ return ret;
+}
+
+int cal_dbus_get_last_change_version(calendar_h handle, int *out_version)
+{
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_version, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ return cal_handle_get_version(handle, out_version);
+}
+
+int cal_dbus_get_changes_by_version(calendar_h handle, const char *view_uri,
+ int book_id, int in_version, calendar_list_h *out_list, int *out_version)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_version, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_list = NULL;
+ cal_dbus_call_get_changes_by_version_sync(cal_dbus_object, arg_handle, view_uri,
+ book_id, in_version, &arg_list, out_version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_changes_by_version_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_dbus_utils_gvariant_to_list(arg_list, out_list);
+ if (*out_list)
+ calendar_list_first(*out_list);
+ return ret;
+}
+
+int cal_dbus_get_changes_exception_by_version(calendar_h handle, const char *view_uri,
+ int original_id, int version, calendar_list_h *out_list)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_list = NULL;
+ cal_dbus_call_get_changes_exception_by_version_sync(cal_dbus_object, arg_handle,
+ view_uri, original_id, version, &arg_list, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_get_changes_exception_by_version_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+
+ cal_dbus_utils_gvariant_to_list(arg_list, out_list);
+ if (*out_list)
+ calendar_list_first(*out_list);
+ return ret;
+}
+
+int cal_dbus_clean_after_sync(calendar_h handle, int book_id, int version)
+{
+ GError *error = NULL;
+ int ret = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ cal_dbus_call_clean_after_sync_sync(cal_dbus_object, arg_handle, book_id, version,
+ &ret, NULL, &error);
+
+ if (error) {
+ ERR("cal_dbus_call_clean_after_sync_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ return ret;
+}
+
+int cal_dbus_insert_vcalendars(calendar_h handle, const char *stream,
+ int **out_ids, int *out_count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+ int count = 0;
+ GVariant *arg_ids = NULL;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == stream, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_ids, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_count, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ cal_dbus_call_insert_vcalendars_sync(cal_dbus_object, arg_handle, stream,
+ &arg_ids, &count, &version, &ret, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_insert_vcalendars_sync() Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+
+ int *ids = NULL;
+ cal_dbus_utils_gvariant_to_ids(arg_ids, count, &ids);
+ if (out_ids)
+ *out_ids = ids;
+ else
+ free(ids);
+
+ if (out_count)
+ *out_count = count;
+
+ return ret;
+}
+
+int cal_dbus_replace_vcalendars(calendar_h handle, const char *stream,
+ int *ids, int count)
+{
+ GError *error = NULL;
+ int ret = 0;
+ int version = 0;
+
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == stream, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == ids, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(0 == count, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cal_dbus_object, CALENDAR_ERROR_IPC);
+
+ GVariant *arg_handle = cal_dbus_utils_handle_to_gvariant(handle);
+ GVariant *arg_ids = cal_dbus_utils_ids_to_gvariant(ids, count);
+ cal_dbus_call_replace_vcalendars_sync(cal_dbus_object, arg_handle, stream,
+ arg_ids, count, &ret, &version, NULL, &error);
+ if (error) {
+ ERR("cal_dbus_call_replace_vcalendars_sync Fail[%s]", error->message);
+ g_error_free(error);
+ g_variant_unref(arg_handle);
+ g_variant_unref(arg_ids);
+ return CALENDAR_ERROR_IPC;
+ }
+ cal_client_handle_set_version(handle, version);
+
+ return ret;
+}
+
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __CAL_CLIENT_DBUS_H__
+#define __CAL_CLIENT_DBUS_H__
+
+#include <gio/gio.h>
+
+void cal_dbus_call_reminder_cb(GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data);
+unsigned int cal_dbus_subscribe_signal(char *signal_name, GDBusSignalCallback callback,
+ gpointer user_data, GDestroyNotify user_data_free_func);
+void cal_dbus_unsubscribe_signal(unsigned int id);
+
+unsigned int cal_dbus_start(void);
+void cal_dbus_stop(void);
+
+int cal_dbus_insert_record(calendar_h handle, calendar_record_h record, int *out_id);
+int cal_dbus_update_record(calendar_h handle, calendar_record_h record);
+int cal_dbus_delete_record(calendar_h handle, const char *view_uri, int id);
+int cal_dbus_replace_record(calendar_h handle, calendar_record_h record, int id);
+int cal_dbus_insert_records(calendar_h handle, calendar_list_h list, int** out_ids,
+ int* out_count);
+int cal_dbus_update_records(calendar_h handle, calendar_list_h list);
+int cal_dbus_delete_records(calendar_h handle, const char *view_uri, int *ids,
+ int count);
+int cal_dbus_replace_records(calendar_h handle, calendar_list_h list, int *ids,
+ int count);
+int cal_dbus_get_record(calendar_h handle, const char *view_uri, int id,
+ calendar_record_h *out_record);
+int cal_dbus_get_all_records(calendar_h handle, const char *view_uri,
+ int offset, int limit, calendar_list_h *out_list);
+int cal_dbus_get_records_with_query(calendar_h handle, calendar_query_h query,
+ int offset, int limit, calendar_list_h* out_list);
+int cal_dbus_get_count(calendar_h handle, const char *view_uri, int *out_count);
+int cal_dbus_get_count_with_query(calendar_h handle, calendar_query_h query,
+ int *out_count);
+int cal_dbus_get_current_version(calendar_h handle, int *out_version);
+int cal_dbus_get_changes_by_version(calendar_h handle, const char *view_uri,
+ int book_id, int version, calendar_list_h *out_list, int *out_version);
+int cal_dbus_get_changes_exception_by_version(calendar_h handle, const char *view_uri,
+ int original_id, int version, calendar_list_h *out_list);
+int cal_dbus_clean_after_sync(calendar_h handle, int book_id, int version);
+int cal_dbus_insert_vcalendars(calendar_h handle, const char *stream, int **out_ids,
+ int *out_count);
+int cal_dbus_replace_vcalendars(calendar_h handle, const char *stream, int *ids,
+ int count);
+int cal_dbus_get_last_change_version(calendar_h handle, int *out_version);
+
+#endif /* __CAL_CLIENT_DBUS_H__ */
static GHashTable *_cal_handle_table = NULL;
+static void _foreach_cb(gpointer key, gpointer value, gpointer user_data)
+{
+ DBG("[hash check]--------- key[%s] value[%p]", key, value);
+}
+static void _print_hash(GHashTable *table)
+{
+ if (table)
+ g_hash_table_foreach(table, _foreach_cb, NULL);
+}
+
static int _cal_client_handle_get_key(unsigned int id, char *key, int key_len)
{
RETV_IF(NULL == key, CALENDAR_ERROR_INVALID_PARAMETER);
cal_mutex_unlock(CAL_MUTEX_HANDLE);
if (NULL == handle && tid != pid) {
- DBG("g_hash_table_lookup() Fail:No handle:key[%s]", key);
ret = _cal_client_handle_get_key(pid, key, sizeof(key));
- RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "_cal_client_handle_get_key() Fail(%d)", ret);
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("_cal_client_handle_get_key() Fail(%d):No handle(key[%s])", ret, key);
+ _print_hash(_cal_handle_table);
+ return ret;
+ }
cal_mutex_lock(CAL_MUTEX_HANDLE);
handle = g_hash_table_lookup(_cal_handle_table, key);
cal_mutex_unlock(CAL_MUTEX_HANDLE);
- RETVM_IF(NULL == handle, CALENDAR_ERROR_NO_DATA, "g_hash_table_lookup() Fail");
+ if (NULL == handle) {
+ ERR("g_hash_table_lookup() Fail:No handle(key[%s])", key);
+ _print_hash(_cal_handle_table);
+ return CALENDAR_ERROR_NO_DATA;
+ }
}
*out_handle = handle;
return CALENDAR_ERROR_NONE;
cal_mutex_unlock(CAL_MUTEX_HANDLE);
if (NULL == handle) {
ERR("g_hash_table_lookup() Fail:No handle:key[%s]", key);
+ _print_hash(_cal_handle_table);
return CALENDAR_ERROR_NO_DATA;
}
*out_handle = handle;
cal_mutex_lock(CAL_MUTEX_HANDLE);
g_hash_table_remove(_cal_handle_table, key);
+ DBG("[HASH:handle] remove [%s]", key);
if (0 == g_hash_table_size(_cal_handle_table)) {
g_hash_table_destroy(_cal_handle_table);
_cal_handle_table = NULL;
return CALENDAR_ERROR_NONE;
}
+void cal_client_handle_set_version(calendar_h handle, int version)
+{
+ RET_IF(NULL == handle);
+ cal_s *h = (cal_s *)handle;
+ h->version = version;
+}
int cal_client_handle_get_p_with_id(unsigned int id, calendar_h *handle);
int cal_client_handle_create(unsigned int id, calendar_h *out_handle);
int cal_client_handle_remove(unsigned int id, calendar_h handle);
+void cal_client_handle_set_version(calendar_h handle, int version);
#endif /* __CAL_CLIENT_HANDLE_H__ */
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include <pims-ipc.h>
-#include <glib-object.h>
-#include <errno.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include "calendar_db.h"
-#include "calendar_types.h"
-#include "cal_client_service.h"
-#include "cal_client_service_helper.h"
-#include "cal_client_utils.h"
-#include "cal_client_ipc.h"
-#include "cal_internal.h"
-#include "cal_typedef.h"
-#include "cal_inotify.h"
-#include "cal_view.h"
-#include "cal_ipc.h"
-#include "cal_mutex.h"
-#include "cal_ipc_marshal.h"
-#include "cal_handle.h"
-#include "cal_utils.h"
-#include "cal_client_reminder.h"
-
-typedef struct {
- pims_ipc_h ipc;
- GList *list_handle;
-} cal_ipc_s;
-
-static GHashTable *_cal_ipc_table = NULL;
-static pthread_mutex_t cal_mutex_disconnected = PTHREAD_MUTEX_INITIALIZER;
-static bool _cal_ipc_disconnected = false;
-
-static pims_ipc_h _cal_client_ipc_get_handle(void)
-{
- cal_ipc_s *ipc_data = NULL;
- char key[CAL_STR_MIDDLE_LEN] = {0};
- RETVM_IF(NULL == _cal_ipc_table, NULL, "Not connected");
-
- snprintf(key, sizeof(key), "%u", cal_client_get_tid());
- ipc_data = g_hash_table_lookup(_cal_ipc_table, key);
- if (NULL == ipc_data) {
- snprintf(key, sizeof(key), "%u", cal_client_get_pid());
- ipc_data = g_hash_table_lookup(_cal_ipc_table, key);
- if (NULL == ipc_data) {
- ERR("No ipc_data:key[%s]", key);
- return NULL;
- }
- }
- return ipc_data->ipc;
-}
-
-static int _cal_client_ipc_create(pims_ipc_h *out_ipc)
-{
- RETV_IF(NULL == out_ipc, CALENDAR_ERROR_INVALID_PARAMETER);
-
- char sock_file[CAL_STR_MIDDLE_LEN] = {0};
- snprintf(sock_file, sizeof(sock_file), CAL_SOCK_PATH"/.%s", getuid(), CAL_IPC_SERVICE);
- DBG("[%s]", sock_file);
-
- pims_ipc_h ipc = pims_ipc_create(sock_file);
- if (NULL == ipc) {
- if (errno == EACCES) {
- ERR("[GLOBAL_IPC_CHANNEL] pims_ipc_create() Fail: Permission denied");
- return CALENDAR_ERROR_PERMISSION_DENIED;
- }
- else {
- ERR("[GLOBAL_IPC_CHANNEL] pims_ipc_create() Fail(%d)", CALENDAR_ERROR_IPC);
- return CALENDAR_ERROR_IPC;
- }
- }
- *out_ipc = ipc;
- return CALENDAR_ERROR_NONE;
-}
-
-static void _cal_client_ipc_free(gpointer p)
-{
- cal_ipc_s *ipc_data = p;
- RET_IF(NULL == ipc_data);
-
- if (ipc_data->ipc) {
- cal_client_ipc_unset_disconnected_cb(ipc_data->ipc);
- pims_ipc_destroy(ipc_data->ipc);
- }
- g_list_free(ipc_data->list_handle);
- free(ipc_data);
-}
-
-static int _cal_client_ipc_connect(calendar_h handle, pims_ipc_h ipc)
-{
- int ret = CALENDAR_ERROR_NONE;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
-
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
-
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_IPC;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- if (pims_ipc_call(ipc, CAL_IPC_MODULE, CAL_IPC_SERVER_CONNECT, indata, &outdata) != 0) {
- ERR("pims_ipc_call() Fail");
- pims_ipc_data_destroy(indata);
- return CALENDAR_ERROR_IPC;
- }
- pims_ipc_data_destroy(indata);
-
- int ipc_ret = 0;
- ret = cal_ipc_unmarshal_int(outdata, &ipc_ret);
- pims_ipc_data_destroy(outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
- return ipc_ret;
-}
-
-static void _cal_client_ipc_disconnected_cb(void *user_data)
-{
- DBG("disconnected");
- cal_client_ipc_set_disconnected(true);
-}
-
-int cal_client_ipc_connect(calendar_h handle, unsigned int id)
-{
- int ret = 0;
- cal_ipc_s *ipc_data = NULL;
- char key[CAL_STR_MIDDLE_LEN] = {0};
-
- //RETV_IF(_cal_ipc_disconnected, CALENDAR_ERROR_IPC);
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
-
- snprintf(key, sizeof(key), "%u", id);
-
- if (NULL == _cal_ipc_table)
- _cal_ipc_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, _cal_client_ipc_free);
- else
- ipc_data = g_hash_table_lookup(_cal_ipc_table, key);
-
- if (NULL == ipc_data) {
- ipc_data = calloc(1, sizeof(cal_ipc_s));
- if (NULL == ipc_data) {
- ERR("calloc() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- ret = _cal_client_ipc_create(&(ipc_data->ipc));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_client_ipc_create() Fail(%d)", ret);
- _cal_client_ipc_free(ipc_data);
- return ret;
- }
- g_hash_table_insert(_cal_ipc_table, cal_strdup(key), ipc_data);
- DBG("[HASH:ipc] insert key[%s] value[%p]", key, ipc_data);
- cal_client_ipc_set_disconnected_cb(ipc_data->ipc, _cal_client_ipc_disconnected_cb, NULL);
- }
- ret = _cal_client_ipc_connect(handle, ipc_data->ipc);
- WARN_IF(CALENDAR_ERROR_NONE != ret, "_cal_client_ipc_connect() Fail(%d)", ret);
-
- ipc_data->list_handle = g_list_append(ipc_data->list_handle, handle);
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_client_ipc_disconnect(calendar_h handle, unsigned int id, int connection_count)
-{
- int ret = CALENDAR_ERROR_NONE;
- cal_ipc_s *ipc_data = NULL;
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
- char key[CAL_STR_MIDDLE_LEN] = {0};
-
- //RETV_IF(_cal_ipc_disconnected, CALENDAR_ERROR_IPC);
- RETVM_IF(NULL == _cal_ipc_table, CALENDAR_ERROR_IPC, "Not connected");
- snprintf(key, sizeof(key), "%u", id);
-
- ipc_data = g_hash_table_lookup(_cal_ipc_table, key);
- RETVM_IF(NULL == ipc_data, CALENDAR_ERROR_IPC, "Not connected");
-
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_IPC;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- /* ipc call */
- if (pims_ipc_call(ipc_data->ipc, CAL_IPC_MODULE, CAL_IPC_SERVER_DISCONNECT, indata, &outdata) != 0) {
- ERR("[GLOBAL_IPC_CHANNEL] pims_ipc_call() Fail");
- pims_ipc_data_destroy(indata);
- return CALENDAR_ERROR_IPC;
- }
- pims_ipc_data_destroy(indata);
-
- if (NULL == outdata) {
- ERR("ipc outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- int ipc_ret = 0;
- ret = cal_ipc_unmarshal_int(outdata, &ipc_ret);
- pims_ipc_data_destroy(outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_IPC;
- }
-
- if (1 == connection_count)
- g_hash_table_remove(_cal_ipc_table, key);
-
- return ret;
-}
-
-bool cal_client_ipc_is_call_inprogress(void)
-{
- pims_ipc_h ipc = _cal_client_ipc_get_handle();
- if (NULL == ipc) {
- ERR("No ipc");
- return false;
- }
- return pims_ipc_is_call_in_progress(ipc);
-}
-
-void cal_client_ipc_lock(void)
-{
- if (0 == cal_client_get_thread_connection_count())
- cal_mutex_lock(CAL_MUTEX_PIMS_IPC_CALL);
-}
-
-void cal_client_ipc_unlock(void)
-{
- if (0 == cal_client_get_thread_connection_count())
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_CALL);
-}
-
-void cal_client_ipc_set_disconnected(bool is_disconnected)
-{
- pthread_mutex_lock(&cal_mutex_disconnected);
- _cal_ipc_disconnected = is_disconnected;
- pthread_mutex_unlock(&cal_mutex_disconnected);
-}
-
-bool cal_client_ipc_get_disconnected(void)
-{
- pthread_mutex_lock(&cal_mutex_disconnected);
- DBG("RECOVERY(cal_ipc_disconnected(%d))", _cal_ipc_disconnected);
- pthread_mutex_unlock(&cal_mutex_disconnected);
- return _cal_ipc_disconnected;
-}
-
-int cal_client_ipc_call(char *module, char *function, pims_ipc_h data_in, pims_ipc_data_h *data_out)
-{
- int ret = 0;
-
- if (true == cal_client_ipc_get_disconnected()) {
- cal_client_ipc_set_disconnected(false);
- cal_client_ipc_recovery();
- cal_client_recovery_for_change_subscription();
- }
-
- pims_ipc_h ipc = _cal_client_ipc_get_handle();
- RETVM_IF(NULL == ipc, CALENDAR_ERROR_IPC, "_cal_client_ipc_get_handle() Fail");
-
- cal_client_ipc_lock();
- ret = pims_ipc_call(ipc , module, function, data_in, data_out);
- cal_client_ipc_unlock();
- return ret;
-}
-
-void cal_client_ipc_set_change_version(calendar_h handle, int version)
-{
- RETM_IF(NULL == handle, "handle is NULL");
- cal_s *h = (cal_s *)handle;
- h->version = version;
-}
-
-int cal_client_ipc_get_change_version(calendar_h handle)
-{
- RETVM_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER, "handle is NULL");
- cal_s *h = (cal_s *)handle;
- return h->version;
-}
-
-int cal_client_ipc_client_check_permission(calendar_h handle, int permission, bool *result)
-{
- pims_ipc_data_h indata = NULL;
- pims_ipc_data_h outdata = NULL;
- int ret;
-
- if (result)
- *result = false;
-
- indata = pims_ipc_data_create(0);
- if (NULL == indata) {
- ERR("pims_ipc_data_create() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_marshal_handle(handle, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_handle() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- ret = cal_ipc_marshal_int(permission, indata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(indata);
- return ret;
- }
-
- if (cal_client_ipc_call(CAL_IPC_MODULE, CAL_IPC_SERVER_CHECK_PERMISSION, indata, &outdata) != 0) {
- ERR("cal_client_ipc_call() Fail");
- pims_ipc_data_destroy(indata);
- return CALENDAR_ERROR_IPC;
- }
-
- pims_ipc_data_destroy(indata);
-
- if (NULL == outdata) {
- ERR("ipc outdata is NULL");
- return CALENDAR_ERROR_IPC;
- }
-
- int ipc_ret = 0;
- ret = cal_ipc_unmarshal_int(outdata, &ipc_ret);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
-
- ret = cal_ipc_unmarshal_int(outdata, result);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(outdata);
- return CALENDAR_ERROR_IPC;
- }
- pims_ipc_data_destroy(outdata);
-
- return ipc_ret;
-}
-
-int cal_client_ipc_set_disconnected_cb(pims_ipc_h ipc, void (*cb)(void *), void *user_data)
-{
- return pims_ipc_add_server_disconnected_cb(ipc, cb, user_data);
-}
-
-int cal_client_ipc_unset_disconnected_cb(pims_ipc_h ipc)
-{
- return pims_ipc_remove_server_disconnected_cb(ipc);
-}
-
-static void _cal_client_ipc_recovery_foreach_cb(gpointer key, gpointer value, gpointer user_data)
-{
- int ret = 0;
- GList *l = NULL;
-
- RET_IF(NULL == value);
-
- cal_ipc_s *ipc_data = value;
-
- cal_client_ipc_unset_disconnected_cb(ipc_data->ipc);
- ret = _cal_client_ipc_create(&(ipc_data->ipc));
- RETM_IF(CALENDAR_ERROR_NONE != ret, "_cal_client_ipc_create() Fail(%d)", ret);
- cal_client_ipc_set_disconnected_cb(ipc_data->ipc, _cal_client_ipc_disconnected_cb, NULL);
-
- for (l = ipc_data->list_handle; l; l = l->next) {
- calendar_h handle = l->data;
- ret = _cal_client_ipc_connect(handle, ipc_data->ipc);
- WARN_IF(CALENDAR_ERROR_NONE != ret, "_cal_client_ipc_connect() Fail(%d)", ret);
- }
-}
-
-void cal_client_ipc_recovery(void)
-{
- g_hash_table_foreach(_cal_ipc_table, _cal_client_ipc_recovery_foreach_cb, NULL);
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __CAL_CLIENT_IPC_H__
-#define __CAL_CLIENT_IPC_H__
-
-#include <pims-ipc.h>
-#include "calendar_types.h"
-#include "cal_handle.h"
-
-int cal_client_ipc_connect(calendar_h handle, unsigned int id);
-int cal_client_ipc_disconnect(calendar_h handle, unsigned int id, int connection_count);
-
-bool cal_client_ipc_is_call_inprogress(void);
-int cal_client_ipc_call(char *module, char *function, pims_ipc_h data_in, pims_ipc_data_h *data_out);
-int cal_client_ipc_client_check_permission(calendar_h handle, int permission, bool *result);
-int cal_client_ipc_get_change_version(calendar_h handle);
-void cal_client_ipc_set_change_version(calendar_h handle, int version);
-void cal_client_ipc_lock(void);
-void cal_client_ipc_unlock(void);
-
-bool cal_client_ipc_get_disconnected(void);
-int cal_client_ipc_set_disconnected_cb(pims_ipc_h ipc, void (*cb)(void *), void *user_data);
-int cal_client_ipc_unset_disconnected_cb(pims_ipc_h ipc);
-void cal_client_ipc_set_disconnected(bool is_disconnected);
-void cal_client_ipc_recovery(void);
-
-#endif /* __CAL_CLIENT_IPC_H__ */
*
*/
+#include <pthread.h>
#include <stdlib.h>
-#include <pims-ipc.h>
-#include <unistd.h>
-#include <sys/types.h>
#include "calendar.h"
#include "cal_internal.h"
#include "cal_view.h"
#include "cal_record.h"
#include "cal_list.h"
-#include "cal_mutex.h"
-#include "cal_ipc.h"
-#include "cal_ipc_marshal.h"
-#include "cal_client_ipc.h"
#include "cal_client_handle.h"
+#include "cal_client_dbus.h"
typedef struct {
+ unsigned int id;
calendar_reminder_cb cb;
void *user_data;
} callback_info_s;
-static int _ipc_pubsub_count = 0;
-static pims_ipc_h __ipc = NULL;
+static pthread_mutex_t cal_mutex_reminder = PTHREAD_MUTEX_INITIALIZER;
static GSList *__subscribe_list = NULL;
-int cal_client_reminder_create_for_subscribe(void)
-{
- cal_mutex_lock(CAL_MUTEX_PIMS_IPC_PUBSUB);
-
- if (0 < _ipc_pubsub_count) {
- _ipc_pubsub_count++;
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_NONE;
- }
-
- if (NULL == __ipc) {
- char sock_file[CAL_STR_MIDDLE_LEN] = {0};
- snprintf(sock_file, sizeof(sock_file), CAL_SOCK_PATH"/.%s_for_subscribe", getuid(), CAL_IPC_SERVICE);
- __ipc = pims_ipc_create_for_subscribe(sock_file);
- if (NULL == __ipc) {
- ERR("pims_ipc_create_for_subscribe() Fail");
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_IPC;
- }
- }
- _ipc_pubsub_count++;
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_client_reminder_destroy_for_subscribe(void)
-{
- cal_mutex_lock(CAL_MUTEX_PIMS_IPC_PUBSUB);
-
- if (1 == _ipc_pubsub_count) {
- pims_ipc_destroy_for_subscribe(__ipc);
- __ipc = NULL;
- }
- else if (1 < _ipc_pubsub_count) {
- DBG("Already subscribed:count(%d)", _ipc_pubsub_count);
- }
- else {
- DBG("[System] Not subscribed");
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- _ipc_pubsub_count--;
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_client_recovery_for_change_subscription(void)
-{
- cal_mutex_lock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- if (_ipc_pubsub_count <= 0) {
- return CALENDAR_ERROR_NONE;
- }
-
- char sock_file[CAL_STR_MIDDLE_LEN] = {0};
- snprintf(sock_file, sizeof(sock_file), CAL_SOCK_PATH"/.%s_for_subscribe", getuid(), CAL_IPC_SERVICE);
- __ipc = pims_ipc_create_for_subscribe(sock_file);
- if (NULL == __ipc) {
- ERR("pims_ipc_create_for_subscribe() Fail");
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_IPC;
- }
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_NONE;
-}
-
-static void _cal_client_reminder_subscribe_callback(pims_ipc_h ipc, pims_ipc_data_h data, void *user_data)
-{
- unsigned int size = 0;
- const char *str = NULL;
- int len = 0;
-
- if (data) {
- len = (int)pims_ipc_data_get(data, &size);
- if (0 == len) {
- ERR("pims_ipc_data_get() Fail");
- return;
- }
- str = (const char *)pims_ipc_data_get(data, &size);
- if (!str) {
- ERR("pims_ipc_data_get() Fail");
- return;
- }
- }
-
- if (__subscribe_list) {
- GSList *l = NULL;
- for (l = __subscribe_list; l; l = l->next) {
- callback_info_s *cb_info = l->data;
- if (NULL == cb_info) continue;
-
- cb_info->cb(str, cb_info->user_data);
- }
- }
-}
-
API int calendar_reminder_add_cb(calendar_reminder_cb callback, void *user_data)
{
- int ret = 0;;
- GSList *it = NULL;
- callback_info_s *cb_info = NULL;
- bool result = false;
- calendar_h handle = NULL;
- ret = cal_client_handle_get_p(&handle);
- RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_get_p() Fail(%d)", ret);
+ int ret = 0;
RETV_IF(NULL == callback, CALENDAR_ERROR_INVALID_PARAMETER);
- ret = cal_client_ipc_client_check_permission(handle, CAL_PERMISSION_READ, &result);
- RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "ctsvc_ipc_client_check_permission() Fail(%d)", ret);
- RETVM_IF(result == false, CALENDAR_ERROR_PERMISSION_DENIED, "Permission denied (calendar read)");
+ pthread_mutex_lock(&cal_mutex_reminder);
- cal_mutex_lock(CAL_MUTEX_PIMS_IPC_PUBSUB);
-
- if (!__subscribe_list) {
- if (pims_ipc_subscribe(__ipc, CAL_IPC_MODULE_FOR_SUBSCRIPTION, (char *)CAL_NOTI_REMINDER_CAHNGED,
- _cal_client_reminder_subscribe_callback, NULL) != 0) {
- ERR("pims_ipc_subscribe() Fail");
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_IPC;
+ /* check duplicate */
+ GSList *cursor = __subscribe_list;
+ while (cursor) {
+ callback_info_s *ci = (callback_info_s *)cursor->data;
+ if (NULL == ci) {
+ cursor = g_slist_next(cursor);
+ continue;
}
- }
- /* Check duplication */
- for (it = __subscribe_list; it; it = it->next) {
- if (NULL == it->data) continue;
-
- callback_info_s *cb_info = it->data;
- if (callback == cb_info->cb && user_data == cb_info->user_data) {
- ERR("The same callback(%s) is already exist");
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
+ if (callback == ci->cb && user_data == ci->user_data) {
+ DBG("This callback is already appended");
+ pthread_mutex_unlock(&cal_mutex_reminder);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
+ cursor = g_slist_next(cursor);
}
- cb_info = calloc(1, sizeof(callback_info_s));
- if (NULL == cb_info) {
+ callback_info_s *ci = NULL;
+ ci = calloc(1, sizeof(callback_info_s));
+ if (NULL == ci) {
ERR("calloc() Fail");
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
- return CALENDAR_ERROR_OUT_OF_MEMORY;
+ pthread_mutex_unlock(&cal_mutex_reminder);
+ return CALENDAR_ERROR_IPC;
}
- cb_info->user_data = user_data;
- cb_info->cb = callback;
- __subscribe_list = g_slist_append(__subscribe_list, cb_info);
+ DBG("add reminer");
+ ci->id = cal_dbus_subscribe_signal(CAL_NOTI_REMINDER_CAHNGED,
+ cal_dbus_call_reminder_cb, user_data, NULL);
+ ci->cb = callback;
+ ci->user_data = user_data;
+ __subscribe_list = g_slist_append(__subscribe_list, ci);
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
+ pthread_mutex_unlock(&cal_mutex_reminder);
return CALENDAR_ERROR_NONE;
}
API int calendar_reminder_remove_cb(calendar_reminder_cb callback, void *user_data)
{
- GSList *it = NULL;
-
RETV_IF(NULL == callback, CALENDAR_ERROR_INVALID_PARAMETER);
- cal_mutex_lock(CAL_MUTEX_PIMS_IPC_PUBSUB);
+ pthread_mutex_lock(&cal_mutex_reminder);
- for (it = __subscribe_list; it; it = it->next) {
- if (NULL == it->data) continue;
+ int is_matched = 0;
+ GSList *cursor = __subscribe_list;
+ while (cursor) {
+ callback_info_s *ci = (callback_info_s *)cursor->data;
+ if (NULL == ci) {
+ cursor = g_slist_next(cursor);
+ continue;
+ }
- callback_info_s *cb_info = it->data;
- if (callback == cb_info->cb && user_data == cb_info->user_data) {
- __subscribe_list = g_slist_remove(__subscribe_list, cb_info);
- free(cb_info);
+ if (callback == ci->cb && user_data == ci->user_data) {
+ is_matched = 1;
break;
}
+ cursor = g_slist_next(cursor);
+ }
+
+ if (0 == is_matched) {
+ ERR("Not matched callback");
+ pthread_mutex_unlock(&cal_mutex_reminder);
+ return CALENDAR_ERROR_INVALID_PARAMETER;
}
- if (g_slist_length(__subscribe_list) == 0) {
- pims_ipc_unsubscribe(__ipc, CAL_IPC_MODULE_FOR_SUBSCRIPTION, (char *)CAL_NOTI_REMINDER_CAHNGED);
+ DBG("remove reminder");
+ callback_info_s *ci = (callback_info_s *)cursor->data;
+ cal_dbus_unsubscribe_signal(ci->id);
+ __subscribe_list = g_slist_remove(__subscribe_list, ci);
+ free(ci);
+
+ if (0 == g_slist_length(__subscribe_list)) {
g_slist_free(__subscribe_list);
__subscribe_list = NULL;
}
- cal_mutex_unlock(CAL_MUTEX_PIMS_IPC_PUBSUB);
+ pthread_mutex_unlock(&cal_mutex_reminder);
return CALENDAR_ERROR_NONE;
}
+int cal_client_reminder_call_subscribe(const char *stream)
+{
+ CAL_FN_CALL();
+
+ GSList *cursor = NULL;
+ pthread_mutex_lock(&cal_mutex_reminder);
+
+ cursor = __subscribe_list;
+ while (cursor) {
+ callback_info_s *ci = (callback_info_s *)cursor->data;
+ if (NULL == ci) {
+ ERR("data is NULL");
+ cursor = g_slist_next(cursor);
+ continue;
+ }
+ DBG("-----------------------------------------------------called");
+ ci->cb(stream, ci->user_data);
+ cursor = g_slist_next(cursor);
+ }
+
+ pthread_mutex_unlock(&cal_mutex_reminder);
+ return CALENDAR_ERROR_NONE;
+}
#ifndef __CAL_CLIENT_REMINDER_H__
#define __CAL_CLIENT_REMINDER_H__
-int cal_client_reminder_create_for_subscribe(void);
-int cal_client_reminder_destroy_for_subscribe(void);
-int cal_client_recovery_for_change_subscription(void);
+int cal_client_reminder_call_subscribe(const char *stream);
#endif /* __CAL_CLIENT_REMINDER_H__ */
#include "cal_client_service_helper.h"
#include "cal_client_utils.h"
-static int cal_connection = 0; /* total connection count: each count from zone */
-static TLS int cal_connection_on_thread = 0;
+static int connection_count = 0;
+static TLS int connection_count_on_thread = 0;
API int calendar_connect(void)
{
+ CAL_FN_CALL();
int ret;
calendar_h handle = NULL;
unsigned int id = cal_client_get_pid();
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
- ret = cal_client_connect(handle, id, &cal_connection);
+ ret = cal_client_connect(handle, id, &connection_count);
return ret;
}
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
- ret = cal_client_disconnect(handle, id, &cal_connection);
+ ret = cal_client_disconnect(handle, id, &connection_count);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_client_disconnect() Fail(%d)", ret);
return ret;
}
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
- ret = cal_client_connect(handle, id, &cal_connection_on_thread);
+ ret = cal_client_connect(handle, id, &connection_count_on_thread);
return ret;
}
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
- ret = cal_client_disconnect(handle, id, &cal_connection_on_thread);
+ ret = cal_client_disconnect(handle, id, &connection_count_on_thread);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_client_disconnect() Fail(%d)", ret);
return ret;
}
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
- ret = cal_client_connect_with_flags(handle, id, &cal_connection, flags);
+ ret = cal_client_connect_with_flags(handle, id, &connection_count, flags);
return ret;
}
-
-
-int cal_client_get_thread_connection_count(void)
-{
- return cal_connection_on_thread;
-}
int calendar_connect_on_thread(void);
int calendar_disconnect_on_thread(void);
int calendar_connect_with_flags(unsigned int flags);
-int cal_client_get_thread_connection_count(void);
#endif /* __CAL_CLIENT_SERVICE_H__ */
*
*/
- #include <unistd.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <glib-object.h>
-#include "calendar_types.h"
+#include "calendar.h"
#include "cal_internal.h"
#include "cal_typedef.h"
#include "cal_inotify.h"
#include "cal_mutex.h"
#include "cal_client_reminder.h"
#include "cal_client_handle.h"
-#include "cal_client_ipc.h"
+#include "cal_client_dbus.h"
#include "cal_client_utils.h"
#include "cal_client_reminder.h"
-static void _cal_client_ipc_initialized_cb(void *user_data)
-{
- if (true == cal_client_ipc_get_disconnected()) {
- cal_client_ipc_recovery();
- cal_client_recovery_for_change_subscription();
- cal_client_ipc_set_disconnected(false);
- }
-}
+static int reference_count = 0; /* total connection include on_thread */
int cal_client_connect(calendar_h handle, unsigned int id, int *connection_count)
{
cal_mutex_lock(CAL_MUTEX_CONNECTION);
cal_s *h = (cal_s *)handle;
+
if (0 == h->connection_count) {
- ret = cal_client_ipc_connect(handle,id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_connect() Fail(%d)", ret);
- cal_mutex_unlock(CAL_MUTEX_CONNECTION);
- return ret;
- }
+
}
+
h->connection_count++;
DBG("[Connection count:handle] (%d)", h->connection_count);
}
cal_view_initialize();
- cal_client_reminder_create_for_subscribe();
}
else if (0 < *connection_count) {
DBG("[System] calendar service is already connected");
}
- if (1 == h->connection_count)
- cal_inotify_subscribe_ipc_ready(handle, _cal_client_ipc_initialized_cb, NULL);
+ if (1 == h->connection_count) {
+
+ }
(*connection_count)++;
+
+ if (0 == reference_count)
+ cal_dbus_start();
+ reference_count++;
+
+ DBG("[Connection count]:total(%d) reference(%d)", *connection_count, reference_count);
+
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_NONE;
}
cal_s *h = (cal_s *)handle;
if (1 == h->connection_count) {
- ret = cal_client_ipc_disconnect(handle, id, *connection_count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_client_ipc_disconnect() Fail(%d)", ret);
- cal_mutex_unlock(CAL_MUTEX_CONNECTION);
- return ret;
- }
- cal_inotify_unsubscribe_ipc_ready(handle);
+
}
+
h->connection_count--;
DBG("[Disonnection count:handle] (%d)", h->connection_count);
if (1 == *connection_count) {
DBG("[System] disconnected successfully");
- cal_client_reminder_destroy_for_subscribe();
cal_view_finalize();
cal_inotify_deinit();
}
}
(*connection_count)--;
+
+ if (1 == reference_count)
+ cal_dbus_stop();
+ reference_count--;
+
+ DBG("[Connection count]:total(%d) reference(%d)", *connection_count, reference_count);
+
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_NONE;
}
-int cal_client_connect_with_flags(calendar_h handle, unsigned int id, int *connection_count, unsigned int flags)
+int cal_client_connect_with_flags(calendar_h handle, unsigned int id,
+ int *connection_count, unsigned int flags)
{
CAL_FN_CALL();
int ret = 0;
int cal_client_connect(calendar_h handle, unsigned int id, int *connection_count);
int cal_client_disconnect(calendar_h handle, unsigned int id, int *connection_count);
-int cal_client_connect_with_flags(calendar_h handle, unsigned int id, int *connection_count, unsigned int flags);
+int cal_client_connect_with_flags(calendar_h handle, unsigned int id,
+ int *connection_count, unsigned int flags);
#endif /* __CAL_CLIENT_SERVICE_HELPER_H__ */
--- /dev/null
+ADD_SUBDIRECTORY(dbus)
return CALENDAR_ERROR_NONE;
}
-static int _cal_filter_create_attribute(cal_composite_filter_s *com_filter, unsigned int property_id, int match, int filter_type, cal_attribute_filter_s **out_filter)
+static int _cal_filter_create_attribute(cal_composite_filter_s *com_filter,
+ unsigned int property_id, int match, int filter_type, cal_attribute_filter_s **out_filter)
{
cal_attribute_filter_s *filter;
return CALENDAR_ERROR_NONE;
}
-API int calendar_filter_add_str(calendar_filter_h filter, unsigned int property_id, calendar_match_str_flag_e match, const char* match_value)
+API int calendar_filter_add_str(calendar_filter_h filter, unsigned int property_id,
+ calendar_match_str_flag_e match, const char* match_value)
{
cal_composite_filter_s *com_filter;
cal_attribute_filter_s *str_filter;
return CALENDAR_ERROR_NONE;
}
-API int calendar_filter_add_int(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, int match_value)
+API int calendar_filter_add_int(calendar_filter_h filter, unsigned int property_id,
+ calendar_match_int_flag_e match, int match_value)
{
cal_composite_filter_s *com_filter;
cal_attribute_filter_s *int_filter;
return CALENDAR_ERROR_NONE;
}
-API int calendar_filter_add_double(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, double match_value)
+API int calendar_filter_add_double(calendar_filter_h filter, unsigned int property_id,
+ calendar_match_int_flag_e match, double match_value)
{
cal_composite_filter_s *com_filter;
cal_attribute_filter_s *int_filter;
return CALENDAR_ERROR_NONE;
}
-API int calendar_filter_add_lli(calendar_filter_h filter, unsigned int property_id, calendar_match_int_flag_e match, long long int match_value)
+API int calendar_filter_add_lli(calendar_filter_h filter, unsigned int property_id,
+ calendar_match_int_flag_e match, long long int match_value)
{
cal_composite_filter_s *com_filter;
cal_attribute_filter_s *int_filter;
free(h);
return CALENDAR_ERROR_NONE;
}
+
+int cal_handle_get_version(calendar_h handle, int *out_version)
+{
+ RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_version, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ cal_s *h = (cal_s *)handle;
+ *out_version = h->version;
+ return CALENDAR_ERROR_NONE;
+}
int cal_handle_create(calendar_h *handle);
int cal_handle_destroy(calendar_h handle);
+int cal_handle_get_version(calendar_h handle, int *out_version);
#endif /* __CAL_HANDLE_H__ */
#include "cal_utils.h"
#ifdef CAL_IPC_CLIENT
-#include "cal_client_ipc.h"
#include "cal_mutex.h"
#endif
typedef struct {
int wd;
- calendar_db_changed_cb callback;
+ calendar_db_changed_cb cb;
void *cb_data;
cal_noti_type_e noti_type;
bool blocked;
-} noti_info;
+} noti_info_s;
-typedef struct {
- int wd;
- int subscribe_count;
- void (*cb)(void *);
- void *cb_data;
-} socket_init_noti_info_s;
-
-static GHashTable *_cal_socket_init_noti_table = NULL;
-
-static int inoti_fd = -1;
+static int _inoti_fd = -1;
static guint inoti_handler;
-static GSList *noti_list;
+static GSList *_noti_list;
#ifdef CAL_IPC_CLIENT
-
static int calendar_inoti_count = 0;
-
-void cal_inotify_call_pending_callback(void)
-{
- noti_info *noti;
- GSList *cursor = NULL;
-
- cursor = noti_list;
- while (cursor) {
- noti = (noti_info *)cursor->data;
- if (noti->callback && noti->blocked) {
- noti->blocked = false;
- switch (noti->noti_type) {
- case CAL_NOTI_TYPE_CALENDAR:
- noti->callback(CALENDAR_VIEW_CALENDAR, noti->cb_data);
- break;
- case CAL_NOTI_TYPE_EVENT:
- noti->callback(CALENDAR_VIEW_EVENT, noti->cb_data);
- break;
- case CAL_NOTI_TYPE_TODO:
- noti->callback(CALENDAR_VIEW_TODO, noti->cb_data);
- break;
- default:
- break;
- }
- }
- cursor = cursor->next;
- }
-}
#endif
-static inline void _handle_callback(GSList *noti_list, int wd, uint32_t mask)
+static inline void _handle_callback(GSList *_noti_list, int wd, uint32_t mask)
{
- noti_info *noti;
GSList *cursor;
- cursor = noti_list;
- while (cursor)
- {
- noti = (noti_info *)cursor->data;
+ cursor = _noti_list;
+ while (cursor) {
+ noti_info_s *noti = NULL;
+ noti = (noti_info_s *)cursor->data;
if (noti->wd == wd) {
-#ifdef CAL_IPC_CLIENT
- if (cal_client_ipc_is_call_inprogress()) {
- noti->blocked = true;
- continue;
- }
-#endif
-
- if ((mask & IN_CLOSE_WRITE) && noti->callback) {
+ if ((mask & IN_CLOSE_WRITE) && noti->cb) {
switch(noti->noti_type) {
case CAL_NOTI_TYPE_CALENDAR:
- noti->callback(CALENDAR_VIEW_CALENDAR, noti->cb_data);
+ noti->cb(CALENDAR_VIEW_CALENDAR, noti->cb_data);
break;
case CAL_NOTI_TYPE_EVENT:
- noti->callback(CALENDAR_VIEW_EVENT, noti->cb_data);
+ noti->cb(CALENDAR_VIEW_EVENT, noti->cb_data);
break;
case CAL_NOTI_TYPE_TODO:
- noti->callback(CALENDAR_VIEW_TODO, noti->cb_data);
+ noti->cb(CALENDAR_VIEW_TODO, noti->cb_data);
break;
default:
break;
while (0 < (ret = read(fd, &ie, sizeof(ie)))) {
if (sizeof(ie) == ret) {
- if (noti_list)
- _handle_callback(noti_list, ie.wd, ie.mask);
+ if (_noti_list)
+ _handle_callback(_noti_list, ie.wd, ie.mask);
while (0 != ie.len) {
ret = read(fd, name, (ie.len<sizeof(name))?ie.len:sizeof(name));
}
}
}
-
return TRUE;
}
DBG("inotify count =%d",calendar_inoti_count);
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
#endif
- inoti_fd = inotify_init();
- if (inoti_fd == -1) {
+ _inoti_fd = inotify_init();
+ if (_inoti_fd == -1) {
ERR("inotify_init() Fail(%d)", errno);
#ifdef CAL_IPC_CLIENT
cal_mutex_lock(CAL_MUTEX_INOTIFY);
#endif
return -1; /* CALENDAR_ERROR_FAILED_INOTIFY */
}
- DBG("-----------------------------");
- ret = fcntl(inoti_fd, F_SETFD, FD_CLOEXEC);
+ ret = fcntl(_inoti_fd, F_SETFD, FD_CLOEXEC);
WARN_IF(ret < 0, "fcntl failed(%d)", ret);
- ret = fcntl(inoti_fd, F_SETFL, O_NONBLOCK);
+ ret = fcntl(_inoti_fd, F_SETFL, O_NONBLOCK);
WARN_IF(ret < 0, "fcntl failed(%d)", ret);
- inoti_handler = _inotify_attach_handler(inoti_fd);
+ inoti_handler = _inotify_attach_handler(_inoti_fd);
if (inoti_handler <= 0) {
ERR("_inotify_attach_handler() Fail");
- close(inoti_fd);
- inoti_fd = -1;
+ close(_inoti_fd);
+ _inoti_fd = -1;
inoti_handler = 0;
#ifdef CAL_IPC_CLIENT
cal_mutex_lock(CAL_MUTEX_INOTIFY);
return CALENDAR_ERROR_NONE;
}
-int cal_inotify_subscribe_ipc_ready(calendar_h handle, void (*cb)(void *), void *user_data)
+static bool _has_noti(int wd, void *cb, void *cb_data)
{
- int ret = 0;
- socket_init_noti_info_s *sock_info = NULL;
-
- if (NULL == _cal_socket_init_noti_table)
- _cal_socket_init_noti_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
- else
- sock_info = g_hash_table_lookup(_cal_socket_init_noti_table, CAL_NOTI_IPC_READY);
-
- if (NULL == sock_info) {
- int wd = _cal_inotify_get_wd(inoti_fd, CAL_NOTI_IPC_READY);
- if (-1 == wd) {
- ERR("_cal_inotify_get_wd() Fail(%d):path[%s]", errno, CAL_NOTI_IPC_READY);
- if (EACCES == errno)
- return CALENDAR_ERROR_PERMISSION_DENIED;
- return CALENDAR_ERROR_NONE;
- }
- ret = _cal_inotify_add_watch(inoti_fd, CAL_NOTI_IPC_READY);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_inotify_add_watch() Fail(%d)", ret);
- return ret;
+ bool has_noti = false;
+ GSList *cursor = NULL;
+ cursor = _noti_list;
+ while (cursor) {
+ noti_info_s *info = (noti_info_s *)cursor->data;
+ if (NULL == info) {
+ ERR("No info");
+ cursor = g_slist_next(cursor);
+ continue;
}
- sock_info = calloc(1, sizeof(socket_init_noti_info_s));
- if (NULL == sock_info) {
- ERR("calloc() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
+ if (info->wd == wd && info->cb == cb && info->cb_data == cb_data) {
+ has_noti = true;
}
-
- sock_info->wd = wd;
- sock_info->cb = cb;
- sock_info->cb_data = user_data;
- g_hash_table_insert(_cal_socket_init_noti_table, g_strdup(CAL_NOTI_IPC_READY), sock_info);
+ cursor = g_slist_next(cursor);
}
- sock_info->subscribe_count++;
- return CALENDAR_ERROR_NONE;
+ return has_noti;
}
-int cal_inotify_unsubscribe_ipc_ready(calendar_h handle)
+static int _append_noti(int wd, int type, void *cb, void *cb_data)
{
- RETV_IF(NULL == _cal_socket_init_noti_table, CALENDAR_ERROR_INVALID_PARAMETER);
+ noti_info_s *info = NULL;
+ info = calloc(1, sizeof(noti_info_s));
+ if (NULL == info) {
+ ERR("calloc() Fail");
+ return CALENDAR_ERROR_OUT_OF_MEMORY;
+ }
- socket_init_noti_info_s *sock_info = NULL;
+ info->wd = wd;
+ info->noti_type = type;
+ info->cb_data = cb_data;
+ info->cb = cb;
+ info->blocked = false;
- sock_info = g_hash_table_lookup(_cal_socket_init_noti_table, CAL_NOTI_IPC_READY);
- if (NULL == sock_info) {
- ERR("g_hash_table_lookup() Fail");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
+ _noti_list = g_slist_append(_noti_list, info);
- if (1 == sock_info->subscribe_count) {
- int wd = sock_info->wd;
- inotify_rm_watch(inoti_fd, wd);
- g_hash_table_remove(_cal_socket_init_noti_table, CAL_NOTI_IPC_READY);
- }
- else {
- sock_info->subscribe_count--;
- }
return CALENDAR_ERROR_NONE;
}
-int cal_inotify_subscribe(cal_noti_type_e type, const char *path, calendar_db_changed_cb callback, void *data)
+int cal_inotify_subscribe(cal_noti_type_e type, const char *path, void *cb, void *cb_data)
{
int ret, wd;
- noti_info *noti, *same_noti = NULL;
- GSList *cursor;
RETV_IF(NULL == path, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == callback, CALENDAR_ERROR_INVALID_PARAMETER);
- RETVM_IF(inoti_fd < 0, CALENDAR_ERROR_INVALID_PARAMETER, "inoti_fd(%d) is invalid", inoti_fd);
+ RETV_IF(NULL == cb, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETVM_IF(_inoti_fd < 0, CALENDAR_ERROR_INVALID_PARAMETER, "_inoti_fd(%d) is invalid", _inoti_fd);
- wd = _cal_inotify_get_wd(inoti_fd, path);
+ wd = _cal_inotify_get_wd(_inoti_fd, path);
if (wd == -1) {
- ERR("Failed to get wd(err:%d)", errno);
+ ERR("_cal_inotify_get_wd() Fail(%d)", errno);
if (errno == EACCES)
return CALENDAR_ERROR_PERMISSION_DENIED;
return CALENDAR_ERROR_SYSTEM;
}
- cursor = noti_list;
- while (cursor) {
- if (cursor->data == NULL) {
- DBG("No data exist");
- cursor = cursor->next;
- continue;
- }
-
- same_noti = cursor->data;
- if (same_noti->wd == wd && same_noti->callback == callback && same_noti->cb_data == data) {
- break;
-
- }
- else {
- same_noti = NULL;
- }
-
- cursor = cursor->next;
- }
-
- if (same_noti) {
- _cal_inotify_add_watch(inoti_fd, path);
- ERR("The same callback(%s) is already exist", path);
- return CALENDAR_ERROR_SYSTEM;
+ if (true == _has_noti(wd, cb, cb_data)) {
+ ERR("noti is already registered: path[%s]", path);
+ _cal_inotify_add_watch(_inoti_fd, path);
+ return CALENDAR_ERROR_INVALID_PARAMETER;
}
- ret = _cal_inotify_add_watch(inoti_fd, path);
+ ret = _cal_inotify_add_watch(_inoti_fd, path);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("Failed to add watch");
- return CALENDAR_ERROR_SYSTEM;
- }
-
- noti = calloc(1, sizeof(noti_info));
- if (noti == NULL) {
- ERR("Failed to alloc");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
+ ERR("_cal_inotify_add_watch() Fail(%d)", ret);
+ return ret;
}
-
- noti->wd = wd;
- noti->cb_data = data;
- noti->callback = callback;
- noti->noti_type = type;
- noti->blocked = false;
- noti_list = g_slist_append(noti_list, noti);
+ _append_noti(wd, type, cb, cb_data);
return CALENDAR_ERROR_NONE;
}
-static inline int _cal_inotify_delete_noti_with_data(GSList **noti_list, int wd,
- calendar_db_changed_cb callback, void *user_data)
+static int _cal_del_noti(GSList **_noti_list, int wd, void *cb, void *cb_data)
{
int del_cnt, remain_cnt;
GSList *cursor, *result;
del_cnt = 0;
remain_cnt = 0;
- cursor = result = *noti_list;
- while (cursor)
- {
- noti_info *noti = cursor->data;
- if (noti && wd == noti->wd)
- {
- if (callback == noti->callback && user_data == noti->cb_data) {
- cursor = cursor->next;
+ cursor = result = *_noti_list;
+ while (cursor) {
+ noti_info_s *noti = cursor->data;
+ if (noti && wd == noti->wd) {
+ if (cb == noti->cb && cb_data == noti->cb_data) {
+ cursor = g_slist_next(cursor);
result = g_slist_remove(result , noti);
free(noti);
del_cnt++;
continue;
}
- else
- {
- remain_cnt++;
- }
- }
- cursor = cursor->next;
- }
-
- if (del_cnt == 0)
- {
- ERR("Nothing to delete");
- return CALENDAR_ERROR_NO_DATA;
- }
-
- *noti_list = result;
-
- return remain_cnt;
-}
-
-static inline int _cal_notify_delete_noti(GSList **noti_list, int wd, calendar_db_changed_cb callback)
-{
- int del_cnt, remain_cnt;
- GSList *cursor, *result;
-
- del_cnt = 0;
- remain_cnt = 0;
-
- cursor = result = *noti_list;
- while (cursor)
- {
- noti_info *noti = cursor->data;
- if (noti && wd == noti->wd)
- {
- if (NULL == callback || noti->callback == callback)
- {
- cursor = cursor->next;
- result = g_slist_remove(result, noti);
- free(noti);
- del_cnt++;
- continue;
- }
- else
- {
+ else {
remain_cnt++;
}
}
- cursor = cursor->next;
+ cursor = g_slist_next(cursor);
}
- if (del_cnt == 0)
- {
+ if (del_cnt == 0) {
ERR("Nothing to delete");
return CALENDAR_ERROR_NO_DATA;
}
-
- *noti_list = result;
+ *_noti_list = result;
return remain_cnt;
}
-int cal_inotify_unsubscribe_with_data(const char *path, calendar_db_changed_cb callback, void *user_data)
+int cal_inotify_unsubscribe(const char *path, void *cb, void *cb_data)
{
- int wd;
- int ret;
-
-
- if (path == NULL)
- {
- ERR("Invalid argument: path is NULL");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- if (callback == NULL)
- {
- ERR("Invalid argument: callback is NULL");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
+ int ret, wd;
- if (inoti_fd < 0)
- {
- ERR("Invalid argument: inoti_fd(%d) is invalid", inoti_fd);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
+ RETV_IF(NULL == path, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == cb, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETVM_IF(_inoti_fd < 0, CALENDAR_ERROR_SYSTEM, "System : _inoti_fd(%d) is invalid", _inoti_fd);
- wd = _cal_inotify_get_wd(inoti_fd, path);
- if (wd == -1)
- {
- ERR("Failed to get wd(err:%d)", errno);
+ wd = _cal_inotify_get_wd(_inoti_fd, path);
+ if (wd == -1) {
+ ERR("_cal_inotify_get_wd() Fail(%d)", errno);
if (errno == EACCES)
return CALENDAR_ERROR_PERMISSION_DENIED;
return CALENDAR_ERROR_SYSTEM;
}
- ret = _cal_inotify_delete_noti_with_data(¬i_list, wd, callback, user_data);
- if (CALENDAR_ERROR_NONE != ret)
- {
- WARN("Failed to delete noti(err:%d)", ret);
- return _cal_inotify_add_watch(inoti_fd, path);
+ ret = _cal_del_noti(&_noti_list, wd, cb, cb_data);
+ WARN_IF(ret < CALENDAR_ERROR_NONE, "_cal_del_noti() Fail(%d)", ret);
+
+ if (CALENDAR_ERROR_NONE != ret) {
+ ret = _cal_inotify_add_watch(_inoti_fd, path);
+ return ret;
}
- ret = inotify_rm_watch(inoti_fd, wd);
- return (ret == 0) ? CALENDAR_ERROR_NONE : CALENDAR_ERROR_SYSTEM;
+ return inotify_rm_watch(_inoti_fd, wd);
}
static inline gboolean _cal_inotify_detach_handler(guint id)
static void __clear_nslot_list(gpointer data, gpointer user_data)
{
- free(data);
+ noti_info_s *noti = (noti_info_s *)data;
+ free(noti);
}
void cal_inotify_deinit(void)
inoti_handler = 0;
}
- if (noti_list)
+ if (_noti_list)
{
- g_slist_foreach(noti_list, __clear_nslot_list, NULL);
- g_slist_free(noti_list);
- noti_list = NULL;
+ g_slist_foreach(_noti_list, __clear_nslot_list, NULL);
+ g_slist_free(_noti_list);
+ _noti_list = NULL;
}
- if (0 <= inoti_fd) {
- close(inoti_fd);
- inoti_fd = -1;
+ if (0 <= _inoti_fd) {
+ close(_inoti_fd);
+ _inoti_fd = -1;
}
}
#include "calendar_db.h"
#include "cal_typedef.h"
-#ifdef CAL_IPC_CLIENT
-void cal_inotify_call_pending_callback(void);
-#endif
-
int cal_inotify_init(void);
-int cal_inotify_subscribe(cal_noti_type_e type, const char *path, calendar_db_changed_cb callback, void *data);
-int cal_inotify_unsubscribe_with_data(const char *path, calendar_db_changed_cb callback, void *user_data);
-int cal_inotify_subscribe_ipc_ready(calendar_h handle, void (*cb)(void *), void *user_data);
-int cal_inotify_unsubscribe_ipc_ready(calendar_h handle);
+int cal_inotify_subscribe(cal_noti_type_e type, const char *path, void *cb, void *data);
+int cal_inotify_unsubscribe(const char *path, void *cb, void *user_data);
void cal_inotify_deinit(void);
#endif /* __CALENDAR_SVC_INOTIFY_H__ */
RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
type =cal_view_get_type(view_uri);
+ DBG("----------------------[%s]", view_uri);
RETV_IF(CAL_RECORD_TYPE_INVALID == type, CALENDAR_ERROR_INVALID_PARAMETER);
cal_record_plugin_cb_s *plugin_cb = cal_record_get_plugin_cb(type);
#define CAL_NOTI_EVENT_CHANGED tzplatform_mkpath(TZ_USER_DATA,"calendar-svc/.CALENDAR_SVC_EVENT_CHANGED")
#define CAL_NOTI_TODO_CHANGED tzplatform_mkpath(TZ_USER_DATA,"calendar-svc/.CALENDAR_SVC_TODO_CHANGED")
#define CAL_NOTI_CALENDAR_CHANGED tzplatform_mkpath(TZ_USER_DATA,"calendar-svc/.CALENDAR_SVC_CALENDAR_CHANGED")
-#define CAL_NOTI_IPC_READY tzplatform_mkpath(TZ_USER_DATA,"calendar-svc/.CALENDAR_SVC_IPC_READY")
#define CAL_NOTI_REMINDER_CAHNGED "reminder"
#define CAL_FORMAT_LOCAL_DATETIME "%04d-%02d-%02dT%02d:%02d:%02d"
#define CAL_DATETIME_FORMAT_YYYYMMDD "%04d%02d%02d"
int has_attendee;
int has_alarm;
int system_type;
- long updated;
+ int updated;
char *sync_data1;
char *sync_data2;
char *sync_data3;
int wkst;
int has_alarm;
int system_type;
- long updated;
+ int updated;
char *sync_data1;
char *sync_data2;
char *sync_data3;
int index;
int store_type;
char *uid;
- long updated;
+ int updated;
char *name;
char *description;
char *color;
double d;
long long int lli;
calendar_time_s caltime;
- }value;
+ } value;
} cal_attribute_filter_s;
typedef struct {
bool distinct;
} cal_query_s;
-#define CAL_CALTIME_SET_UTIME(dest, src_utime) do {\
- (dest).type = CALENDAR_TIME_UTIME; \
- (dest).time.utime = src_utime; \
-} while (0)
-
-#define CAL_CALTIME_SET_DATE(dest, src_year, src_month, src_mday) do {\
- (dest).type = CALENDAR_TIME_LOCALTIME; \
- (dest).time.date.year = src_year; \
- (dest).time.date.month = src_month; \
- (dest).time.date.mday = src_mday; \
-} while (0)
-
typedef struct {
int property_id;
union {
double d;
long long int lli;
calendar_time_s caltime;
- }value;
+ } value;
} cal_search_value_s;
typedef struct {
*(cursor++) == 'L' &&
*(cursor++) == 'E' &&
*(cursor++) == ':' ) {
- DBG("[TEST] rrule");
return true;
}
else if (*(cursor-1) == 'E' &&
*(cursor++) == 'E' &&
*(cursor++) == 'N' &&
*(cursor++) == 'T') {
- DBG("[TEST] end");
break;
}
else {
#ifndef __CALENDAR_SVC_VIEW_H__
#define __CALENDAR_SVC_VIEW_H__
+#include "cal_typedef.h"
#include "calendar_view.h"
/* db record view: get, get_list, insert, update, delete, filter */
--- /dev/null
+SET(CAL_DBUS "cal_dbus")
+
+FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT dbus
+ COMMAND ${GDBUS_CODEGEN} --generate-c-code ${CAL_DBUS}
+ --interface-prefix ${INTERFACE_PREFIX}.
+ --c-namespace cal
+ ${CAL_DBUS}.xml
+ DEPENDS ${CAL_DBUS}.xml
+ COMMENT "Generated cal_dbus.c/h file")
+
+ADD_CUSTOM_TARGET(GENERATED_DBUS_CODE DEPENDS dbus)
+# gdbus-codegen --generate-c-code cal_dbus --interface-prefix org.tizen.calendar_service. --c-namespace cal cal_dbus.xml
--- /dev/null
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "cal_dbus.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.tizen.calendar_service.dbus
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:calDbus
+ * @title: calDbus
+ * @short_description: Generated C code for the org.tizen.calendar_service.dbus D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.tizen.calendar_service.dbus ---- */
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_register_resource_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_register_resource_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_register_resource_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_register_resource =
+{
+ {
+ -1,
+ (gchar *) "register_resource",
+ NULL,
+ (GDBusArgInfo **) &_cal_dbus_method_info_register_resource_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-register-resource",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_unregister_resource_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_unregister_resource_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_unregister_resource_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_unregister_resource =
+{
+ {
+ -1,
+ (gchar *) "unregister_resource",
+ NULL,
+ (GDBusArgInfo **) &_cal_dbus_method_info_unregister_resource_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-unregister-resource",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_IN_ARG_record =
+{
+ {
+ -1,
+ (gchar *) "record",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_record_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_insert_record_IN_ARG_handle,
+ &_cal_dbus_method_info_insert_record_IN_ARG_record,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_OUT_ARG_id =
+{
+ {
+ -1,
+ (gchar *) "id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_record_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_insert_record_OUT_ARG_id,
+ &_cal_dbus_method_info_insert_record_OUT_ARG_version,
+ &_cal_dbus_method_info_insert_record_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_insert_record =
+{
+ {
+ -1,
+ (gchar *) "insert_record",
+ (GDBusArgInfo **) &_cal_dbus_method_info_insert_record_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_insert_record_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-insert-record",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_IN_ARG_record =
+{
+ {
+ -1,
+ (gchar *) "record",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_record_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_update_record_IN_ARG_handle,
+ &_cal_dbus_method_info_update_record_IN_ARG_record,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_record_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_update_record_OUT_ARG_version,
+ &_cal_dbus_method_info_update_record_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_update_record =
+{
+ {
+ -1,
+ (gchar *) "update_record",
+ (GDBusArgInfo **) &_cal_dbus_method_info_update_record_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_update_record_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-update-record",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_IN_ARG_id =
+{
+ {
+ -1,
+ (gchar *) "id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_record_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_delete_record_IN_ARG_handle,
+ &_cal_dbus_method_info_delete_record_IN_ARG_view_uri,
+ &_cal_dbus_method_info_delete_record_IN_ARG_id,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_record_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_delete_record_OUT_ARG_version,
+ &_cal_dbus_method_info_delete_record_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_delete_record =
+{
+ {
+ -1,
+ (gchar *) "delete_record",
+ (GDBusArgInfo **) &_cal_dbus_method_info_delete_record_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_delete_record_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-delete-record",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_IN_ARG_record =
+{
+ {
+ -1,
+ (gchar *) "record",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_IN_ARG_id =
+{
+ {
+ -1,
+ (gchar *) "id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_record_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_replace_record_IN_ARG_handle,
+ &_cal_dbus_method_info_replace_record_IN_ARG_record,
+ &_cal_dbus_method_info_replace_record_IN_ARG_id,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_record_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_replace_record_OUT_ARG_version,
+ &_cal_dbus_method_info_replace_record_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_replace_record =
+{
+ {
+ -1,
+ (gchar *) "replace_record",
+ (GDBusArgInfo **) &_cal_dbus_method_info_replace_record_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_replace_record_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-replace-record",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_IN_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_records_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_insert_records_IN_ARG_handle,
+ &_cal_dbus_method_info_insert_records_IN_ARG_list,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_ids =
+{
+ {
+ -1,
+ (gchar *) "ids",
+ (gchar *) "ai",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_records_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_insert_records_OUT_ARG_ids,
+ &_cal_dbus_method_info_insert_records_OUT_ARG_count,
+ &_cal_dbus_method_info_insert_records_OUT_ARG_version,
+ &_cal_dbus_method_info_insert_records_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_insert_records =
+{
+ {
+ -1,
+ (gchar *) "insert_records",
+ (GDBusArgInfo **) &_cal_dbus_method_info_insert_records_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_insert_records_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-insert-records",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_IN_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_records_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_update_records_IN_ARG_handle,
+ &_cal_dbus_method_info_update_records_IN_ARG_list,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_records_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_update_records_OUT_ARG_version,
+ &_cal_dbus_method_info_update_records_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_update_records =
+{
+ {
+ -1,
+ (gchar *) "update_records",
+ (GDBusArgInfo **) &_cal_dbus_method_info_update_records_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_update_records_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-update-records",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_ids =
+{
+ {
+ -1,
+ (gchar *) "ids",
+ (gchar *) "ai",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_records_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_delete_records_IN_ARG_handle,
+ &_cal_dbus_method_info_delete_records_IN_ARG_view_uri,
+ &_cal_dbus_method_info_delete_records_IN_ARG_ids,
+ &_cal_dbus_method_info_delete_records_IN_ARG_count,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_records_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_delete_records_OUT_ARG_version,
+ &_cal_dbus_method_info_delete_records_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_delete_records =
+{
+ {
+ -1,
+ (gchar *) "delete_records",
+ (GDBusArgInfo **) &_cal_dbus_method_info_delete_records_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_delete_records_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-delete-records",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_ids =
+{
+ {
+ -1,
+ (gchar *) "ids",
+ (gchar *) "ai",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_records_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_replace_records_IN_ARG_handle,
+ &_cal_dbus_method_info_replace_records_IN_ARG_list,
+ &_cal_dbus_method_info_replace_records_IN_ARG_ids,
+ &_cal_dbus_method_info_replace_records_IN_ARG_count,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_records_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_replace_records_OUT_ARG_version,
+ &_cal_dbus_method_info_replace_records_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_replace_records =
+{
+ {
+ -1,
+ (gchar *) "replace_records",
+ (GDBusArgInfo **) &_cal_dbus_method_info_replace_records_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_replace_records_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-replace-records",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_IN_ARG_id =
+{
+ {
+ -1,
+ (gchar *) "id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_record_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_record_IN_ARG_handle,
+ &_cal_dbus_method_info_get_record_IN_ARG_view_uri,
+ &_cal_dbus_method_info_get_record_IN_ARG_id,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_OUT_ARG_record =
+{
+ {
+ -1,
+ (gchar *) "record",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_record_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_record_OUT_ARG_record,
+ &_cal_dbus_method_info_get_record_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_record =
+{
+ {
+ -1,
+ (gchar *) "get_record",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_record_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_record_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-record",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_offset =
+{
+ {
+ -1,
+ (gchar *) "offset",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_limit =
+{
+ {
+ -1,
+ (gchar *) "limit",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_all_records_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_all_records_IN_ARG_handle,
+ &_cal_dbus_method_info_get_all_records_IN_ARG_view_uri,
+ &_cal_dbus_method_info_get_all_records_IN_ARG_offset,
+ &_cal_dbus_method_info_get_all_records_IN_ARG_limit,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_OUT_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_all_records_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_all_records_OUT_ARG_list,
+ &_cal_dbus_method_info_get_all_records_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_all_records =
+{
+ {
+ -1,
+ (gchar *) "get_all_records",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_all_records_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_all_records_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-all-records",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_query =
+{
+ {
+ -1,
+ (gchar *) "query",
+ (gchar *) "(siviviii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_offset =
+{
+ {
+ -1,
+ (gchar *) "offset",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_limit =
+{
+ {
+ -1,
+ (gchar *) "limit",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_records_with_query_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_records_with_query_IN_ARG_handle,
+ &_cal_dbus_method_info_get_records_with_query_IN_ARG_query,
+ &_cal_dbus_method_info_get_records_with_query_IN_ARG_offset,
+ &_cal_dbus_method_info_get_records_with_query_IN_ARG_limit,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_OUT_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_records_with_query_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_records_with_query_OUT_ARG_list,
+ &_cal_dbus_method_info_get_records_with_query_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_records_with_query =
+{
+ {
+ -1,
+ (gchar *) "get_records_with_query",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_records_with_query_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_records_with_query_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-records-with-query",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_count_IN_ARG_handle,
+ &_cal_dbus_method_info_get_count_IN_ARG_view_uri,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_OUT_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_count_OUT_ARG_ret,
+ &_cal_dbus_method_info_get_count_OUT_ARG_count,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_count =
+{
+ {
+ -1,
+ (gchar *) "get_count",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_count_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_count_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-count",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_IN_ARG_query =
+{
+ {
+ -1,
+ (gchar *) "query",
+ (gchar *) "(siviviii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_with_query_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_count_with_query_IN_ARG_handle,
+ &_cal_dbus_method_info_get_count_with_query_IN_ARG_query,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_OUT_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_with_query_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_count_with_query_OUT_ARG_ret,
+ &_cal_dbus_method_info_get_count_with_query_OUT_ARG_count,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_count_with_query =
+{
+ {
+ -1,
+ (gchar *) "get_count_with_query",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_count_with_query_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_count_with_query_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-count-with-query",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_current_version_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_current_version_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_current_version_IN_ARG_handle,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_current_version_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_current_version_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_current_version_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_current_version_OUT_ARG_version,
+ &_cal_dbus_method_info_get_current_version_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_current_version =
+{
+ {
+ -1,
+ (gchar *) "get_current_version",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_current_version_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_current_version_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-current-version",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_add_changed_cb =
+{
+ {
+ -1,
+ (gchar *) "add_changed_cb",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-add-changed-cb",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_remove_changed_cb =
+{
+ {
+ -1,
+ (gchar *) "remove_changed_cb",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-remove-changed-cb",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_book_id =
+{
+ {
+ -1,
+ (gchar *) "book_id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_db_version =
+{
+ {
+ -1,
+ (gchar *) "db_version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_by_version_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_changes_by_version_IN_ARG_handle,
+ &_cal_dbus_method_info_get_changes_by_version_IN_ARG_view_uri,
+ &_cal_dbus_method_info_get_changes_by_version_IN_ARG_book_id,
+ &_cal_dbus_method_info_get_changes_by_version_IN_ARG_db_version,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_OUT_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_by_version_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_list,
+ &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_version,
+ &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_changes_by_version =
+{
+ {
+ -1,
+ (gchar *) "get_changes_by_version",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_by_version_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-changes-by-version",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_last_change_version =
+{
+ {
+ -1,
+ (gchar *) "get_last_change_version",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-get-last-change-version",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_view_uri =
+{
+ {
+ -1,
+ (gchar *) "view_uri",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_parent_id =
+{
+ {
+ -1,
+ (gchar *) "parent_id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_db_version =
+{
+ {
+ -1,
+ (gchar *) "db_version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_handle,
+ &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_view_uri,
+ &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_parent_id,
+ &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_db_version,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_list =
+{
+ {
+ -1,
+ (gchar *) "list",
+ (gchar *) "(iv)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_list,
+ &_cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_changes_exception_by_version =
+{
+ {
+ -1,
+ (gchar *) "get_changes_exception_by_version",
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-changes-exception-by-version",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_IN_ARG_book_id =
+{
+ {
+ -1,
+ (gchar *) "book_id",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_IN_ARG_db_version =
+{
+ {
+ -1,
+ (gchar *) "db_version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_clean_after_sync_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_clean_after_sync_IN_ARG_handle,
+ &_cal_dbus_method_info_clean_after_sync_IN_ARG_book_id,
+ &_cal_dbus_method_info_clean_after_sync_IN_ARG_db_version,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_clean_after_sync_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_clean_after_sync_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_clean_after_sync =
+{
+ {
+ -1,
+ (gchar *) "clean_after_sync",
+ (GDBusArgInfo **) &_cal_dbus_method_info_clean_after_sync_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_clean_after_sync_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-clean-after-sync",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_IN_ARG_stream =
+{
+ {
+ -1,
+ (gchar *) "stream",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_vcalendars_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_insert_vcalendars_IN_ARG_handle,
+ &_cal_dbus_method_info_insert_vcalendars_IN_ARG_stream,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_ids =
+{
+ {
+ -1,
+ (gchar *) "ids",
+ (gchar *) "ai",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_vcalendars_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_ids,
+ &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_count,
+ &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_version,
+ &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_ret,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_insert_vcalendars =
+{
+ {
+ -1,
+ (gchar *) "insert_vcalendars",
+ (GDBusArgInfo **) &_cal_dbus_method_info_insert_vcalendars_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-insert-vcalendars",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_handle =
+{
+ {
+ -1,
+ (gchar *) "handle",
+ (gchar *) "(ii)",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_stream =
+{
+ {
+ -1,
+ (gchar *) "stream",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_ids =
+{
+ {
+ -1,
+ (gchar *) "ids",
+ (gchar *) "ai",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_count =
+{
+ {
+ -1,
+ (gchar *) "count",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_vcalendars_IN_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_replace_vcalendars_IN_ARG_handle,
+ &_cal_dbus_method_info_replace_vcalendars_IN_ARG_stream,
+ &_cal_dbus_method_info_replace_vcalendars_IN_ARG_ids,
+ &_cal_dbus_method_info_replace_vcalendars_IN_ARG_count,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_OUT_ARG_ret =
+{
+ {
+ -1,
+ (gchar *) "ret",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_OUT_ARG_version =
+{
+ {
+ -1,
+ (gchar *) "version",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_vcalendars_OUT_ARG_pointers[] =
+{
+ &_cal_dbus_method_info_replace_vcalendars_OUT_ARG_ret,
+ &_cal_dbus_method_info_replace_vcalendars_OUT_ARG_version,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_replace_vcalendars =
+{
+ {
+ -1,
+ (gchar *) "replace_vcalendars",
+ (GDBusArgInfo **) &_cal_dbus_method_info_replace_vcalendars_IN_ARG_pointers,
+ (GDBusArgInfo **) &_cal_dbus_method_info_replace_vcalendars_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-replace-vcalendars",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _cal_dbus_method_info_pointers[] =
+{
+ &_cal_dbus_method_info_register_resource,
+ &_cal_dbus_method_info_unregister_resource,
+ &_cal_dbus_method_info_insert_record,
+ &_cal_dbus_method_info_update_record,
+ &_cal_dbus_method_info_delete_record,
+ &_cal_dbus_method_info_replace_record,
+ &_cal_dbus_method_info_insert_records,
+ &_cal_dbus_method_info_update_records,
+ &_cal_dbus_method_info_delete_records,
+ &_cal_dbus_method_info_replace_records,
+ &_cal_dbus_method_info_get_record,
+ &_cal_dbus_method_info_get_all_records,
+ &_cal_dbus_method_info_get_records_with_query,
+ &_cal_dbus_method_info_get_count,
+ &_cal_dbus_method_info_get_count_with_query,
+ &_cal_dbus_method_info_get_current_version,
+ &_cal_dbus_method_info_add_changed_cb,
+ &_cal_dbus_method_info_remove_changed_cb,
+ &_cal_dbus_method_info_get_changes_by_version,
+ &_cal_dbus_method_info_get_last_change_version,
+ &_cal_dbus_method_info_get_changes_exception_by_version,
+ &_cal_dbus_method_info_clean_after_sync,
+ &_cal_dbus_method_info_insert_vcalendars,
+ &_cal_dbus_method_info_replace_vcalendars,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _cal_dbus_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.tizen.calendar_service.dbus",
+ (GDBusMethodInfo **) &_cal_dbus_method_info_pointers,
+ NULL,
+ NULL,
+ NULL
+ },
+ "dbus",
+};
+
+
+/**
+ * cal_dbus_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+cal_dbus_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct;
+}
+
+/**
+ * cal_dbus_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #calDbus interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+cal_dbus_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * calDbus:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>.
+ */
+
+/**
+ * calDbusIface:
+ * @parent_iface: The parent interface.
+ * @handle_add_changed_cb: Handler for the #calDbus::handle-add-changed-cb signal.
+ * @handle_clean_after_sync: Handler for the #calDbus::handle-clean-after-sync signal.
+ * @handle_delete_record: Handler for the #calDbus::handle-delete-record signal.
+ * @handle_delete_records: Handler for the #calDbus::handle-delete-records signal.
+ * @handle_get_all_records: Handler for the #calDbus::handle-get-all-records signal.
+ * @handle_get_changes_by_version: Handler for the #calDbus::handle-get-changes-by-version signal.
+ * @handle_get_changes_exception_by_version: Handler for the #calDbus::handle-get-changes-exception-by-version signal.
+ * @handle_get_count: Handler for the #calDbus::handle-get-count signal.
+ * @handle_get_count_with_query: Handler for the #calDbus::handle-get-count-with-query signal.
+ * @handle_get_current_version: Handler for the #calDbus::handle-get-current-version signal.
+ * @handle_get_last_change_version: Handler for the #calDbus::handle-get-last-change-version signal.
+ * @handle_get_record: Handler for the #calDbus::handle-get-record signal.
+ * @handle_get_records_with_query: Handler for the #calDbus::handle-get-records-with-query signal.
+ * @handle_insert_record: Handler for the #calDbus::handle-insert-record signal.
+ * @handle_insert_records: Handler for the #calDbus::handle-insert-records signal.
+ * @handle_insert_vcalendars: Handler for the #calDbus::handle-insert-vcalendars signal.
+ * @handle_register_resource: Handler for the #calDbus::handle-register-resource signal.
+ * @handle_remove_changed_cb: Handler for the #calDbus::handle-remove-changed-cb signal.
+ * @handle_replace_record: Handler for the #calDbus::handle-replace-record signal.
+ * @handle_replace_records: Handler for the #calDbus::handle-replace-records signal.
+ * @handle_replace_vcalendars: Handler for the #calDbus::handle-replace-vcalendars signal.
+ * @handle_unregister_resource: Handler for the #calDbus::handle-unregister-resource signal.
+ * @handle_update_record: Handler for the #calDbus::handle-update-record signal.
+ * @handle_update_records: Handler for the #calDbus::handle-update-records signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>.
+ */
+
+typedef calDbusIface calDbusInterface;
+G_DEFINE_INTERFACE (calDbus, cal_dbus, G_TYPE_OBJECT);
+
+static void
+cal_dbus_default_init (calDbusIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * calDbus::handle-register-resource:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_register_resource() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-register-resource",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_register_resource),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * calDbus::handle-unregister-resource:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_unregister_resource() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-unregister-resource",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_unregister_resource),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * calDbus::handle-insert-record:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_record: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_insert_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-insert-record",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_insert_record),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
+
+ /**
+ * calDbus::handle-update-record:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_record: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_update_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-update-record",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_update_record),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
+
+ /**
+ * calDbus::handle-delete-record:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ * @arg_id: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_delete_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-delete-record",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_delete_record),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-replace-record:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_record: Argument passed by remote caller.
+ * @arg_id: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_replace_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-replace-record",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_replace_record),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-insert-records:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_list: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_insert_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-insert-records",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_insert_records),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
+
+ /**
+ * calDbus::handle-update-records:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_list: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_update_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-update-records",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_update_records),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
+
+ /**
+ * calDbus::handle-delete-records:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ * @arg_ids: Argument passed by remote caller.
+ * @arg_count: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_delete_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-delete-records",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_delete_records),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-replace-records:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_list: Argument passed by remote caller.
+ * @arg_ids: Argument passed by remote caller.
+ * @arg_count: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_replace_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-replace-records",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_replace_records),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-get-record:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ * @arg_id: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-record",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_record),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-get-all-records:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ * @arg_offset: Argument passed by remote caller.
+ * @arg_limit: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_all_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-all-records",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_all_records),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-get-records-with-query:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_query: Argument passed by remote caller.
+ * @arg_offset: Argument passed by remote caller.
+ * @arg_limit: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_records_with_query() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-records-with-query",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_records_with_query),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_INT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-get-count:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_count() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-count",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_count),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING);
+
+ /**
+ * calDbus::handle-get-count-with-query:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_query: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_count_with_query() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-count-with-query",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_count_with_query),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
+
+ /**
+ * calDbus::handle-get-current-version:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_current_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-current-version",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_current_version),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);
+
+ /**
+ * calDbus::handle-add-changed-cb:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_add_changed_cb() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-add-changed-cb",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_add_changed_cb),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * calDbus::handle-remove-changed-cb:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_remove_changed_cb() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-remove-changed-cb",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_remove_changed_cb),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * calDbus::handle-get-changes-by-version:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ * @arg_book_id: Argument passed by remote caller.
+ * @arg_db_version: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_changes_by_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-changes-by-version",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_changes_by_version),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-get-last-change-version:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_last_change_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-last-change-version",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_last_change_version),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * calDbus::handle-get-changes-exception-by-version:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_view_uri: Argument passed by remote caller.
+ * @arg_parent_id: Argument passed by remote caller.
+ * @arg_db_version: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_changes_exception_by_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-changes-exception-by-version",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_get_changes_exception_by_version),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-clean-after-sync:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_book_id: Argument passed by remote caller.
+ * @arg_db_version: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_clean_after_sync() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-clean-after-sync",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_clean_after_sync),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_INT, G_TYPE_INT);
+
+ /**
+ * calDbus::handle-insert-vcalendars:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_stream: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_insert_vcalendars() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-insert-vcalendars",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_insert_vcalendars),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING);
+
+ /**
+ * calDbus::handle-replace-vcalendars:
+ * @object: A #calDbus.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_handle: Argument passed by remote caller.
+ * @arg_stream: Argument passed by remote caller.
+ * @arg_ids: Argument passed by remote caller.
+ * @arg_count: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method.
+ *
+ * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_replace_vcalendars() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-replace-vcalendars",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (calDbusIface, handle_replace_vcalendars),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 5,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_INT);
+
+}
+
+/**
+ * cal_dbus_call_register_resource:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_register_resource_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_register_resource_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_register_resource (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "register_resource",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_register_resource_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_register_resource().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_register_resource().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_register_resource_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_register_resource_sync:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_register_resource() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_register_resource_sync (
+ calDbus *proxy,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "register_resource",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_unregister_resource:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_unregister_resource_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_unregister_resource_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_unregister_resource (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "unregister_resource",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_unregister_resource_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_unregister_resource().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_unregister_resource().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_unregister_resource_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_unregister_resource_sync:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_unregister_resource() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_unregister_resource_sync (
+ calDbus *proxy,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "unregister_resource",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_insert_record:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_record: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_insert_record_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_insert_record_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_insert_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "insert_record",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_record),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_insert_record_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_id: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_insert_record().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_insert_record().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_insert_record_finish (
+ calDbus *proxy,
+ gint *out_id,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(iii)",
+ out_id,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_insert_record_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_record: Argument to pass with the method invocation.
+ * @out_id: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_insert_record() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_insert_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint *out_id,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "insert_record",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_record),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(iii)",
+ out_id,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_update_record:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_record: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_update_record_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_update_record_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_update_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "update_record",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_record),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_update_record_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_update_record().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_update_record().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_update_record_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_update_record_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_record: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_update_record() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_update_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "update_record",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_record),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_delete_record:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_id: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_delete_record_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_delete_record_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_delete_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "delete_record",
+ g_variant_new ("(@(ii)si)",
+ arg_handle,
+ arg_view_uri,
+ arg_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_delete_record_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_delete_record().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_delete_record().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_delete_record_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_delete_record_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_id: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_delete_record() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_delete_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "delete_record",
+ g_variant_new ("(@(ii)si)",
+ arg_handle,
+ arg_view_uri,
+ arg_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_replace_record:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_record: Argument to pass with the method invocation.
+ * @arg_id: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_replace_record_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_replace_record_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_replace_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint arg_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "replace_record",
+ g_variant_new ("(@(ii)@(iv)i)",
+ arg_handle,
+ arg_record,
+ arg_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_replace_record_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_replace_record().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_replace_record().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_replace_record_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_replace_record_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_record: Argument to pass with the method invocation.
+ * @arg_id: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_replace_record() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_replace_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint arg_id,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "replace_record",
+ g_variant_new ("(@(ii)@(iv)i)",
+ arg_handle,
+ arg_record,
+ arg_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_insert_records:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_list: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_insert_records_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_insert_records_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_insert_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "insert_records",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_list),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_insert_records_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ids: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_insert_records().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_insert_records().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_insert_records_finish (
+ calDbus *proxy,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@aiiii)",
+ out_ids,
+ out_count,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_insert_records_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_list: Argument to pass with the method invocation.
+ * @out_ids: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_insert_records() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_insert_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "insert_records",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_list),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@aiiii)",
+ out_ids,
+ out_count,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_update_records:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_list: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_update_records_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_update_records_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_update_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "update_records",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_list),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_update_records_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_update_records().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_update_records().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_update_records_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_update_records_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_list: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_update_records() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_update_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "update_records",
+ g_variant_new ("(@(ii)@(iv))",
+ arg_handle,
+ arg_list),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_delete_records:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_ids: Argument to pass with the method invocation.
+ * @arg_count: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_delete_records_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_delete_records_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_delete_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GVariant *arg_ids,
+ gint arg_count,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "delete_records",
+ g_variant_new ("(@(ii)s@aii)",
+ arg_handle,
+ arg_view_uri,
+ arg_ids,
+ arg_count),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_delete_records_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_delete_records().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_delete_records().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_delete_records_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_delete_records_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_ids: Argument to pass with the method invocation.
+ * @arg_count: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_delete_records() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_delete_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GVariant *arg_ids,
+ gint arg_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "delete_records",
+ g_variant_new ("(@(ii)s@aii)",
+ arg_handle,
+ arg_view_uri,
+ arg_ids,
+ arg_count),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_replace_records:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_list: Argument to pass with the method invocation.
+ * @arg_ids: Argument to pass with the method invocation.
+ * @arg_count: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_replace_records_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_replace_records_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_replace_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant *arg_ids,
+ gint arg_count,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "replace_records",
+ g_variant_new ("(@(ii)@(iv)@aii)",
+ arg_handle,
+ arg_list,
+ arg_ids,
+ arg_count),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_replace_records_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_replace_records().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_replace_records().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_replace_records_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_replace_records_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_list: Argument to pass with the method invocation.
+ * @arg_ids: Argument to pass with the method invocation.
+ * @arg_count: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_replace_records() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_replace_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant *arg_ids,
+ gint arg_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "replace_records",
+ g_variant_new ("(@(ii)@(iv)@aii)",
+ arg_handle,
+ arg_list,
+ arg_ids,
+ arg_count),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_record:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_id: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_record_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_record_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_record",
+ g_variant_new ("(@(ii)si)",
+ arg_handle,
+ arg_view_uri,
+ arg_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_record_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_record: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_record().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_record().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_record_finish (
+ calDbus *proxy,
+ GVariant **out_record,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_record,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_record_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_id: Argument to pass with the method invocation.
+ * @out_record: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_record() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ GVariant **out_record,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_record",
+ g_variant_new ("(@(ii)si)",
+ arg_handle,
+ arg_view_uri,
+ arg_id),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_record,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_all_records:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_offset: Argument to pass with the method invocation.
+ * @arg_limit: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_all_records_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_all_records_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_all_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_offset,
+ gint arg_limit,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_all_records",
+ g_variant_new ("(@(ii)sii)",
+ arg_handle,
+ arg_view_uri,
+ arg_offset,
+ arg_limit),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_all_records_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_all_records().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_all_records().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_all_records_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_list,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_all_records_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_offset: Argument to pass with the method invocation.
+ * @arg_limit: Argument to pass with the method invocation.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_all_records() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_all_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_offset,
+ gint arg_limit,
+ GVariant **out_list,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_all_records",
+ g_variant_new ("(@(ii)sii)",
+ arg_handle,
+ arg_view_uri,
+ arg_offset,
+ arg_limit),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_list,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_records_with_query:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_query: Argument to pass with the method invocation.
+ * @arg_offset: Argument to pass with the method invocation.
+ * @arg_limit: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_records_with_query_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_records_with_query_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_records_with_query (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint arg_offset,
+ gint arg_limit,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_records_with_query",
+ g_variant_new ("(@(ii)@(siviviii)ii)",
+ arg_handle,
+ arg_query,
+ arg_offset,
+ arg_limit),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_records_with_query_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_records_with_query().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_records_with_query().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_records_with_query_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_list,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_records_with_query_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_query: Argument to pass with the method invocation.
+ * @arg_offset: Argument to pass with the method invocation.
+ * @arg_limit: Argument to pass with the method invocation.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_records_with_query() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_records_with_query_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint arg_offset,
+ gint arg_limit,
+ GVariant **out_list,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_records_with_query",
+ g_variant_new ("(@(ii)@(siviviii)ii)",
+ arg_handle,
+ arg_query,
+ arg_offset,
+ arg_limit),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_list,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_count:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_count_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_count_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_count (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_count",
+ g_variant_new ("(@(ii)s)",
+ arg_handle,
+ arg_view_uri),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_count_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_count().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_count().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_count_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ gint *out_count,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_ret,
+ out_count);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_count_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_count() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_count_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint *out_ret,
+ gint *out_count,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_count",
+ g_variant_new ("(@(ii)s)",
+ arg_handle,
+ arg_view_uri),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_ret,
+ out_count);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_count_with_query:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_query: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_count_with_query_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_count_with_query_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_count_with_query (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_count_with_query",
+ g_variant_new ("(@(ii)@(siviviii))",
+ arg_handle,
+ arg_query),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_count_with_query_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_count_with_query().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_count_with_query().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_count_with_query_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ gint *out_count,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_ret,
+ out_count);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_count_with_query_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_query: Argument to pass with the method invocation.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_count_with_query() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_count_with_query_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint *out_ret,
+ gint *out_count,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_count_with_query",
+ g_variant_new ("(@(ii)@(siviviii))",
+ arg_handle,
+ arg_query),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_ret,
+ out_count);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_current_version:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_current_version_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_current_version_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_current_version (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_current_version",
+ g_variant_new ("(@(ii))",
+ arg_handle),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_current_version_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_current_version().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_current_version().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_current_version_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_current_version_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_current_version() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_current_version_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_current_version",
+ g_variant_new ("(@(ii))",
+ arg_handle),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_add_changed_cb:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_add_changed_cb_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_add_changed_cb_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_add_changed_cb (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "add_changed_cb",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_add_changed_cb_finish:
+ * @proxy: A #calDbusProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_add_changed_cb().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_add_changed_cb().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_add_changed_cb_finish (
+ calDbus *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_add_changed_cb_sync:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_add_changed_cb() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_add_changed_cb_sync (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "add_changed_cb",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_remove_changed_cb:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_remove_changed_cb_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_remove_changed_cb_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_remove_changed_cb (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "remove_changed_cb",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_remove_changed_cb_finish:
+ * @proxy: A #calDbusProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_remove_changed_cb().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_remove_changed_cb().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_remove_changed_cb_finish (
+ calDbus *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_remove_changed_cb_sync:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_remove_changed_cb() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_remove_changed_cb_sync (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "remove_changed_cb",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_changes_by_version:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_book_id: Argument to pass with the method invocation.
+ * @arg_db_version: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_changes_by_version_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_changes_by_version_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_changes_by_version (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_book_id,
+ gint arg_db_version,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_changes_by_version",
+ g_variant_new ("(@(ii)sii)",
+ arg_handle,
+ arg_view_uri,
+ arg_book_id,
+ arg_db_version),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_changes_by_version_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_changes_by_version().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_changes_by_version().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_changes_by_version_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)ii)",
+ out_list,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_changes_by_version_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_book_id: Argument to pass with the method invocation.
+ * @arg_db_version: Argument to pass with the method invocation.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_changes_by_version() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_changes_by_version_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_book_id,
+ gint arg_db_version,
+ GVariant **out_list,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_changes_by_version",
+ g_variant_new ("(@(ii)sii)",
+ arg_handle,
+ arg_view_uri,
+ arg_book_id,
+ arg_db_version),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)ii)",
+ out_list,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_last_change_version:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_last_change_version_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_last_change_version_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_last_change_version (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_last_change_version",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_last_change_version_finish:
+ * @proxy: A #calDbusProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_last_change_version().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_last_change_version().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_last_change_version_finish (
+ calDbus *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_last_change_version_sync:
+ * @proxy: A #calDbusProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_last_change_version() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_last_change_version_sync (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_last_change_version",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_changes_exception_by_version:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_parent_id: Argument to pass with the method invocation.
+ * @arg_db_version: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_get_changes_exception_by_version_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_get_changes_exception_by_version_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_get_changes_exception_by_version (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_parent_id,
+ gint arg_db_version,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "get_changes_exception_by_version",
+ g_variant_new ("(@(ii)sii)",
+ arg_handle,
+ arg_view_uri,
+ arg_parent_id,
+ arg_db_version),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_get_changes_exception_by_version_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_changes_exception_by_version().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_get_changes_exception_by_version().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_changes_exception_by_version_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_list,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_get_changes_exception_by_version_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_view_uri: Argument to pass with the method invocation.
+ * @arg_parent_id: Argument to pass with the method invocation.
+ * @arg_db_version: Argument to pass with the method invocation.
+ * @out_list: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_get_changes_exception_by_version() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_get_changes_exception_by_version_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_parent_id,
+ gint arg_db_version,
+ GVariant **out_list,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "get_changes_exception_by_version",
+ g_variant_new ("(@(ii)sii)",
+ arg_handle,
+ arg_view_uri,
+ arg_parent_id,
+ arg_db_version),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@(iv)i)",
+ out_list,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_clean_after_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_book_id: Argument to pass with the method invocation.
+ * @arg_db_version: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_clean_after_sync_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_clean_after_sync_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_clean_after_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ gint arg_book_id,
+ gint arg_db_version,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "clean_after_sync",
+ g_variant_new ("(@(ii)ii)",
+ arg_handle,
+ arg_book_id,
+ arg_db_version),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_clean_after_sync_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_clean_after_sync().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_clean_after_sync().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_clean_after_sync_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_clean_after_sync_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_book_id: Argument to pass with the method invocation.
+ * @arg_db_version: Argument to pass with the method invocation.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_clean_after_sync() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_clean_after_sync_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ gint arg_book_id,
+ gint arg_db_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "clean_after_sync",
+ g_variant_new ("(@(ii)ii)",
+ arg_handle,
+ arg_book_id,
+ arg_db_version),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_insert_vcalendars:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_stream: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_insert_vcalendars_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_insert_vcalendars_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_insert_vcalendars (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "insert_vcalendars",
+ g_variant_new ("(@(ii)s)",
+ arg_handle,
+ arg_stream),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_insert_vcalendars_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ids: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_insert_vcalendars().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_insert_vcalendars().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_insert_vcalendars_finish (
+ calDbus *proxy,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@aiiii)",
+ out_ids,
+ out_count,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_insert_vcalendars_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_stream: Argument to pass with the method invocation.
+ * @out_ids: (out): Return location for return parameter or %NULL to ignore.
+ * @out_count: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_insert_vcalendars() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_insert_vcalendars_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "insert_vcalendars",
+ g_variant_new ("(@(ii)s)",
+ arg_handle,
+ arg_stream),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(@aiiii)",
+ out_ids,
+ out_count,
+ out_version,
+ out_ret);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_replace_vcalendars:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_stream: Argument to pass with the method invocation.
+ * @arg_ids: Argument to pass with the method invocation.
+ * @arg_count: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_call_replace_vcalendars_finish() to get the result of the operation.
+ *
+ * See cal_dbus_call_replace_vcalendars_sync() for the synchronous, blocking version of this method.
+ */
+void
+cal_dbus_call_replace_vcalendars (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant *arg_ids,
+ gint arg_count,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "replace_vcalendars",
+ g_variant_new ("(@(ii)s@aii)",
+ arg_handle,
+ arg_stream,
+ arg_ids,
+ arg_count),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * cal_dbus_call_replace_vcalendars_finish:
+ * @proxy: A #calDbusProxy.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_replace_vcalendars().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with cal_dbus_call_replace_vcalendars().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_replace_vcalendars_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ gint *out_version,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_ret,
+ out_version);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_call_replace_vcalendars_sync:
+ * @proxy: A #calDbusProxy.
+ * @arg_handle: Argument to pass with the method invocation.
+ * @arg_stream: Argument to pass with the method invocation.
+ * @arg_ids: Argument to pass with the method invocation.
+ * @arg_count: Argument to pass with the method invocation.
+ * @out_ret: (out): Return location for return parameter or %NULL to ignore.
+ * @out_version: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_call_replace_vcalendars() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+cal_dbus_call_replace_vcalendars_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant *arg_ids,
+ gint arg_count,
+ gint *out_ret,
+ gint *out_version,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "replace_vcalendars",
+ g_variant_new ("(@(ii)s@aii)",
+ arg_handle,
+ arg_stream,
+ arg_ids,
+ arg_count),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(ii)",
+ out_ret,
+ out_version);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * cal_dbus_complete_register_resource:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_register_resource (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ ret));
+}
+
+/**
+ * cal_dbus_complete_unregister_resource:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_unregister_resource (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ ret));
+}
+
+/**
+ * cal_dbus_complete_insert_record:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @id: Parameter to return.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_insert_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint id,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(iii)",
+ id,
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_update_record:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_update_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_delete_record:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_delete_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_replace_record:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_replace_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_insert_records:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ids: Parameter to return.
+ * @count: Parameter to return.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_insert_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *ids,
+ gint count,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@aiiii)",
+ ids,
+ count,
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_update_records:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_update_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_delete_records:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_delete_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_replace_records:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_replace_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_get_record:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @record: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *record,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@(iv)i)",
+ record,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_get_all_records:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @list: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_all_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@(iv)i)",
+ list,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_get_records_with_query:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @list: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_records_with_query (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@(iv)i)",
+ list,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_get_count:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ret: Parameter to return.
+ * @count: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_count (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret,
+ gint count)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ ret,
+ count));
+}
+
+/**
+ * cal_dbus_complete_get_count_with_query:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ret: Parameter to return.
+ * @count: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_count_with_query (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret,
+ gint count)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ ret,
+ count));
+}
+
+/**
+ * cal_dbus_complete_get_current_version:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_current_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_add_changed_cb:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_add_changed_cb (
+ calDbus *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * cal_dbus_complete_remove_changed_cb:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_remove_changed_cb (
+ calDbus *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * cal_dbus_complete_get_changes_by_version:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @list: Parameter to return.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_changes_by_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@(iv)ii)",
+ list,
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_get_last_change_version:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_last_change_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * cal_dbus_complete_get_changes_exception_by_version:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @list: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_get_changes_exception_by_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@(iv)i)",
+ list,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_clean_after_sync:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_clean_after_sync (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ ret));
+}
+
+/**
+ * cal_dbus_complete_insert_vcalendars:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ids: Parameter to return.
+ * @count: Parameter to return.
+ * @version: Parameter to return.
+ * @ret: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_insert_vcalendars (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *ids,
+ gint count,
+ gint version,
+ gint ret)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(@aiiii)",
+ ids,
+ count,
+ version,
+ ret));
+}
+
+/**
+ * cal_dbus_complete_replace_vcalendars:
+ * @object: A #calDbus.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @ret: Parameter to return.
+ * @version: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+cal_dbus_complete_replace_vcalendars (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret,
+ gint version)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(ii)",
+ ret,
+ version));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * calDbusProxy:
+ *
+ * The #calDbusProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * calDbusProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #calDbusProxy.
+ */
+
+struct _calDbusProxyPrivate
+{
+ GData *qdata;
+};
+
+static void cal_dbus_proxy_iface_init (calDbusIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (calDbusProxy, cal_dbus_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (calDbusProxy)
+ G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (calDbusProxy, cal_dbus_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_proxy_iface_init));
+
+#endif
+static void
+cal_dbus_proxy_finalize (GObject *object)
+{
+ calDbusProxy *proxy = CAL_DBUS_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (cal_dbus_proxy_parent_class)->finalize (object);
+}
+
+static void
+cal_dbus_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+}
+
+static void
+cal_dbus_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+}
+
+static void
+cal_dbus_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], CAL_TYPE_DBUS);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, CAL_TYPE_DBUS);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+cal_dbus_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ calDbusProxy *proxy = CAL_DBUS_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static void
+cal_dbus_proxy_init (calDbusProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = cal_dbus_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, CAL_TYPE_DBUS_PROXY, calDbusProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), cal_dbus_interface_info ());
+}
+
+static void
+cal_dbus_proxy_class_init (calDbusProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = cal_dbus_proxy_finalize;
+ gobject_class->get_property = cal_dbus_proxy_get_property;
+ gobject_class->set_property = cal_dbus_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = cal_dbus_proxy_g_signal;
+ proxy_class->g_properties_changed = cal_dbus_proxy_g_properties_changed;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (calDbusProxyPrivate));
+#endif
+}
+
+static void
+cal_dbus_proxy_iface_init (calDbusIface *iface)
+{
+}
+
+/**
+ * cal_dbus_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_proxy_new_finish() to get the result of the operation.
+ *
+ * See cal_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+cal_dbus_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (CAL_TYPE_DBUS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
+}
+
+/**
+ * cal_dbus_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with cal_dbus_proxy_new().
+ *
+ * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
+ */
+calDbus *
+cal_dbus_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return CAL_DBUS (ret);
+ else
+ return NULL;
+}
+
+/**
+ * cal_dbus_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
+ */
+calDbus *
+cal_dbus_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (CAL_TYPE_DBUS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
+ if (ret != NULL)
+ return CAL_DBUS (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * cal_dbus_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like cal_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call cal_dbus_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See cal_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+cal_dbus_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (CAL_TYPE_DBUS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
+}
+
+/**
+ * cal_dbus_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with cal_dbus_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
+ */
+calDbus *
+cal_dbus_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return CAL_DBUS (ret);
+ else
+ return NULL;
+}
+
+/**
+ * cal_dbus_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like cal_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See cal_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
+ */
+calDbus *
+cal_dbus_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (CAL_TYPE_DBUS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
+ if (ret != NULL)
+ return CAL_DBUS (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * calDbusSkeleton:
+ *
+ * The #calDbusSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * calDbusSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #calDbusSkeleton.
+ */
+
+struct _calDbusSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_cal_dbus_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], CAL_TYPE_DBUS);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, CAL_TYPE_DBUS);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_cal_dbus_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_cal_dbus_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _cal_dbus_skeleton_vtable =
+{
+ _cal_dbus_skeleton_handle_method_call,
+ _cal_dbus_skeleton_handle_get_property,
+ _cal_dbus_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+cal_dbus_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return cal_dbus_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+cal_dbus_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_cal_dbus_skeleton_vtable;
+}
+
+static GVariant *
+cal_dbus_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_cal_dbus_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _cal_dbus_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _cal_dbus_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _cal_dbus_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.tizen.calendar_service.dbus", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static void
+cal_dbus_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+}
+
+static void cal_dbus_skeleton_iface_init (calDbusIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (calDbusSkeleton, cal_dbus_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (calDbusSkeleton)
+ G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (calDbusSkeleton, cal_dbus_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_skeleton_iface_init));
+
+#endif
+static void
+cal_dbus_skeleton_finalize (GObject *object)
+{
+ calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (object);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (cal_dbus_skeleton_parent_class)->finalize (object);
+}
+
+static void
+cal_dbus_skeleton_init (calDbusSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = cal_dbus_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, CAL_TYPE_DBUS_SKELETON, calDbusSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+}
+
+static void
+cal_dbus_skeleton_class_init (calDbusSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = cal_dbus_skeleton_finalize;
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = cal_dbus_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = cal_dbus_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = cal_dbus_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = cal_dbus_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (calDbusSkeletonPrivate));
+#endif
+}
+
+static void
+cal_dbus_skeleton_iface_init (calDbusIface *iface)
+{
+}
+
+/**
+ * cal_dbus_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>.
+ *
+ * Returns: (transfer full) (type calDbusSkeleton): The skeleton object.
+ */
+calDbus *
+cal_dbus_skeleton_new (void)
+{
+ return CAL_DBUS (g_object_new (CAL_TYPE_DBUS_SKELETON, NULL));
+}
+
--- /dev/null
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __CAL_DBUS_H__
+#define __CAL_DBUS_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.tizen.calendar_service.dbus */
+
+#define CAL_TYPE_DBUS (cal_dbus_get_type ())
+#define CAL_DBUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAL_TYPE_DBUS, calDbus))
+#define CAL_IS_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAL_TYPE_DBUS))
+#define CAL_DBUS_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), CAL_TYPE_DBUS, calDbusIface))
+
+struct _calDbus;
+typedef struct _calDbus calDbus;
+typedef struct _calDbusIface calDbusIface;
+
+struct _calDbusIface
+{
+ GTypeInterface parent_iface;
+
+ gboolean (*handle_add_changed_cb) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_clean_after_sync) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ gint arg_book_id,
+ gint arg_db_version);
+
+ gboolean (*handle_delete_record) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id);
+
+ gboolean (*handle_delete_records) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GVariant *arg_ids,
+ gint arg_count);
+
+ gboolean (*handle_get_all_records) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_offset,
+ gint arg_limit);
+
+ gboolean (*handle_get_changes_by_version) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_book_id,
+ gint arg_db_version);
+
+ gboolean (*handle_get_changes_exception_by_version) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_parent_id,
+ gint arg_db_version);
+
+ gboolean (*handle_get_count) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri);
+
+ gboolean (*handle_get_count_with_query) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_query);
+
+ gboolean (*handle_get_current_version) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle);
+
+ gboolean (*handle_get_last_change_version) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_record) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id);
+
+ gboolean (*handle_get_records_with_query) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint arg_offset,
+ gint arg_limit);
+
+ gboolean (*handle_insert_record) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_record);
+
+ gboolean (*handle_insert_records) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_list);
+
+ gboolean (*handle_insert_vcalendars) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_stream);
+
+ gboolean (*handle_register_resource) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_remove_changed_cb) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_replace_record) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint arg_id);
+
+ gboolean (*handle_replace_records) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant *arg_ids,
+ gint arg_count);
+
+ gboolean (*handle_replace_vcalendars) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant *arg_ids,
+ gint arg_count);
+
+ gboolean (*handle_unregister_resource) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_update_record) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_record);
+
+ gboolean (*handle_update_records) (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ GVariant *arg_list);
+
+};
+
+GType cal_dbus_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *cal_dbus_interface_info (void);
+guint cal_dbus_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void cal_dbus_complete_register_resource (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret);
+
+void cal_dbus_complete_unregister_resource (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret);
+
+void cal_dbus_complete_insert_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint id,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_update_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_delete_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_replace_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_insert_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *ids,
+ gint count,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_update_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_delete_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_replace_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_get_record (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *record,
+ gint ret);
+
+void cal_dbus_complete_get_all_records (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint ret);
+
+void cal_dbus_complete_get_records_with_query (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint ret);
+
+void cal_dbus_complete_get_count (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret,
+ gint count);
+
+void cal_dbus_complete_get_count_with_query (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret,
+ gint count);
+
+void cal_dbus_complete_get_current_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_add_changed_cb (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+void cal_dbus_complete_remove_changed_cb (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+void cal_dbus_complete_get_changes_by_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_get_last_change_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation);
+
+void cal_dbus_complete_get_changes_exception_by_version (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *list,
+ gint ret);
+
+void cal_dbus_complete_clean_after_sync (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret);
+
+void cal_dbus_complete_insert_vcalendars (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *ids,
+ gint count,
+ gint version,
+ gint ret);
+
+void cal_dbus_complete_replace_vcalendars (
+ calDbus *object,
+ GDBusMethodInvocation *invocation,
+ gint ret,
+ gint version);
+
+
+
+/* D-Bus method calls: */
+void cal_dbus_call_register_resource (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_register_resource_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_register_resource_sync (
+ calDbus *proxy,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_unregister_resource (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_unregister_resource_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_unregister_resource_sync (
+ calDbus *proxy,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_insert_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_insert_record_finish (
+ calDbus *proxy,
+ gint *out_id,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_insert_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint *out_id,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_update_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_update_record_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_update_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_delete_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_delete_record_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_delete_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_replace_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint arg_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_replace_record_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_replace_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_record,
+ gint arg_id,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_insert_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_insert_records_finish (
+ calDbus *proxy,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_insert_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_update_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_update_records_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_update_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_delete_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GVariant *arg_ids,
+ gint arg_count,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_delete_records_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_delete_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GVariant *arg_ids,
+ gint arg_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_replace_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant *arg_ids,
+ gint arg_count,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_replace_records_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_replace_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_list,
+ GVariant *arg_ids,
+ gint arg_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_record (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_record_finish (
+ calDbus *proxy,
+ GVariant **out_record,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_record_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_id,
+ GVariant **out_record,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_all_records (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_offset,
+ gint arg_limit,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_all_records_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_all_records_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_offset,
+ gint arg_limit,
+ GVariant **out_list,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_records_with_query (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint arg_offset,
+ gint arg_limit,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_records_with_query_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_records_with_query_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint arg_offset,
+ gint arg_limit,
+ GVariant **out_list,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_count (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_count_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ gint *out_count,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_count_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint *out_ret,
+ gint *out_count,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_count_with_query (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_count_with_query_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ gint *out_count,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_count_with_query_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GVariant *arg_query,
+ gint *out_ret,
+ gint *out_count,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_current_version (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_current_version_finish (
+ calDbus *proxy,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_current_version_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_add_changed_cb (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_add_changed_cb_finish (
+ calDbus *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_add_changed_cb_sync (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_remove_changed_cb (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_remove_changed_cb_finish (
+ calDbus *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_remove_changed_cb_sync (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_changes_by_version (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_book_id,
+ gint arg_db_version,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_changes_by_version_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_changes_by_version_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_book_id,
+ gint arg_db_version,
+ GVariant **out_list,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_last_change_version (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_last_change_version_finish (
+ calDbus *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_last_change_version_sync (
+ calDbus *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_get_changes_exception_by_version (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_parent_id,
+ gint arg_db_version,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_get_changes_exception_by_version_finish (
+ calDbus *proxy,
+ GVariant **out_list,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_get_changes_exception_by_version_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_view_uri,
+ gint arg_parent_id,
+ gint arg_db_version,
+ GVariant **out_list,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_clean_after_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ gint arg_book_id,
+ gint arg_db_version,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_clean_after_sync_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_clean_after_sync_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ gint arg_book_id,
+ gint arg_db_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_insert_vcalendars (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_insert_vcalendars_finish (
+ calDbus *proxy,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_insert_vcalendars_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant **out_ids,
+ gint *out_count,
+ gint *out_version,
+ gint *out_ret,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_call_replace_vcalendars (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant *arg_ids,
+ gint arg_count,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean cal_dbus_call_replace_vcalendars_finish (
+ calDbus *proxy,
+ gint *out_ret,
+ gint *out_version,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean cal_dbus_call_replace_vcalendars_sync (
+ calDbus *proxy,
+ GVariant *arg_handle,
+ const gchar *arg_stream,
+ GVariant *arg_ids,
+ gint arg_count,
+ gint *out_ret,
+ gint *out_version,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* ---- */
+
+#define CAL_TYPE_DBUS_PROXY (cal_dbus_proxy_get_type ())
+#define CAL_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAL_TYPE_DBUS_PROXY, calDbusProxy))
+#define CAL_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAL_TYPE_DBUS_PROXY, calDbusProxyClass))
+#define CAL_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CAL_TYPE_DBUS_PROXY, calDbusProxyClass))
+#define CAL_IS_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAL_TYPE_DBUS_PROXY))
+#define CAL_IS_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CAL_TYPE_DBUS_PROXY))
+
+typedef struct _calDbusProxy calDbusProxy;
+typedef struct _calDbusProxyClass calDbusProxyClass;
+typedef struct _calDbusProxyPrivate calDbusProxyPrivate;
+
+struct _calDbusProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ calDbusProxyPrivate *priv;
+};
+
+struct _calDbusProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType cal_dbus_proxy_get_type (void) G_GNUC_CONST;
+
+void cal_dbus_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+calDbus *cal_dbus_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+calDbus *cal_dbus_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void cal_dbus_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+calDbus *cal_dbus_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+calDbus *cal_dbus_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define CAL_TYPE_DBUS_SKELETON (cal_dbus_skeleton_get_type ())
+#define CAL_DBUS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAL_TYPE_DBUS_SKELETON, calDbusSkeleton))
+#define CAL_DBUS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAL_TYPE_DBUS_SKELETON, calDbusSkeletonClass))
+#define CAL_DBUS_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CAL_TYPE_DBUS_SKELETON, calDbusSkeletonClass))
+#define CAL_IS_DBUS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAL_TYPE_DBUS_SKELETON))
+#define CAL_IS_DBUS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CAL_TYPE_DBUS_SKELETON))
+
+typedef struct _calDbusSkeleton calDbusSkeleton;
+typedef struct _calDbusSkeletonClass calDbusSkeletonClass;
+typedef struct _calDbusSkeletonPrivate calDbusSkeletonPrivate;
+
+struct _calDbusSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ calDbusSkeletonPrivate *priv;
+};
+
+struct _calDbusSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType cal_dbus_skeleton_get_type (void) G_GNUC_CONST;
+
+calDbus *cal_dbus_skeleton_new (void);
+
+
+G_END_DECLS
+
+#endif /* __CAL_DBUS_H__ */
--- /dev/null
+<node>
+ <interface name="org.tizen.calendar_service.dbus">
+ <method name="register_resource">
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="unregister_resource">
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="insert_record">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(iv)" name="record" direction="in"/>
+ <arg type="i" name="id" direction="out"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="update_record">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(iv)" name="record" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="delete_record">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="i" name="id" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="replace_record">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(iv)" name="record" direction="in"/>
+ <arg type="i" name="id" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="insert_records">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(iv)" name="list" direction="in"/>
+ <arg type="ai" name="ids" direction="out"/>
+ <arg type="i" name="count" direction="out"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="update_records">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(iv)" name="list" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="delete_records">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="ai" name="ids" direction="in"/>
+ <arg type="i" name="count" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="replace_records">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(iv)" name="list" direction="in"/>
+ <arg type="ai" name="ids" direction="in"/>
+ <arg type="i" name="count" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="get_record">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="i" name="id" direction="in"/>
+ <arg type="(iv)" name="record" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="get_all_records">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="i" name="offset" direction="in"/>
+ <arg type="i" name="limit" direction="in"/>
+ <arg type="(iv)" name="list" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="get_records_with_query">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(siviviii)" name="query" direction="in"/>
+ <arg type="i" name="offset" direction="in"/>
+ <arg type="i" name="limit" direction="in"/>
+ <arg type="(iv)" name="list" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="get_count">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="i" name="ret" direction="out"/>
+ <arg type="i" name="count" direction="out"/>
+ </method>
+ <method name="get_count_with_query">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="(siviviii)" name="query" direction="in"/>
+ <arg type="i" name="ret" direction="out"/>
+ <arg type="i" name="count" direction="out"/>
+ </method>
+ <method name="get_current_version">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="add_changed_cb">
+ </method>
+ <method name="remove_changed_cb">
+ </method>
+ <method name="get_changes_by_version">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="i" name="book_id" direction="in"/>
+ <arg type="i" name="db_version" direction="in"/>
+ <arg type="(iv)" name="list" direction="out"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="get_last_change_version">
+ </method>
+ <method name="get_changes_exception_by_version">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="view_uri" direction="in"/>
+ <arg type="i" name="parent_id" direction="in"/>
+ <arg type="i" name="db_version" direction="in"/>
+ <arg type="(iv)" name="list" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="clean_after_sync">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="i" name="book_id" direction="in"/>
+ <arg type="i" name="db_version" direction="in"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="insert_vcalendars">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="stream" direction="in"/>
+ <arg type="ai" name="ids" direction="out"/>
+ <arg type="i" name="count" direction="out"/>
+ <arg type="i" name="version" direction="out"/>
+ <arg type="i" name="ret" direction="out"/>
+ </method>
+ <method name="replace_vcalendars">
+ <arg type="(ii)" name="handle" direction="in"/>
+ <arg type="s" name="stream" direction="in"/>
+ <arg type="ai" name="ids" direction="in"/>
+ <arg type="i" name="count" direction="in"/>
+ <arg type="i" name="ret" direction="out"/>
+ <arg type="i" name="version" direction="out"/>
+ </method>
+ </interface>
+</node>
+
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+
+#include "calendar.h"
+#include "cal_view.h"
+#include "cal_internal.h"
+#include "cal_typedef.h"
+#include "cal_handle.h"
+#include "cal_utils.h"
+
+#define CAL_DBUS_SET_STRING(x) (x) ? x : ""
+#define CAL_DBUS_GET_STRING(x) do { \
+ x = (NULL != x && '\0' != *x) ? strdup(x) : NULL; \
+} while(0)
+
+GVariant *cal_dbus_utils_null_to_gvariant(void)
+{
+ GVariant *value = NULL;
+ value = g_variant_new("(s)", "");
+ return value;
+}
+
+GVariant *cal_dbus_utils_common_to_gvariant(cal_record_s *rec)
+{
+ GVariant *value = NULL;
+ value = g_variant_new("(isuasy)",
+ rec->type,
+ CAL_DBUS_SET_STRING(rec->view_uri),
+ rec->properties_max_count,
+ CAL_DBUS_SET_STRING(rec->properties_flags),
+ rec->property_flag);
+ return value;
+}
+
+GVariant *cal_dbus_utils_handle_to_gvariant(calendar_h handle)
+{
+ GVariant *value = NULL;
+ cal_s *p = (cal_s *)handle;
+ value = g_variant_new("(ii)",
+ p->version, p->connection_count);
+ return value;
+}
+
+static GVariant *_caltime_to_gvariant(calendar_time_s *ct)
+{
+ GVariant *value = NULL;
+ switch (ct->type) {
+ case CALENDAR_TIME_UTIME:
+ value = g_variant_new("(x)", ct->time.utime);
+ break;
+ case CALENDAR_TIME_LOCALTIME:
+ value = g_variant_new("(iiiiii)",
+ ct->time.date.year, ct->time.date.month, ct->time.date.mday,
+ ct->time.date.hour, ct->time.date.minute, ct->time.date.second);
+ break;
+ }
+ return value;
+}
+
+static int _gvariant_to_caltime(int type, GVariant *arg_caltime, calendar_time_s *ct)
+{
+ switch (type) {
+ case CALENDAR_TIME_UTIME:
+ g_variant_get(arg_caltime, "(x)", &ct->time.utime);
+ break;
+ case CALENDAR_TIME_LOCALTIME:
+ g_variant_get(arg_caltime, "(iiiiii)",
+ &ct->time.date.year, &ct->time.date.month, &ct->time.date.mday,
+ &ct->time.date.hour, &ct->time.date.minute, &ct->time.date.second);
+ break;
+ }
+ return CALENDAR_ERROR_NONE;
+}
+
+GVariant *cal_dbus_utils_ids_to_gvariant(int *ids, int count)
+{
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ai"));
+
+ int i;
+ for (i = 0; i < count; i++)
+ g_variant_builder_add(&builder, "i", ids[i]);
+
+ return g_variant_builder_end(&builder);
+}
+
+static GVariant *_attr_value_to_gvariant(cal_attribute_filter_s *p)
+{
+ GVariant *value = NULL;
+
+ switch (p->filter_type) {
+ case CAL_FILTER_STR:
+ value = g_variant_new("s", CAL_DBUS_SET_STRING(p->value.s));
+ break;
+ case CAL_FILTER_INT:
+ value = g_variant_new("i", p->value.i);
+ break;
+ case CAL_FILTER_DOUBLE:
+ value = g_variant_new("d", p->value.d);
+ break;
+ case CAL_FILTER_LLI:
+ value = g_variant_new("x", p->value.lli);
+ break;
+ case CAL_FILTER_CALTIME:
+ value = g_variant_new("(iv)", p->value.caltime.type,
+ _caltime_to_gvariant(&p->value.caltime));
+ break;
+ default:
+ ERR("Invalid parameter(0x%x)", p->property_id);
+ break;
+ }
+ return value;
+}
+
+static GVariant *_composite_to_gvariant(cal_composite_filter_s *filter)
+{
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a(isiv)"));
+
+ int has_composite = 0;
+ cal_composite_filter_s *f = filter;
+ do {
+ has_composite = 0;
+ int count_composite = 0;
+ GVariant *arg_composite = NULL;
+ if (f->filters) {
+ count_composite = g_slist_length(f->filters);
+ GSList *cursor = f->filters;
+
+ int is_error = 0;
+ GVariantBuilder builder_attribute;
+ g_variant_builder_init(&builder_attribute, G_VARIANT_TYPE("a(iiiv)"));
+ while (cursor) {
+ cal_filter_s *child = cursor->data;
+ if (NULL == child) {
+ ERR("child is NULL");
+ is_error = 1;
+ break;
+ }
+
+ if (CAL_FILTER_COMPOSITE == child->filter_type) {
+ has_composite = 1;
+ f = (cal_composite_filter_s *)child;
+ break;
+ }
+
+ cal_attribute_filter_s *attr = (cal_attribute_filter_s *)child;
+ GVariant *arg_attr_value = _attr_value_to_gvariant(attr);
+ g_variant_builder_add(&builder_attribute, "(iiiv)",
+ attr->filter_type, attr->property_id, attr->match, arg_attr_value);
+
+ cursor = g_slist_next(cursor);
+ }
+
+ if (1 == is_error) {
+ count_composite = 0;
+ arg_composite = cal_dbus_utils_null_to_gvariant();
+ }
+ else {
+ arg_composite = g_variant_builder_end(&builder_attribute);
+ }
+ }
+ else {
+ arg_composite = cal_dbus_utils_null_to_gvariant();
+ }
+
+ g_variant_builder_add(&builder, "(isiv)",
+ f->filter_type, f->view_uri, count_composite, arg_composite);
+ } while (1 == has_composite);
+
+ return g_variant_builder_end(&builder);
+}
+
+static GVariant *_operate_to_gvariant(cal_composite_filter_s *f, int *out_count)
+{
+ int count_operate = 0;
+ GVariant *arg_operate = NULL;
+ if (f->filter_ops) {
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ai"));
+
+ count_operate = g_slist_length(f->filter_ops);
+ GSList *cursor = f->filter_ops;
+ while (cursor) {
+ calendar_filter_operator_e operate = (calendar_filter_operator_e)cursor->data;
+ g_variant_builder_add(&builder, "i", operate);
+ cursor = g_slist_next(cursor);
+ }
+ arg_operate = g_variant_builder_end(&builder);
+ }
+ else {
+ arg_operate = cal_dbus_utils_null_to_gvariant();
+ }
+ *out_count = count_operate;
+
+ return arg_operate;
+}
+
+static GVariant *_filter_to_gvariant(cal_composite_filter_s *f)
+{
+ GVariant *arg_composite_pack = NULL;
+ if (f->filters) {
+ arg_composite_pack = _composite_to_gvariant(f);
+ }
+ else {
+ arg_composite_pack = cal_dbus_utils_null_to_gvariant();
+ }
+
+ int count_operate = 0;
+ GVariant *arg_operate = NULL;
+ if (f->filter_ops) {
+ arg_operate = _operate_to_gvariant(f, &count_operate);
+ }
+ else {
+ arg_operate = cal_dbus_utils_null_to_gvariant();
+ }
+
+ GVariant *value = NULL;
+ value = g_variant_new("(viv)",
+ arg_composite_pack, count_operate, arg_operate);
+ return value;
+}
+
+static GVariant *_projection_to_gvariant(cal_query_s *p)
+{
+ int i;
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("au"));
+ for (i = 0; i < p->projection_count; i++) {
+ g_variant_builder_add(&builder, "u", p->projection[i]);
+ }
+ return g_variant_builder_end(&builder);
+}
+
+GVariant *cal_dbus_utils_query_to_gvariant(calendar_query_h query)
+{
+ RETV_IF(NULL == query, NULL);
+
+ cal_query_s *q = (cal_query_s *)query;
+ int has_filter = 0;
+ GVariant *arg_filter = NULL;
+ if (q->filter) {
+ has_filter = 1;
+ arg_filter = _filter_to_gvariant(q->filter);
+ }
+ else {
+ has_filter = 0;
+ arg_filter = cal_dbus_utils_null_to_gvariant();
+ }
+
+ GVariant *arg_projection = NULL;
+ if (q->projection_count) {
+ arg_projection = _projection_to_gvariant(q);
+ }
+ else {
+ arg_projection = cal_dbus_utils_null_to_gvariant();
+ }
+
+ GVariant *value = NULL;
+ value = g_variant_new("(siviviii)",
+ CAL_DBUS_SET_STRING(q->view_uri), has_filter, arg_filter,
+ q->projection_count, arg_projection,
+ q->sort_property_id, (int)q->asc, (int)q->distinct);
+
+ return value;
+}
+
+
+static GVariant *_book_to_gvariant(calendar_record_h record)
+{
+ RETV_IF(NULL == record, NULL);
+
+ GVariant *value = NULL;
+ cal_book_s *p = (cal_book_s *)record;
+ value = g_variant_new("(iisissssiiiissssi)",
+ p->index, p->store_type,
+ CAL_DBUS_SET_STRING(p->uid),
+ p->updated,
+ CAL_DBUS_SET_STRING(p->name),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->color),
+ CAL_DBUS_SET_STRING(p->location),
+ p->visibility, p->sync_event, p->is_deleted, p->account_id,
+ CAL_DBUS_SET_STRING(p->sync_data1),
+ CAL_DBUS_SET_STRING(p->sync_data2),
+ CAL_DBUS_SET_STRING(p->sync_data3),
+ CAL_DBUS_SET_STRING(p->sync_data4),
+ p->mode);
+ return value;
+}
+
+static GVariant *_only_event_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_event_s *p = (cal_event_s *)record;
+ RETV_IF(NULL == record, NULL);
+
+ GVariant *arg_until = _caltime_to_gvariant(&p->until);
+ GVariant *arg_start = _caltime_to_gvariant(&p->start);
+ GVariant *arg_end = _caltime_to_gvariant(&p->end);
+
+ value = g_variant_new("(iisssssiiiiiiisssiddixixiiiviisssssssssissiiiissssivsivsi)",
+ p->index, p->calendar_id,
+ CAL_DBUS_SET_STRING(p->summary),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->location),
+ CAL_DBUS_SET_STRING(p->categories),
+ CAL_DBUS_SET_STRING(p->exdate),
+ p->event_status, p->priority, p->timezone, p->contact_id, p->busy_status,
+ p->sensitivity, p->meeting_status,
+ CAL_DBUS_SET_STRING(p->uid),
+ CAL_DBUS_SET_STRING(p->organizer_name),
+ CAL_DBUS_SET_STRING(p->organizer_email),
+ p->original_event_id, p->latitude, p->longitude, p->email_id,
+ p->created_time, p->is_deleted, p->last_mod, p->freq, p->range_type,
+ p->until.type, arg_until, p->count, p->interval,
+ CAL_DBUS_SET_STRING(p->bysecond),
+ CAL_DBUS_SET_STRING(p->byminute),
+ CAL_DBUS_SET_STRING(p->byhour),
+ CAL_DBUS_SET_STRING(p->byday),
+ CAL_DBUS_SET_STRING(p->bymonthday),
+ CAL_DBUS_SET_STRING(p->byyearday),
+ CAL_DBUS_SET_STRING(p->byweekno),
+ CAL_DBUS_SET_STRING(p->bymonth),
+ CAL_DBUS_SET_STRING(p->bysetpos),
+ p->wkst,
+ CAL_DBUS_SET_STRING(p->recurrence_id),
+ CAL_DBUS_SET_STRING(p->rdate),
+ p->has_attendee, p->has_alarm, p->system_type, p->updated,
+ CAL_DBUS_SET_STRING(p->sync_data1),
+ CAL_DBUS_SET_STRING(p->sync_data2),
+ CAL_DBUS_SET_STRING(p->sync_data3),
+ CAL_DBUS_SET_STRING(p->sync_data4),
+ p->start.type, arg_start,
+ CAL_DBUS_SET_STRING(p->start_tzid),
+ p->end.type, arg_end,
+ CAL_DBUS_SET_STRING(p->end_tzid),
+ p->is_allday);
+ return value;
+}
+
+static GVariant *_alarm_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_alarm_s *p = (cal_alarm_s *)record;
+ GVariant *arg_alarm = _caltime_to_gvariant(&p->alarm);
+ value = g_variant_new("(iiiiissisiv)",
+ p->id, p->parent_id, p->is_deleted, p->remind_tick, p->remind_tick_unit,
+ CAL_DBUS_SET_STRING(p->alarm_description),
+ CAL_DBUS_SET_STRING(p->alarm_summary),
+ p->alarm_action,
+ CAL_DBUS_SET_STRING(p->alarm_attach),
+ p->alarm.type, arg_alarm);
+ return value;
+}
+
+static GVariant *_attendee_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_attendee_s *p = (cal_attendee_s *)record;
+ value = g_variant_new("(iisiisssiiissss)",
+ p->id, p->parent_id,
+ CAL_DBUS_SET_STRING(p->attendee_number),
+ p->attendee_cutype, p->attendee_ct_index,
+ CAL_DBUS_SET_STRING(p->attendee_uid),
+ CAL_DBUS_SET_STRING(p->attendee_group),
+ CAL_DBUS_SET_STRING(p->attendee_email),
+ p->attendee_role, p->attendee_status, p->attendee_rsvp,
+ CAL_DBUS_SET_STRING(p->attendee_delegatee_uri),
+ CAL_DBUS_SET_STRING(p->attendee_delegator_uri),
+ CAL_DBUS_SET_STRING(p->attendee_name),
+ CAL_DBUS_SET_STRING(p->attendee_member));
+ return value;
+}
+
+static GVariant *_timezone_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_timezone_s *p = (cal_timezone_s *)record;
+ value = g_variant_new("(iisiiiiisiiiiii)",
+ p->index, p->tz_offset_from_gmt,
+ CAL_DBUS_SET_STRING(p->standard_name),
+ p->std_start_month, p->std_start_position_of_week, p->std_start_day,
+ p->std_start_hour, p->standard_bias,
+ CAL_DBUS_SET_STRING(p->day_light_name),
+ p->day_light_start_month, p->day_light_start_position_of_week,
+ p->day_light_start_day, p->day_light_start_hour, p->day_light_bias,
+ p->calendar_id);
+ return value;
+}
+
+static GVariant *_extended_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_extended_s *p = (cal_extended_s *)record;
+ value = g_variant_new("(iiiss)",
+ p->id, p->record_id, p->record_type,
+ CAL_DBUS_SET_STRING(p->key),
+ CAL_DBUS_SET_STRING(p->value));
+ return value;
+}
+
+static GVariant *_event_to_gvariant(calendar_record_h record)
+{
+ int i;
+ RETV_IF(NULL == record, NULL);
+
+ GVariant *arg_only_event = _only_event_to_gvariant(record);
+ if (NULL == arg_only_event) {
+ ERR("_only_event_to_gvariant() Fail");
+ return NULL;
+ }
+
+ unsigned int count_alarm = 0;
+ GVariantBuilder builder_alarm;
+ g_variant_builder_init(&builder_alarm, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_event.calendar_alarm, &count_alarm);
+ if (0 < count_alarm) {
+ for (i = 0 ; i < count_alarm; i++) {
+ calendar_record_h alarm = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_event.calendar_alarm, i, &alarm);
+ g_variant_builder_add(&builder_alarm, "v", _alarm_to_gvariant(alarm));
+ }
+ }
+ else {
+ DBG("No alarm");
+ g_variant_builder_add(&builder_alarm, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+ unsigned int count_attendee = 0;
+ GVariantBuilder builder_attendee;
+ g_variant_builder_init(&builder_attendee, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_event.calendar_attendee, &count_attendee);
+ if (0 < count_attendee) {
+ for (i = 0 ; i < count_attendee; i++) {
+ calendar_record_h attendee = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_event.calendar_attendee, i, &attendee);
+ g_variant_builder_add(&builder_attendee, "v", _attendee_to_gvariant(attendee));
+ }
+ }
+ else {
+ DBG("No attendee");
+ g_variant_builder_add(&builder_attendee, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+ unsigned int count_exception = 0;
+ GVariantBuilder builder_exception;
+ g_variant_builder_init(&builder_exception, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_event.exception, &count_exception);
+ if (0 < count_exception) {
+ for (i = 0 ; i < count_exception; i++) {
+ calendar_record_h exception = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_event.exception, i, &exception);
+ g_variant_builder_add(&builder_exception, "v", _only_event_to_gvariant(exception));
+ }
+ }
+ else {
+ DBG("No exception");
+ g_variant_builder_add(&builder_exception, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+ unsigned int count_extended = 0;
+ GVariantBuilder builder_extended;
+ g_variant_builder_init(&builder_extended, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_event.extended, &count_extended);
+ if (0 < count_extended) {
+ for (i = 0 ; i < count_extended; i++) {
+ calendar_record_h extended = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_event.extended, i, &extended);
+ g_variant_builder_add(&builder_extended, "v", _extended_to_gvariant(extended));
+ }
+ }
+ else {
+ DBG("No extended");
+ g_variant_builder_add(&builder_extended, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+ GVariant *value = NULL;
+ value = g_variant_new("(viaviaviaviav)", arg_only_event,
+ count_alarm, &builder_alarm, count_attendee, &builder_attendee,
+ count_exception, &builder_exception, count_extended, &builder_extended);
+
+ return value;
+}
+
+static GVariant *_only_todo_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ RETV_IF(NULL == record, NULL);
+
+ cal_todo_s *p = (cal_todo_s *)record;
+ GVariant *arg_until = _caltime_to_gvariant(&p->until);
+ GVariant *arg_start = _caltime_to_gvariant(&p->start);
+ GVariant *arg_due = _caltime_to_gvariant(&p->due);
+
+ value = g_variant_new("(iissssiiisddxxiixiiiviisssssssssiiiissssivsivsssii)",
+ p->index, p->calendar_id,
+ CAL_DBUS_SET_STRING(p->summary),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->location),
+ CAL_DBUS_SET_STRING(p->categories),
+ p->todo_status, p->priority, p->sensitivity,
+ CAL_DBUS_SET_STRING(p->uid),
+ p->latitude, p->longitude, p->created_time, p->completed_time, p->progress,
+ p->is_deleted, p->last_mod, p->freq, p->range_type, p->until.type,
+ arg_until, p->count, p->interval,
+ CAL_DBUS_SET_STRING(p->bysecond),
+ CAL_DBUS_SET_STRING(p->byminute),
+ CAL_DBUS_SET_STRING(p->byhour),
+ CAL_DBUS_SET_STRING(p->byday),
+ CAL_DBUS_SET_STRING(p->bymonthday),
+ CAL_DBUS_SET_STRING(p->byyearday),
+ CAL_DBUS_SET_STRING(p->byweekno),
+ CAL_DBUS_SET_STRING(p->bymonth),
+ CAL_DBUS_SET_STRING(p->bysetpos),
+ p->wkst, p->has_alarm, p->system_type, p->updated,
+ CAL_DBUS_SET_STRING(p->sync_data1),
+ CAL_DBUS_SET_STRING(p->sync_data2),
+ CAL_DBUS_SET_STRING(p->sync_data3),
+ CAL_DBUS_SET_STRING(p->sync_data4),
+ p->start.type, arg_start,
+ CAL_DBUS_SET_STRING(p->start_tzid),
+ p->due.type, arg_due,
+ CAL_DBUS_SET_STRING(p->due_tzid),
+ CAL_DBUS_SET_STRING(p->organizer_name),
+ CAL_DBUS_SET_STRING(p->organizer_email),
+ p->has_attendee, p->is_allday);
+
+ return value;
+}
+
+static GVariant *_todo_to_gvariant(calendar_record_h record)
+{
+ int i;
+ RETV_IF(NULL == record, NULL);
+
+ GVariant *arg_only_todo = _only_todo_to_gvariant(record);
+ if (NULL == arg_only_todo) {
+ ERR("_only_todo_to_gvariant() Fail");
+ return NULL;
+ }
+
+ unsigned int count_alarm = 0;
+ GVariantBuilder builder_alarm;
+ g_variant_builder_init(&builder_alarm, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_todo.calendar_alarm, &count_alarm);
+ if (0 < count_alarm) {
+ for (i = 0 ; i < count_alarm; i++) {
+ calendar_record_h alarm = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_todo.calendar_alarm, i, &alarm);
+ g_variant_builder_add(&builder_alarm, "v", _alarm_to_gvariant(alarm));
+ }
+ }
+ else {
+ DBG("No alarm");
+ g_variant_builder_add(&builder_alarm, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+ unsigned int count_attendee = 0;
+ GVariantBuilder builder_attendee;
+ g_variant_builder_init(&builder_attendee, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_todo.calendar_attendee, &count_attendee);
+ if (0 < count_attendee) {
+ for (i = 0 ; i < count_attendee; i++) {
+ calendar_record_h attendee = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_todo.calendar_attendee, i, &attendee);
+ g_variant_builder_add(&builder_attendee, "v", _attendee_to_gvariant(attendee));
+ }
+ }
+ else {
+ DBG("No attendee");
+ g_variant_builder_add(&builder_attendee, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+ unsigned int count_extended = 0;
+ GVariantBuilder builder_extended;
+ g_variant_builder_init(&builder_extended, G_VARIANT_TYPE("av"));
+ calendar_record_get_child_record_count(record, _calendar_todo.extended, &count_extended);
+ if (0 < count_extended) {
+ for (i = 0 ; i < count_extended; i++) {
+ calendar_record_h extended = NULL;
+ calendar_record_get_child_record_at_p(record, _calendar_todo.extended, i, &extended);
+ g_variant_builder_add(&builder_extended, "v", _extended_to_gvariant(extended));
+ }
+ }
+ else {
+ DBG("No extended");
+ g_variant_builder_add(&builder_extended, "v", cal_dbus_utils_null_to_gvariant());
+ }
+
+
+ GVariant *value = NULL;
+ value = g_variant_new("(viaviaviav)", arg_only_todo,
+ count_alarm, &builder_alarm, count_attendee, &builder_attendee,
+ count_extended, &builder_extended);
+
+ return value;
+}
+
+static GVariant *_instance_normal_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_instance_normal_s *p = (cal_instance_normal_s *)record;
+
+ GVariant *arg_start = _caltime_to_gvariant(&p->start);
+ GVariant *arg_end = _caltime_to_gvariant(&p->end);
+
+ value = g_variant_new("(iiivivsssiiiiiddiixs)",
+ p->event_id, p->calendar_id, p->start.type, arg_start, p->end.type, arg_end,
+ CAL_DBUS_SET_STRING(p->summary),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->location),
+ p->busy_status, p->event_status, p->priority, p->sensitivity, p->has_rrule,
+ p->latitude, p->longitude, p->has_alarm, p->original_event_id, p->last_mod,
+ CAL_DBUS_SET_STRING(p->sync_data1));
+ return value;
+}
+
+static GVariant *_instance_allday_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_instance_allday_s *p = (cal_instance_allday_s *)record;
+
+ GVariant *arg_start = _caltime_to_gvariant(&p->start);
+ GVariant *arg_end = _caltime_to_gvariant(&p->end);
+
+ value = g_variant_new("(iiivivsssiiiiiddiixsi)",
+ p->event_id, p->calendar_id, p->start.type, arg_start, p->end.type, arg_end,
+ CAL_DBUS_SET_STRING(p->summary),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->location),
+ p->busy_status, p->event_status, p->priority, p->sensitivity, p->has_rrule,
+ p->latitude, p->longitude, p->has_alarm, p->original_event_id, p->last_mod,
+ CAL_DBUS_SET_STRING(p->sync_data1),
+ p->is_allday);
+ return value;
+}
+
+static GVariant *_instance_normal_extended_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_instance_normal_extended_s *p = (cal_instance_normal_extended_s *)record;
+
+ GVariant *arg_start = _caltime_to_gvariant(&p->start);
+ GVariant *arg_end = _caltime_to_gvariant(&p->end);
+
+ value = g_variant_new("(iiivivsssiiiiiddiixssissss)",
+ p->event_id, p->calendar_id, p->start.type, arg_start, p->end.type, arg_end,
+ CAL_DBUS_SET_STRING(p->summary),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->location),
+ p->busy_status, p->event_status, p->priority, p->sensitivity, p->has_rrule,
+ p->latitude, p->longitude, p->has_alarm, p->original_event_id, p->last_mod,
+ CAL_DBUS_SET_STRING(p->organizer_name),
+ CAL_DBUS_SET_STRING(p->categories),
+ p->has_attendee,
+ CAL_DBUS_SET_STRING(p->sync_data1),
+ CAL_DBUS_SET_STRING(p->sync_data2),
+ CAL_DBUS_SET_STRING(p->sync_data3),
+ CAL_DBUS_SET_STRING(p->sync_data4));
+ return value;
+}
+
+static GVariant *_instance_allday_extended_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_instance_allday_extended_s *p = (cal_instance_allday_extended_s *)record;
+
+ GVariant *arg_start = _caltime_to_gvariant(&p->start);
+ GVariant *arg_end = _caltime_to_gvariant(&p->end);
+
+ value = g_variant_new("(iiivivsssiiiiiddiixssissss)",
+ p->event_id, p->calendar_id, p->start.type, arg_start, p->end.type, arg_end,
+ CAL_DBUS_SET_STRING(p->summary),
+ CAL_DBUS_SET_STRING(p->description),
+ CAL_DBUS_SET_STRING(p->location),
+ p->busy_status, p->event_status,
+ p->priority, p->sensitivity, p->has_rrule, p->latitude, p->longitude,
+ p->has_alarm, p->original_event_id, p->last_mod,
+ CAL_DBUS_SET_STRING(p->organizer_name),
+ CAL_DBUS_SET_STRING(p->categories),
+ p->has_attendee,
+ CAL_DBUS_SET_STRING(p->sync_data1),
+ CAL_DBUS_SET_STRING(p->sync_data2),
+ CAL_DBUS_SET_STRING(p->sync_data3),
+ CAL_DBUS_SET_STRING(p->sync_data4));
+ return value;
+}
+
+static GVariant *_updated_info_to_gvariant(calendar_record_h record)
+{
+ GVariant *value = NULL;
+ cal_updated_info_s *p = (cal_updated_info_s *)record;
+ value = g_variant_new("(iiii)", p->type, p->id, p->calendar_id, p->version);
+ return value;
+}
+
+static GVariant *_value_to_gvariant(cal_search_value_s *p)
+{
+ GVariant *value = NULL;
+
+ switch (p->property_id) {
+ case CAL_PROPERTY_DATA_TYPE_STR:
+ value = g_variant_new("s", CAL_DBUS_SET_STRING(p->value.s));
+ break;
+ case CAL_PROPERTY_DATA_TYPE_INT:
+ value = g_variant_new("i", p->value.i);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_DOUBLE:
+ value = g_variant_new("d", p->value.d);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_LLI:
+ value = g_variant_new("x", p->value.lli);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_CALTIME:
+ value = _caltime_to_gvariant(&p->value.caltime);
+ break;
+ default:
+ ERR("Invalid parameter(0x%x)", p->property_id);
+ break;
+ }
+ return value;
+}
+
+static GVariant *_search_to_gvariant(calendar_record_h record)
+{
+ GVariantBuilder builder;
+
+ cal_search_s *p = (cal_search_s *)record;
+ if (p->values) {
+ g_variant_builder_init(&builder, (G_VARIANT_TYPE("ia(iv)")));
+
+ int count = g_slist_length(p->values);
+ g_variant_builder_add(&builder, "i", count);
+
+ GSList *cursor = p->values;
+ while (cursor) {
+ cal_search_value_s * d = (cal_search_value_s *)(cursor->data);
+ GVariant *arg_value = _value_to_gvariant(d);
+ g_variant_builder_add(&builder, "iv", d->property_id, arg_value);
+ cursor = g_slist_next(cursor);
+ }
+ }
+ else {
+ g_variant_builder_init(&builder, (G_VARIANT_TYPE("i")));
+ g_variant_builder_add(&builder, "i", 0);
+ }
+
+ return g_variant_builder_end(&builder);
+}
+
+GVariant *cal_dbus_utils_record_to_gvariant(calendar_record_h record)
+{
+ int type = 0;
+ GVariant *value = NULL;
+ GVariant *arg_record = NULL;
+
+ if (NULL == record) {
+ ERR("record is NULL");
+ type = -1;
+ }
+ else {
+ cal_record_s *rec = (cal_record_s *)record;
+ type = rec->type;
+ }
+
+ switch (type) {
+ case CAL_RECORD_TYPE_CALENDAR:
+ arg_record = _book_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_EVENT:
+ arg_record = _event_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_TODO:
+ arg_record = _todo_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_ALARM:
+ arg_record = _alarm_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_ATTENDEE:
+ arg_record = _attendee_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_TIMEZONE:
+ arg_record = _timezone_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_NORMAL:
+ arg_record = _instance_normal_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_ALLDAY:
+ arg_record = _instance_allday_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_NORMAL_EXTENDED:
+ arg_record = _instance_normal_extended_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_ALLDAY_EXTENDED:
+ arg_record = _instance_allday_extended_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_UPDATED_INFO:
+ arg_record = _updated_info_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_SEARCH:
+ arg_record = _search_to_gvariant(record);
+ break;
+ case CAL_RECORD_TYPE_EXTENDED:
+ arg_record = _extended_to_gvariant(record);
+ break;
+ default:
+ ERR("Invalid type(%d)", type);
+ arg_record = cal_dbus_utils_null_to_gvariant();
+ break;
+ }
+ value = g_variant_new("(iv)", type, arg_record);
+ return value;
+}
+
+GVariant *cal_dbus_utils_list_to_gvariant(calendar_list_h list)
+{
+ int has_list = 0;
+ GVariant *value = NULL;
+ GVariant *arg_list = NULL;
+
+ if (NULL == list) {
+ ERR("list is NULL");
+ has_list = 0;
+ arg_list = cal_dbus_utils_null_to_gvariant();
+ return g_variant_new("(iv)", has_list, arg_list);
+ }
+
+ has_list = 1;
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("av"));
+
+ int i;
+ int count = 0;
+ calendar_list_get_count(list, &count);
+
+ calendar_list_first(list);
+ for (i = 0; i < count; i++) {
+ calendar_record_h record = NULL;
+ calendar_list_get_current_record_p(list, &record);
+ GVariant *arg_record = cal_dbus_utils_record_to_gvariant(record);
+ g_variant_builder_add(&builder, "v", arg_record);
+ calendar_list_next(list);
+ }
+ arg_list = g_variant_builder_end(&builder);
+
+ value = g_variant_new("(iv)", has_list, arg_list);
+ return value;
+}
+
+int cal_dbus_utils_gvariant_to_common(GVariant *arg_common, cal_record_s **rec)
+{
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_utils_gvariant_to_handle(GVariant *arg_handle, calendar_h *out_handle)
+{
+ RETV_IF(NULL == arg_handle, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_handle, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_h handle = NULL;
+ cal_handle_create(&handle);
+ if (NULL == handle) {
+ ERR("handle is NULL");
+ return CALENDAR_ERROR_OUT_OF_MEMORY;
+ }
+ cal_s *p = (cal_s *)handle;
+
+ g_variant_get(arg_handle, "(ii)",
+ &p->version, &p->connection_count);
+ *out_handle = handle;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_book(GVariant *arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_book._uri, &record);
+ cal_book_s *p = (cal_book_s *)record;
+
+ g_variant_get(arg_record, "(ii&si&s&s&s&siiii&s&s&s&si)",
+ &p->index, &p->store_type, &p->uid, &p->updated, &p->name, &p->description,
+ &p->color, &p->location, &p->visibility, &p->sync_event, &p->is_deleted,
+ &p->account_id, &p->sync_data1, &p->sync_data2, &p->sync_data3,
+ &p->sync_data4, &p->mode);
+ CAL_DBUS_GET_STRING(p->uid);
+ CAL_DBUS_GET_STRING(p->name);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->color);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+ CAL_DBUS_GET_STRING(p->sync_data2);
+ CAL_DBUS_GET_STRING(p->sync_data3);
+ CAL_DBUS_GET_STRING(p->sync_data4);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_alarm(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_alarm._uri, &record);
+ GVariant *arg_alarm = NULL;
+ cal_alarm_s *p = (cal_alarm_s *)record;
+ g_variant_get(arg_record, "(iiiii&s&si&siv)",
+ &p->id, &p->parent_id, &p->is_deleted, &p->remind_tick, &p->remind_tick_unit,
+ &p->alarm_description, &p->alarm_summary, &p->alarm_action, &p->alarm_attach,
+ &p->alarm.type, &arg_alarm);
+ _gvariant_to_caltime(p->alarm.type, arg_alarm, &p->alarm);
+ CAL_DBUS_GET_STRING(p->alarm_description);
+ CAL_DBUS_GET_STRING(p->alarm_summary);
+ CAL_DBUS_GET_STRING(p->alarm_attach);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_attendee(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_attendee._uri, &record);
+ cal_attendee_s *p = (cal_attendee_s *)record;
+ g_variant_get(arg_record, "(ii&sii&s&s&siii&s&s&s&s)",
+ &p->id, &p->parent_id, &p->attendee_number, &p->attendee_cutype,
+ &p->attendee_ct_index, &p->attendee_uid, &p->attendee_group,
+ &p->attendee_email, &p->attendee_role, &p->attendee_status,
+ &p->attendee_rsvp, &p->attendee_delegatee_uri, &p->attendee_delegator_uri,
+ &p->attendee_name, &p->attendee_member);
+ CAL_DBUS_GET_STRING(p->attendee_number);
+ CAL_DBUS_GET_STRING(p->attendee_uid);
+ CAL_DBUS_GET_STRING(p->attendee_group);
+ CAL_DBUS_GET_STRING(p->attendee_email);
+ CAL_DBUS_GET_STRING(p->attendee_delegatee_uri);
+ CAL_DBUS_GET_STRING(p->attendee_delegator_uri);
+ CAL_DBUS_GET_STRING(p->attendee_name);
+ CAL_DBUS_GET_STRING(p->attendee_member);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_timezone(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_timezone._uri, &record);
+ cal_timezone_s *p = (cal_timezone_s *)record;
+ g_variant_get(arg_record, "(ii&siiiii&siiiiii)",
+ &p->index, &p->tz_offset_from_gmt, &p->standard_name, &p->std_start_month,
+ &p->std_start_position_of_week, &p->std_start_day, &p->std_start_hour,
+ &p->standard_bias, &p->day_light_name, &p->day_light_start_month,
+ &p->day_light_start_position_of_week, &p->day_light_start_day,
+ &p->day_light_start_hour, &p->day_light_bias, &p->calendar_id);
+ CAL_DBUS_GET_STRING(p->standard_name);
+ CAL_DBUS_GET_STRING(p->day_light_name);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_only_event(GVariant *arg_record, calendar_record_h *out_record)
+{
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_event._uri, &record);
+ cal_event_s *p = (cal_event_s *)record;
+
+ GVariant *arg_until = NULL;
+ GVariant *arg_start= NULL;
+ GVariant *arg_end = NULL;
+
+ g_variant_get(arg_record, "(ii&s&s&s&s&siiiiiii&s&s&siddixixiiivii"
+ "&s&s&s&s&s&s&s&s&si&s&siiii&s&s&s&siv&siv&si)",
+ &p->index, &p->calendar_id, &p->summary, &p->description, &p->location,
+ &p->categories, &p->exdate, &p->event_status, &p->priority, &p->timezone,
+ &p->contact_id, &p->busy_status, &p->sensitivity, &p->meeting_status,
+ &p->uid, &p->organizer_name, &p->organizer_email, &p->original_event_id,
+ &p->latitude, &p->longitude, &p->email_id, &p->created_time, &p->is_deleted,
+ &p->last_mod, &p->freq, &p->range_type, &p->until.type, &arg_until,
+ &p->count, &p->interval, &p->bysecond, &p->byminute, &p->byhour, &p->byday,
+ &p->bymonthday, &p->byyearday, &p->byweekno, &p->bymonth, &p->bysetpos,
+ &p->wkst, &p->recurrence_id, &p->rdate, &p->has_attendee, &p->has_alarm,
+ &p->system_type, &p->updated, &p->sync_data1, &p->sync_data2, &p->sync_data3,
+ &p->sync_data4, &p->start.type, &arg_start, &p->start_tzid, &p->end.type,
+ &arg_end, &p->end_tzid, &p->is_allday);
+ _gvariant_to_caltime(p->until.type, arg_until, &p->until);
+ _gvariant_to_caltime(p->start.type, arg_start, &p->start);
+ _gvariant_to_caltime(p->end.type, arg_end, &p->end);
+ CAL_DBUS_GET_STRING(p->summary);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->categories);
+ CAL_DBUS_GET_STRING(p->exdate);
+ CAL_DBUS_GET_STRING(p->uid);
+ CAL_DBUS_GET_STRING(p->organizer_name);
+ CAL_DBUS_GET_STRING(p->organizer_email);
+ CAL_DBUS_GET_STRING(p->bysecond);
+ CAL_DBUS_GET_STRING(p->byminute);
+ CAL_DBUS_GET_STRING(p->byhour);
+ CAL_DBUS_GET_STRING(p->byday);
+ CAL_DBUS_GET_STRING(p->bymonthday);
+ CAL_DBUS_GET_STRING(p->byyearday);
+ CAL_DBUS_GET_STRING(p->byweekno);
+ CAL_DBUS_GET_STRING(p->bymonth);
+ CAL_DBUS_GET_STRING(p->bysetpos);
+ CAL_DBUS_GET_STRING(p->recurrence_id);
+ CAL_DBUS_GET_STRING(p->rdate);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+ CAL_DBUS_GET_STRING(p->sync_data2);
+ CAL_DBUS_GET_STRING(p->sync_data3);
+ CAL_DBUS_GET_STRING(p->sync_data4);
+ CAL_DBUS_GET_STRING(p->start_tzid);
+ CAL_DBUS_GET_STRING(p->end_tzid);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_value(GVariant *arg_value, cal_search_value_s *p)
+{
+ switch (p->property_id) {
+ case CAL_PROPERTY_DATA_TYPE_STR:
+ g_variant_get(arg_value, "&s", &p->value.s);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_INT:
+ g_variant_get(arg_value, "i", &p->value.i);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_DOUBLE:
+ g_variant_get(arg_value, "d", &p->value.d);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_LLI:
+ g_variant_get(arg_value, "x", &p->value.lli);
+ break;
+ case CAL_PROPERTY_DATA_TYPE_CALTIME:
+ g_variant_get(arg_value, "(ixiiiiiii)",
+ &p->value.caltime.type, &p->value.caltime.time.utime,
+ &p->value.caltime.time.date.year, &p->value.caltime.time.date.month,
+ &p->value.caltime.time.date.mday, &p->value.caltime.time.date.hour,
+ &p->value.caltime.time.date.minute, &p->value.caltime.time.date.second);
+ break;
+ default:
+ ERR("Invalid parameter(0x%x)", p->property_id);
+ break;
+ }
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_search(GVariant *arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ int count = 0;
+ GVariantIter *iter_value = NULL;
+ g_variant_get(arg_record, "ia(iv)", &count, &iter_value);
+ int value_count = g_variant_iter_n_children(iter_value);
+ if (0 != value_count) {
+ gboolean is_continue = FALSE;
+ do {
+ cal_search_value_s p = {0};
+ GVariant *arg_value = NULL;
+ is_continue = g_variant_iter_loop(iter_value, "(iv)",
+ &p.property_id, arg_value);
+ _gvariant_to_value(arg_value, &p);
+ } while (TRUE == is_continue);
+ g_variant_iter_free(iter_value);
+ }
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_extended(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_extended_property._uri, &record);
+ cal_extended_s *p = (cal_extended_s *)record;
+ g_variant_get(arg_record, "(iii&s&s)",
+ &p->id, &p->record_id, &p->record_type, &p->key, &p->value);
+ CAL_DBUS_GET_STRING(p->key);
+ CAL_DBUS_GET_STRING(p->value);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_attr_value(int type, GVariant *arg_value, cal_attribute_filter_s *p)
+{
+ GVariant *arg_caltime = NULL;
+ switch (type) {
+ case CAL_FILTER_STR:
+ g_variant_get(arg_value, "&s", &p->value.s);
+ break;
+ case CAL_FILTER_INT:
+ g_variant_get(arg_value, "i", &p->value.i);
+ break;
+ case CAL_FILTER_DOUBLE:
+ g_variant_get(arg_value, "d", &p->value.d);
+ break;
+ case CAL_FILTER_LLI:
+ g_variant_get(arg_value, "x", &p->value.lli);
+ break;
+ case CAL_FILTER_CALTIME:
+ g_variant_get(arg_value, "(iv)", &p->value.caltime.type, &arg_caltime);
+ _gvariant_to_caltime(p->value.caltime.type, arg_caltime, &p->value.caltime);
+ break;
+ default:
+ break;
+ }
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_composite(GVariant * arg_composite_pack, cal_composite_filter_s **out_composite)
+{
+ GVariantIter *iter_composite_pack = NULL;
+ g_variant_get(arg_composite_pack, "a(isiv)", &iter_composite_pack);
+
+ int filter_type = 0;
+ char *view_uri = NULL;
+ int count_composite = 0;
+ GVariant *arg_composite = NULL;
+
+ int composite_filter_type = 0;
+ int property_id = 0;
+ int match = 0;
+ GVariant *arg_attr_value = NULL;
+ GVariantIter *iter_composite = NULL;
+
+ cal_composite_filter_s *composite = NULL;
+ while (g_variant_iter_loop(iter_composite_pack, "(i&siv)",
+ &filter_type, &view_uri, &count_composite, &arg_composite)) {
+
+ cal_composite_filter_s *c = calloc(1, sizeof(cal_composite_filter_s));
+ if (NULL == c) {
+ ERR("calloc() Fail");
+ break;
+ }
+ c->filter_type = CAL_FILTER_COMPOSITE;
+ c->view_uri = cal_strdup(view_uri);
+ c->properties = (cal_property_info_s *)cal_view_get_property_info(view_uri,
+ &c->property_count);
+
+ int is_exit = 0;
+ if (0 == count_composite) {
+ DBG("composite count is 0");
+ is_exit = 1;
+ }
+ g_variant_get(arg_composite, "a(iiiv)", &iter_composite);
+ while (g_variant_iter_loop(iter_composite, "(iiiv)",
+ &composite_filter_type, &property_id, &match, &arg_attr_value)) {
+ cal_attribute_filter_s *filter = calloc(1, sizeof(cal_attribute_filter_s));
+ if (NULL == filter) {
+ ERR("calloc() Fail");
+ break;
+ }
+ filter->filter_type = composite_filter_type;
+ filter->property_id = property_id;
+ filter->match = match;
+ _gvariant_to_attr_value(composite_filter_type, arg_attr_value, filter);
+ c->filters = g_slist_append(c->filters, filter);
+ }
+
+ if (1 == is_exit)
+ break;
+
+ if (NULL == composite) {
+ composite = c;
+ }
+ else {
+ composite->filters = g_slist_append(composite->filters, c);
+ }
+ }
+ *out_composite = composite;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_operate(GVariant * arg_operate, cal_composite_filter_s *f)
+{
+ GVariantIter *iter_operate = NULL;
+ g_variant_get(arg_operate, "ai", &iter_operate);
+
+ int operate = 0;
+ while (g_variant_iter_loop(iter_operate, "i", &operate)) {
+ f->filter_ops = g_slist_append(f->filter_ops, GINT_TO_POINTER(operate));
+ }
+
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_filter(GVariant *arg_filter, cal_query_s *q)
+{
+ GVariant *arg_composite_pack = NULL;
+ int count_operate = 0;
+ GVariant *arg_operate = NULL;
+ g_variant_get(arg_filter, "(viv)", &arg_composite_pack, &count_operate, &arg_operate);
+
+ _gvariant_to_composite(arg_composite_pack, &q->filter);
+
+ if (count_operate)
+ _gvariant_to_operate(arg_operate, q->filter);
+
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_projection(int count_projection, GVariant *arg_projection, cal_query_s *q)
+{
+ GVariantIter *iter_projection = NULL;
+ g_variant_get(arg_projection, "au", &iter_projection);
+
+ int i = 0;
+ q->projection = calloc(count_projection, sizeof(unsigned int));
+ if (NULL == q->projection) {
+ ERR("calloc() Fail");
+ return CALENDAR_ERROR_OUT_OF_MEMORY;
+ }
+ while (g_variant_iter_loop(iter_projection, "u", &q->projection[i])) {
+ i++;
+ }
+ q->projection_count = count_projection;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_utils_gvariant_to_query(GVariant *arg_query, calendar_query_h *out_query)
+{
+ RETV_IF(NULL == arg_query, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_query, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ char *view_uri = NULL;
+ int has_filter = 0;
+ GVariant *arg_filter = NULL;
+ int count_projection = 0;
+ GVariant *arg_projection = NULL;
+ int property_id = 0;
+ int has_asc = 0;
+ int has_distinct = 0;
+
+ g_variant_get(arg_query, "(&siviviii)",
+ &view_uri, &has_filter, &arg_filter, &count_projection, &arg_projection,
+ &property_id, &has_asc, &has_distinct);
+
+ calendar_query_h query = NULL;
+ calendar_query_create(view_uri, &query);
+
+ cal_query_s *q = (cal_query_s *)query;
+
+ if (has_filter)
+ _gvariant_to_filter(arg_filter, q);
+
+ if (count_projection)
+ _gvariant_to_projection(count_projection, arg_projection, q);
+
+ q->sort_property_id = property_id;
+ q->asc = has_asc;
+ q->distinct = has_distinct;
+
+ *out_query = query;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_utils_gvariant_to_ids(GVariant *arg_ids, int count, int **out_ids)
+{
+ GVariantIter *iter_ids = NULL;
+ g_variant_get(arg_ids, "ai", &iter_ids);
+
+ int *ids = calloc(count, sizeof(int));
+ if (NULL == ids) {
+ ERR("calloc() Fail");
+ return CALENDAR_ERROR_OUT_OF_MEMORY;
+ }
+ int i = 0;
+ for (i = 0; i < count; i++) {
+ g_variant_iter_loop(iter_ids, "i", &ids[i]);
+ }
+ *out_ids = ids;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_event(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ GVariant *arg_only_event = NULL;
+ int count_alarm = 0;
+ GVariantIter *iter_alarm = NULL;
+ int count_attendee = 0;
+ GVariantIter *iter_attendee = NULL;
+ int count_exception = 0;
+ GVariantIter *iter_exception = NULL;
+ int count_extended = 0;
+ GVariantIter *iter_extended = NULL;
+ g_variant_get(arg_record, "(viaviaviaviav)", &arg_only_event,
+ &count_alarm, &iter_alarm, &count_attendee, &iter_attendee,
+ &count_exception, &iter_exception, &count_extended, &iter_extended);
+
+ calendar_record_h record = NULL;
+ _gvariant_to_only_event(arg_only_event, &record);
+
+ if (0 < count_alarm) {
+ GVariant *arg_alarm = NULL;
+ while (g_variant_iter_loop(iter_alarm, "v", &arg_alarm)) {
+ calendar_record_h alarm = NULL;
+ _gvariant_to_alarm(arg_alarm, &alarm);
+ calendar_record_add_child_record(record, _calendar_event.calendar_alarm, alarm);
+ }
+ }
+ else {
+ DBG("No alarm");
+ }
+
+ if (0 < count_attendee) {
+ GVariant *arg_attendee = NULL;
+ while (g_variant_iter_loop(iter_attendee, "v", &arg_attendee)) {
+ calendar_record_h attendee = NULL;
+ _gvariant_to_attendee(arg_attendee, &attendee);
+ calendar_record_add_child_record(record, _calendar_event.calendar_attendee, attendee);
+ }
+ }
+ else {
+ DBG("No attendee");
+ }
+
+ if (0 < count_exception) {
+ GVariant *arg_exception = NULL;
+ while (g_variant_iter_loop(iter_exception, "v", &arg_exception)) {
+ calendar_record_h exception = NULL;
+ _gvariant_to_only_event(arg_exception, &exception);
+ calendar_record_add_child_record(record, _calendar_event.exception, exception);
+ }
+ }
+ else {
+ DBG("No exception");
+ }
+
+ if (0 < count_extended) {
+ GVariant *arg_extended = NULL;
+ while (g_variant_iter_loop(iter_extended, "v", &arg_extended)) {
+ calendar_record_h extended = NULL;
+ _gvariant_to_extended(arg_extended, &extended);
+ calendar_record_add_child_record(record, _calendar_event.extended, extended);
+ }
+ }
+ else {
+ DBG("No extended");
+ }
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_only_todo(GVariant *arg_record, calendar_record_h *out_record)
+{
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_todo._uri, &record);
+ cal_todo_s *p = (cal_todo_s *)record;
+
+ GVariant *arg_until = NULL;
+ GVariant *arg_start= NULL;
+ GVariant *arg_due = NULL;
+
+ g_variant_get(arg_record, "(ii&s&s&s&siii&sddxxiixiiivii&s&s&s&s&s&s&s&s&si"
+ "iii&s&s&s&siv&siv&s&s&sii)",
+ &p->index, &p->calendar_id,
+ &p->summary, &p->description, &p->location, &p->categories, &p->todo_status,
+ &p->priority, &p->sensitivity, &p->uid, &p->latitude, &p->longitude,
+ &p->created_time, &p->completed_time, &p->progress, &p->is_deleted,
+ &p->last_mod, &p->freq, &p->range_type, &p->until.type, &arg_until,
+ &p->count, &p->interval, &p->bysecond, &p->byminute, &p->byhour, &p->byday,
+ &p->bymonthday, &p->byyearday, &p->byweekno, &p->bymonth, &p->bysetpos,
+ &p->wkst, &p->has_alarm, &p->system_type, &p->updated, &p->sync_data1,
+ &p->sync_data2, &p->sync_data3, &p->sync_data4, &p->start.type, &arg_start,
+ &p->start_tzid, &p->due.type, &arg_due, &p->due_tzid, &p->organizer_name,
+ &p->organizer_email, &p->has_attendee, &p->is_allday);
+ _gvariant_to_caltime(p->until.type, arg_until, &p->until);
+ _gvariant_to_caltime(p->start.type, arg_start, &p->start);
+ _gvariant_to_caltime(p->due.type, arg_due, &p->due);
+ CAL_DBUS_GET_STRING(p->summary);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->categories);
+ CAL_DBUS_GET_STRING(p->uid);
+ CAL_DBUS_GET_STRING(p->bysecond);
+ CAL_DBUS_GET_STRING(p->byminute);
+ CAL_DBUS_GET_STRING(p->byhour);
+ CAL_DBUS_GET_STRING(p->byday);
+ CAL_DBUS_GET_STRING(p->bymonthday);
+ CAL_DBUS_GET_STRING(p->byyearday);
+ CAL_DBUS_GET_STRING(p->byweekno);
+ CAL_DBUS_GET_STRING(p->bymonth);
+ CAL_DBUS_GET_STRING(p->bysetpos);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+ CAL_DBUS_GET_STRING(p->sync_data2);
+ CAL_DBUS_GET_STRING(p->sync_data3);
+ CAL_DBUS_GET_STRING(p->sync_data4);
+ CAL_DBUS_GET_STRING(p->start_tzid);
+ CAL_DBUS_GET_STRING(p->due_tzid);
+ CAL_DBUS_GET_STRING(p->organizer_name);
+ CAL_DBUS_GET_STRING(p->organizer_email);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_todo(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ GVariant *arg_only_todo = NULL;
+ int count_alarm = 0;
+ GVariantIter *iter_alarm = NULL;
+ int count_attendee = 0;
+ GVariantIter *iter_attendee = NULL;
+ int count_extended = 0;
+ GVariantIter *iter_extended = NULL;
+ g_variant_get(arg_record, "(viaviaviav)", &arg_only_todo,
+ &count_alarm, &iter_alarm, &count_attendee, &iter_attendee,
+ &count_extended, &iter_extended);
+
+ calendar_record_h record = NULL;
+ _gvariant_to_only_todo(arg_only_todo, &record);
+
+ if (0 < count_alarm) {
+ GVariant *arg_alarm = NULL;
+ while (g_variant_iter_loop(iter_alarm, "v", &arg_alarm)) {
+ calendar_record_h alarm = NULL;
+ _gvariant_to_alarm(arg_alarm, &alarm);
+ calendar_record_add_child_record(record, _calendar_todo.calendar_alarm, alarm);
+ }
+ }
+ else {
+ DBG("No alarm");
+ }
+
+ if (0 < count_attendee) {
+ GVariant *arg_attendee = NULL;
+ while (g_variant_iter_loop(iter_attendee, "v", &arg_attendee)) {
+ calendar_record_h attendee = NULL;
+ _gvariant_to_attendee(arg_attendee, &attendee);
+ calendar_record_add_child_record(record, _calendar_todo.calendar_attendee, attendee);
+ }
+ }
+ else {
+ DBG("No attendee");
+ }
+
+ if (0 < count_extended) {
+ GVariant *arg_extended = NULL;
+ while (g_variant_iter_loop(iter_extended, "v", &arg_extended)) {
+ calendar_record_h extended = NULL;
+ _gvariant_to_extended(arg_extended, &extended);
+ calendar_record_add_child_record(record, _calendar_todo.extended, extended);
+ }
+ }
+ else {
+ DBG("No extended");
+ }
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+
+static int _gvariant_to_instance_normal(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_instance_utime_calendar_book._uri, &record);
+ GVariant *arg_start = NULL;
+ GVariant *arg_end = NULL;
+ cal_instance_normal_s *p = (cal_instance_normal_s *)record;
+ g_variant_get(arg_record, "(iiiviv&s&s&siiiiiddiix&s)",
+ &p->event_id, &p->calendar_id, &p->start.type, &arg_start, &p->end.type,
+ &arg_end, &p->summary, &p->description, &p->location, &p->busy_status,
+ &p->event_status, &p->priority, &p->sensitivity, &p->has_rrule, &p->latitude,
+ &p->longitude, &p->has_alarm, &p->original_event_id, &p->last_mod,
+ &p->sync_data1);
+ _gvariant_to_caltime(p->start.type, arg_start, &p->start);
+ _gvariant_to_caltime(p->end.type, arg_end, &p->end);
+ CAL_DBUS_GET_STRING(p->summary);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_instance_allday(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_instance_localtime_calendar_book._uri, &record);
+ GVariant *arg_start = NULL;
+ GVariant *arg_end = NULL;
+ cal_instance_allday_s *p = (cal_instance_allday_s *)record;
+ g_variant_get(arg_record, "(iiiviv&s&s&siiiiiddiix&si)",
+ &p->event_id, &p->calendar_id, &p->start.type, &arg_start, &p->end.type,
+ &arg_end, &p->summary, &p->description, &p->location, &p->busy_status,
+ &p->event_status, &p->priority, &p->sensitivity, &p->has_rrule, &p->latitude,
+ &p->longitude, &p->has_alarm, &p->original_event_id, &p->last_mod,
+ &p->sync_data1, &p->is_allday);
+ _gvariant_to_caltime(p->start.type, arg_start, &p->start);
+ _gvariant_to_caltime(p->end.type, arg_end, &p->end);
+ CAL_DBUS_GET_STRING(p->summary);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_instance_normal_extended(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_instance_utime_calendar_book_extended._uri, &record);
+ GVariant *arg_start = NULL;
+ GVariant *arg_end = NULL;
+ cal_instance_normal_extended_s *p = (cal_instance_normal_extended_s *)record;
+ g_variant_get(arg_record, "(iiiviv&s&s&siiiiiddiix&s&si&s&s&s&s)",
+ &p->event_id, &p->calendar_id, &p->start.type, &arg_start, &p->end.type,
+ &arg_end, &p->summary, &p->description, &p->location, &p->busy_status,
+ &p->event_status, &p->priority, &p->sensitivity, &p->has_rrule, &p->latitude,
+ &p->longitude, &p->has_alarm, &p->original_event_id, &p->last_mod,
+ &p->organizer_name, &p->categories, &p->has_attendee, &p->sync_data1,
+ &p->sync_data2, &p->sync_data3, &p->sync_data4);
+ _gvariant_to_caltime(p->start.type, arg_start, &p->start);
+ _gvariant_to_caltime(p->end.type, arg_end, &p->end);
+ CAL_DBUS_GET_STRING(p->summary);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->organizer_name);
+ CAL_DBUS_GET_STRING(p->categories);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+ CAL_DBUS_GET_STRING(p->sync_data2);
+ CAL_DBUS_GET_STRING(p->sync_data3);
+ CAL_DBUS_GET_STRING(p->sync_data4);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_instance_allday_extended(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_instance_localtime_calendar_book_extended._uri, &record);
+ GVariant *arg_start = NULL;
+ GVariant *arg_end = NULL;
+ cal_instance_allday_extended_s *p = (cal_instance_allday_extended_s *)record;
+ g_variant_get(arg_record, "(iiiviv&s&s&siiiiiddiix&s&si&s&s&s&s)",
+ &p->event_id, &p->calendar_id, &p->start.type, &arg_start, &p->end.type,
+ &arg_end, &p->summary, &p->description, &p->location, &p->busy_status,
+ &p->event_status, &p->priority, &p->sensitivity, &p->has_rrule, &p->latitude,
+ &p->longitude, &p->has_alarm, &p->original_event_id, &p->last_mod,
+ &p->organizer_name, &p->categories, &p->has_attendee, &p->sync_data1,
+ &p->sync_data2, &p->sync_data3, &p->sync_data4);
+ _gvariant_to_caltime(p->start.type, arg_start, &p->start);
+ _gvariant_to_caltime(p->end.type, arg_end, &p->end);
+ CAL_DBUS_GET_STRING(p->summary);
+ CAL_DBUS_GET_STRING(p->description);
+ CAL_DBUS_GET_STRING(p->location);
+ CAL_DBUS_GET_STRING(p->organizer_name);
+ CAL_DBUS_GET_STRING(p->categories);
+ CAL_DBUS_GET_STRING(p->sync_data1);
+ CAL_DBUS_GET_STRING(p->sync_data2);
+ CAL_DBUS_GET_STRING(p->sync_data3);
+ CAL_DBUS_GET_STRING(p->sync_data4);
+
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_updated_info(GVariant * arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ calendar_record_create(_calendar_updated_info._uri, &record);
+ cal_updated_info_s *p = (cal_updated_info_s *)record;
+ g_variant_get(arg_record, "(iiii)", &p->type, &p->id, &p->calendar_id, &p->version);
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _gvariant_to_record(int type, GVariant *arg_record, calendar_record_h *out_record)
+{
+ RETV_IF(NULL == arg_record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ calendar_record_h record = NULL;
+ switch (type) {
+ case CAL_RECORD_TYPE_CALENDAR:
+ _gvariant_to_book(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_EVENT:
+ _gvariant_to_event(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_TODO:
+ _gvariant_to_todo(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_ALARM:
+ _gvariant_to_alarm(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_ATTENDEE:
+ _gvariant_to_attendee(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_TIMEZONE:
+ _gvariant_to_timezone(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_NORMAL:
+ _gvariant_to_instance_normal(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_ALLDAY:
+ _gvariant_to_instance_allday(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_NORMAL_EXTENDED:
+ _gvariant_to_instance_normal_extended(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_INSTANCE_ALLDAY_EXTENDED:
+ _gvariant_to_instance_allday_extended(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_UPDATED_INFO:
+ _gvariant_to_updated_info(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_SEARCH:
+ _gvariant_to_search(arg_record, &record);
+ break;
+ case CAL_RECORD_TYPE_EXTENDED:
+ _gvariant_to_extended(arg_record, &record);
+ break;
+ default:
+ ERR("Invalid type(%d)", type);
+ break;
+ }
+ *out_record = record;
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_utils_gvariant_to_record(GVariant *arg_record_pack, calendar_record_h *out_record)
+{
+ int type = 0;
+ GVariant *arg_record = NULL;
+ g_variant_get(arg_record_pack, "(iv)", &type, &arg_record);
+ _gvariant_to_record(type, arg_record, out_record);
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_utils_gvariant_to_list(GVariant *arg_list_pack, calendar_list_h *out_list)
+{
+ int has_list = 0;
+ GVariant *arg_list = NULL;
+ g_variant_get(arg_list_pack, "(iv)", &has_list, &arg_list);
+
+ calendar_list_h l = NULL;
+ calendar_list_create(&l);
+
+ if (1 == has_list) {
+ GVariantIter *iter_value = NULL;
+ g_variant_get(arg_list, "av", &iter_value);
+
+ GVariant *arg_record = NULL;
+ while (g_variant_iter_loop(iter_value, "v", &arg_record)) {
+ calendar_record_h record = NULL;
+ cal_dbus_utils_gvariant_to_record(arg_record, &record);
+ calendar_list_add(l, record);
+ }
+ }
+ *out_list = l;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+GVariant *cal_dbus_utils_stream_to_gvariant(int stream_size, char *stream)
+{
+ return g_variant_new("(is)", stream_size, CAL_DBUS_SET_STRING(stream));
+}
+
+int cal_dbus_utils_gvariant_to_stream(GVariant *arg_stream, int *out_size, char **out_stream)
+{
+ int size = 0;
+ char *stream = NULL;
+
+ RETV_IF(NULL == out_size, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_stream, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ g_variant_get(arg_stream, "(i&s)", &size, &stream);
+ CAL_DBUS_GET_STRING(stream);
+ *out_size = size;
+ *out_stream = cal_strdup(stream);
+ return CALENDAR_ERROR_NONE;
+}
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __CALENDAR_SVC_DBUS_UTILS_H__
+#define __CALENDAR_SVC_DBUS_UTILS_H__
+
+/*
+ * DBUS_INTERFACE name validation.
+ * Each element must only contain the ASCII characters "[A-Z][a-z][0-9]_" and must not begin with a digit.
+ */
+#ifndef CAL_DBUS_INTERFACE
+#define CAL_DBUS_INTERFACE "org.tizen.calendar_service.dbus"
+#warning "CAL_DBUS_INTERFACE is redefined"
+#endif
+
+#define CAL_DBUS_OBJPATH "/org/tizen/calendar_service/dbus"
+
+GVariant *cal_dbus_utils_common_to_gvariant(cal_record_s *rec);
+GVariant *cal_dbus_utils_handle_to_gvariant(calendar_h handle);
+GVariant *cal_dbus_utils_record_to_gvariant(calendar_record_h record);
+GVariant *cal_dbus_utils_list_to_gvariant(calendar_list_h list);
+GVariant *cal_dbus_utils_query_to_gvariant(calendar_query_h query);
+GVariant *cal_dbus_utils_ids_to_gvariant(int *ids, int count);
+GVariant *cal_dbus_utils_stream_to_gvariant(int stream_size, char *stream);
+
+int cal_dbus_utils_gvariant_to_common(GVariant *arg_common, cal_record_s **rec);
+int cal_dbus_utils_gvariant_to_handle(GVariant *arg_handle, calendar_h *handle);
+int cal_dbus_utils_gvariant_to_record(GVariant *arg_record, calendar_record_h *record);
+int cal_dbus_utils_gvariant_to_list(GVariant *arg_list, calendar_list_h *list);
+int cal_dbus_utils_gvariant_to_query(GVariant *arg_query, calendar_query_h *query);
+int cal_dbus_utils_gvariant_to_ids(GVariant *arg_ids, int count, int **ids);
+int cal_dbus_utils_gvariant_to_stream(GVariant *arg_stream, int *out_size, char **out_stream);
+
+#endif /*__CALENDAR_SVC_DBUS_UTILS_H__ */
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __CAL_IPC_H__
-#define __CAL_IPC_H__
-
-#define CAL_IPC_SERVICE "cal_svc_ipc"
-#define CAL_IPC_SOCKET_PATH "/tmp/."CAL_IPC_SERVICE
-#define CAL_IPC_SOCKET_PATH_FOR_SUBSCRIPTION "/tmp/."CAL_IPC_SERVICE"_for_subscription"
-#define CAL_IPC_MODULE "cal_ipc_module"
-#define CAL_IPC_MODULE_FOR_SUBSCRIPTION CAL_IPC_MODULE"_for_subscription"
-
-#define CAL_IPC_SERVER_CONNECT "connect"
-#define CAL_IPC_SERVER_DISCONNECT "disconnect"
-#define CAL_IPC_SERVER_CHECK_PERMISSION "check_permission"
-
-#define CAL_IPC_SERVER_DB_INSERT_RECORD "insert_record"
-#define CAL_IPC_SERVER_DB_GET_RECORD "get_record"
-#define CAL_IPC_SERVER_DB_UPDATE_RECORD "update_record"
-#define CAL_IPC_SERVER_DB_DELETE_RECORD "delete_record"
-#define CAL_IPC_SERVER_DB_GET_ALL_RECORDS "get_all_records"
-#define CAL_IPC_SERVER_DB_GET_RECORDS_WITH_QUERY "get_records_with_query"
-#define CAL_IPC_SERVER_DB_CLEAN_AFTER_SYNC "clean_after_sync"
-#define CAL_IPC_SERVER_DB_GET_COUNT "get_count"
-#define CAL_IPC_SERVER_DB_GET_COUNT_WITH_QUERY "get_count_with_query"
-#define CAL_IPC_SERVER_DB_INSERT_RECORDS "insert_records"
-#define CAL_IPC_SERVER_DB_UPDATE_RECORDS "update_records"
-#define CAL_IPC_SERVER_DB_DELETE_RECORDS "delete_records"
-#define CAL_IPC_SERVER_DB_CHANGES_BY_VERSION "changes_by_version"
-#define CAL_IPC_SERVER_DB_GET_CURRENT_VERSION "get_current_version"
-#define CAL_IPC_SERVER_DB_INSERT_VCALENDARS "insert_vcalendars"
-#define CAL_IPC_SERVER_DB_REPLACE_VCALENDARS "replace_vcalendars"
-#define CAL_IPC_SERVER_DB_REPLACE_RECORD "replace_record"
-#define CAL_IPC_SERVER_DB_REPLACE_RECORDS "replace_records"
-#define CAL_IPC_SERVER_DB_CHANGES_EXCEPTION "changes_exception"
-
-#ifdef CAL_MEMORY_TEST
-#define CAL_IPC_SERVER_DESTROY "destroy"
-#endif /* CAL_MEMORY_TEST */
-
-#endif /*__CAL_IPC_H__*/
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "calendar.h"
-#include "cal_ipc_marshal.h"
-#include "cal_record.h"
-#include "cal_internal.h"
-#include "cal_view.h"
-#include "cal_handle.h"
-#include "cal_utils.h"
-
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_calendar_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_event_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_todo_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_alarm_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_attendee_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_timezone_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_updated_info_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_normal_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_normal_extended_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_allday_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_allday_extended_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_search_plugin_cb;
-extern cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_extended_plugin_cb;
-
-static cal_ipc_marshal_record_plugin_cb_s* _cal_ipc_marshal_get_plugin_cb(cal_record_type_e type);
-
-static int _cal_ipc_unmarshal_composite_filter(const pims_ipc_data_h ipc_data, cal_composite_filter_s* filter);
-static int _cal_ipc_marshal_composite_filter(const cal_composite_filter_s* filter, pims_ipc_data_h ipc_data);
-static int _cal_ipc_unmarshal_attribute_filter(const pims_ipc_data_h ipc_data, const cal_filter_type_e filter_type, cal_attribute_filter_s* filter);
-static int _cal_ipc_marshal_attribute_filter(const cal_attribute_filter_s* filter, pims_ipc_data_h ipc_data);
-
-static cal_ipc_marshal_record_plugin_cb_s* _cal_ipc_marshal_get_plugin_cb(cal_record_type_e type)
-{
- switch (type) {
- case CAL_RECORD_TYPE_CALENDAR:
- return (&cal_ipc_record_calendar_plugin_cb);
- case CAL_RECORD_TYPE_EVENT:
- return (&cal_ipc_record_event_plugin_cb);
- case CAL_RECORD_TYPE_TODO:
- return (&cal_ipc_record_todo_plugin_cb);
- case CAL_RECORD_TYPE_ALARM:
- return (&cal_ipc_record_alarm_plugin_cb);
- case CAL_RECORD_TYPE_ATTENDEE:
- return (&cal_ipc_record_attendee_plugin_cb);
- case CAL_RECORD_TYPE_TIMEZONE:
- return (&cal_ipc_record_timezone_plugin_cb);
- case CAL_RECORD_TYPE_INSTANCE_NORMAL:
- return (&cal_ipc_record_instance_normal_plugin_cb);
- case CAL_RECORD_TYPE_INSTANCE_ALLDAY:
- return (&cal_ipc_record_instance_allday_plugin_cb);
- case CAL_RECORD_TYPE_INSTANCE_NORMAL_EXTENDED:
- return (&cal_ipc_record_instance_normal_extended_plugin_cb);
- case CAL_RECORD_TYPE_INSTANCE_ALLDAY_EXTENDED:
- return (&cal_ipc_record_instance_allday_extended_plugin_cb);
- case CAL_RECORD_TYPE_UPDATED_INFO:
- return (&cal_ipc_record_updated_info_plugin_cb);
- case CAL_RECORD_TYPE_SEARCH:
- return (&cal_ipc_record_search_plugin_cb);
- case CAL_RECORD_TYPE_EXTENDED:
- return (&cal_ipc_record_extended_plugin_cb);
- default:
- return NULL;
- }
-}
-
-static void _cal_ipc_unmarshal_composite_filter_free(cal_composite_filter_s* filter)
-{
- if (filter->filters) {
- GSList *cursor = NULL;
- for(cursor=filter->filters;cursor;cursor=cursor->next) {
- cal_filter_s *src = (cal_filter_s*)cursor->data;
- if (src->filter_type == CAL_FILTER_COMPOSITE)
- _cal_ipc_unmarshal_composite_filter_free((cal_composite_filter_s *)src);
- else {
- cal_attribute_filter_s *attr = (cal_attribute_filter_s *)src;
- if (attr->filter_type == CAL_FILTER_STR)
- free(attr->value.s);
- }
- free(src);
- }
- g_slist_free(filter->filters);
- }
-
- if (filter->filter_ops) {
- g_slist_free(filter->filter_ops);
- }
-
- free(filter->view_uri);
-}
-
-static int _cal_ipc_unmarshal_composite_filter(const pims_ipc_data_h ipc_data, cal_composite_filter_s* filter)
-{
- int ret = CALENDAR_ERROR_NONE;
- unsigned int size = 0;
- char* str = NULL;
- int count = 0;
- int i = 0;
- cal_filter_type_e filter_type = CAL_FILTER_COMPOSITE;
- calendar_filter_operator_e op = CALENDAR_FILTER_OPERATOR_AND;
-
- RETV_IF(NULL == filter, CALENDAR_ERROR_INVALID_PARAMETER);
-
- filter->filter_type = CAL_FILTER_COMPOSITE;
-
- str = (char*)pims_ipc_data_get(ipc_data,&size);
- CAL_FREE(filter->view_uri);
- filter->view_uri = cal_strdup(str);
-
- ret = cal_ipc_unmarshal_int(ipc_data, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- for(i=0;i<count;i++) {
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&filter_type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
- if (filter_type == CAL_FILTER_COMPOSITE) {
- cal_composite_filter_s* com_filter = NULL;
- com_filter = (cal_composite_filter_s*)calloc(1, sizeof(cal_composite_filter_s));
- if (NULL == com_filter) {
- ERR("calloc() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- goto ERROR_RETURN;
- }
- ret = _cal_ipc_unmarshal_composite_filter(ipc_data, com_filter);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_unmarshal_composite_filter() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- CAL_FREE(com_filter);
- goto ERROR_RETURN;
- }
- filter->filters = g_slist_append(filter->filters,com_filter);
- }
- else {
- cal_attribute_filter_s* attr_filter = NULL;
- attr_filter = (cal_attribute_filter_s*)calloc(1, sizeof(cal_attribute_filter_s));
- if (NULL == attr_filter) {
- ERR("calloc() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- goto ERROR_RETURN;
- }
- ret = _cal_ipc_unmarshal_attribute_filter(ipc_data, filter_type, attr_filter);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_unmarshal_attribute_filter() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- CAL_FREE(attr_filter);
- goto ERROR_RETURN;
- }
- filter->filters = g_slist_append(filter->filters,attr_filter);
- }
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- for(i = 0; i < count; i++) {
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&op);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
- filter->filter_ops = g_slist_append(filter->filter_ops, (void*)op);
- }
-
- filter->properties = (cal_property_info_s *)cal_view_get_property_info(filter->view_uri, &filter->property_count);
-
- return CALENDAR_ERROR_NONE;
-
-ERROR_RETURN:
-
- _cal_ipc_unmarshal_composite_filter_free(filter);
-
- return ret;
-}
-
-static int _cal_ipc_marshal_composite_filter(const cal_composite_filter_s* filter, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- ret = cal_ipc_marshal_int((filter->filter_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- int length = strlen(filter->view_uri);
- if (pims_ipc_data_put(ipc_data, (void*)filter->view_uri,length+1) < 0) {
- ERR("pims_ipc_data_put() Fail");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- if (filter->filters) {
- int count = g_slist_length(filter->filters);
- GSList *cursor = filter->filters;
- cal_filter_s* child_filter;
-
- ret = cal_ipc_marshal_int(count, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- while (cursor) {
- child_filter = (cal_filter_s*)cursor->data;
-
- if (child_filter->filter_type == CAL_FILTER_COMPOSITE) {
- ret = _cal_ipc_marshal_composite_filter((cal_composite_filter_s*)child_filter, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_marshal_composite_filter() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else {
- ret = _cal_ipc_marshal_attribute_filter((cal_attribute_filter_s*)child_filter, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_marshal_attribute_filter() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- cursor = g_slist_next(cursor);
- }
- }
- else {
- ret = cal_ipc_marshal_int(0, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
-
- if (filter->filter_ops) {
- int count = g_slist_length(filter->filter_ops);
- GSList *cursor = filter->filter_ops;
-
- ret = cal_ipc_marshal_int(count, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- while (cursor) {
- calendar_filter_operator_e op = (calendar_filter_operator_e)cursor->data;
-
- ret = cal_ipc_marshal_int(op, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- cursor = g_slist_next(cursor);
- }
- }
- else {
- ret = cal_ipc_marshal_int(0, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_unmarshal_attribute_filter(const pims_ipc_data_h ipc_data, const cal_filter_type_e filter_type, cal_attribute_filter_s* filter)
-{
- int ret = 0;
- filter->filter_type = filter_type;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &filter->property_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data,&filter->match);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- switch (filter->filter_type) {
- case CAL_FILTER_STR:
- ret = cal_ipc_unmarshal_char(ipc_data,&filter->value.s);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_INT:
- ret = cal_ipc_unmarshal_int(ipc_data,&filter->value.i);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_DOUBLE:
- ret = cal_ipc_unmarshal_double(ipc_data,&filter->value.d);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_LLI:
- ret = cal_ipc_unmarshal_lli(ipc_data,&filter->value.lli);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_CALTIME:
- ret = cal_ipc_unmarshal_caltime(ipc_data,&filter->value.caltime);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- default:
- break;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_attribute_filter(const cal_attribute_filter_s* filter, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- ret = cal_ipc_marshal_int((filter->filter_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((filter->property_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((filter->match), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- switch (filter->filter_type) {
- case CAL_FILTER_STR:
- ret = cal_ipc_marshal_char((filter->value.s), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_INT:
- ret = cal_ipc_marshal_int((filter->value.i), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_DOUBLE:
- ret = cal_ipc_marshal_double((filter->value.d),ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_LLI:
- ret = cal_ipc_marshal_lli((filter->value.lli), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- case CAL_FILTER_CALTIME:
- ret = cal_ipc_marshal_caltime((filter->value.caltime), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- break;
- default:
- break;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_record(const pims_ipc_data_h ipc_data, calendar_record_h* precord)
-{
- int ret = CALENDAR_ERROR_NONE;
- cal_record_s common = {0,};
- cal_record_s *pcommon = NULL;
-
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == precord, CALENDAR_ERROR_INVALID_PARAMETER);
-
- ret = cal_ipc_unmarshal_record_common(ipc_data, &common);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record_common() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- cal_ipc_marshal_record_plugin_cb_s *plugin_cb = _cal_ipc_marshal_get_plugin_cb(common.type);
-
- if (NULL == plugin_cb || NULL == plugin_cb->unmarshal_record) {
- ERR("Invalid parameter");
- free(common.properties_flags);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = calendar_record_create(common.view_uri, precord);
- RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_record_create() Fail(%d)", ret);
-
- pcommon = (cal_record_s*)(*precord);
- pcommon->properties_max_count = common.properties_max_count;
- pcommon->properties_flags = common.properties_flags;
-
- ret = plugin_cb->unmarshal_record(ipc_data, *precord);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("unmarshal_record() Fail(%d)", ret);
- calendar_record_destroy(*precord,true);
- *precord = NULL;
- }
-
- return ret;
-}
-
-int cal_ipc_marshal_record(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = CALENDAR_ERROR_NONE;
- cal_record_s *temp = (cal_record_s*)(record);
-
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- ret = cal_ipc_marshal_record_common(temp, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_record_common() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- cal_ipc_marshal_record_plugin_cb_s *plugin_cb = _cal_ipc_marshal_get_plugin_cb(temp->type);
- RETV_IF(NULL == plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == plugin_cb->marshal_record, CALENDAR_ERROR_INVALID_PARAMETER);
-
- ret = plugin_cb->marshal_record(record, ipc_data);
-
- return ret;
-}
-
-int cal_ipc_unmarshal_char(const pims_ipc_data_h ipc_data, char** ppbufchar)
-{
- unsigned int size = 0;
- char *str = NULL;
- int length = 0;
-
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ppbufchar, CALENDAR_ERROR_INVALID_PARAMETER);
-
- void *tmp = NULL;
- tmp = pims_ipc_data_get(ipc_data,&size);
- RETVM_IF(NULL == tmp, CALENDAR_ERROR_INVALID_PARAMETER, "pims_ipc_data_get() Fail");
-
- length = *(int*)tmp;
- if (length == -1) {
- *ppbufchar = NULL;
- return CALENDAR_ERROR_NONE;
- }
- str = (char*)pims_ipc_data_get(ipc_data,&size);
- if (str) {
- *ppbufchar = cal_strdup(str);
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_int(const pims_ipc_data_h data, int *pout)
-{
- void *tmp = NULL;
- unsigned int size = 0;
-
- RETV_IF(NULL == data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pout, CALENDAR_ERROR_INVALID_PARAMETER);
-
- tmp = pims_ipc_data_get(data,&size);
- if (NULL == tmp) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- else {
- *pout = *(int*)tmp;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_uint(const pims_ipc_data_h data, unsigned int *pout)
-{
- void *tmp = NULL;
- unsigned int size = 0;
-
- RETV_IF(NULL == data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pout, CALENDAR_ERROR_INVALID_PARAMETER);
-
- tmp = pims_ipc_data_get(data,&size);
- if (NULL == tmp) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- else {
- *pout = *(unsigned int*)tmp;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_lli(const pims_ipc_data_h data, long long int *pout)
-{
- void *tmp = NULL;
- unsigned int size = 0;
-
- RETV_IF(NULL == data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pout, CALENDAR_ERROR_INVALID_PARAMETER);
- tmp = pims_ipc_data_get(data,&size);
- if (NULL == tmp) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- else {
- *pout = *(long long int*)tmp;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_long(const pims_ipc_data_h data, long *pout)
-{
- void *tmp = NULL;
- unsigned int size = 0;
-
- RETV_IF(NULL == data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pout, CALENDAR_ERROR_INVALID_PARAMETER);
- tmp = pims_ipc_data_get(data,&size);
- if (NULL == tmp) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- else {
- *pout = *(long*)tmp;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_double(const pims_ipc_data_h data, double *pout)
-{
- void *tmp = NULL;
- unsigned int size = 0;
-
- RETV_IF(NULL == data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pout, CALENDAR_ERROR_INVALID_PARAMETER);
- tmp = pims_ipc_data_get(data,&size);
- if (NULL == tmp) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- else {
- *pout = *(double*)tmp;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_caltime(const pims_ipc_data_h data, calendar_time_s *pout)
-{
- void *tmp = NULL;
- unsigned int size = 0;
- int ret = CALENDAR_ERROR_NONE;
-
- RETV_IF(NULL == data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pout, CALENDAR_ERROR_INVALID_PARAMETER);
- tmp = pims_ipc_data_get(data,&size);
- if (NULL == tmp) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- else {
- pout->type = *(int*)tmp;
- }
-
- if (pout->type == CALENDAR_TIME_UTIME) {
- return cal_ipc_unmarshal_lli(data, &(pout->time.utime));
- }
- else {
- ret = cal_ipc_unmarshal_int(data, &(pout->time.date.year));
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_unmarshal_int(data, &(pout->time.date.month));
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_unmarshal_int(data, &(pout->time.date.mday));
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_unmarshal_int(data, &(pout->time.date.hour));
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_unmarshal_int(data, &(pout->time.date.minute));
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_unmarshal_int(data, &(pout->time.date.second));
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_record_common(const pims_ipc_data_h ipc_data, cal_record_s* common)
-{
- unsigned int size = 0;
- void *ret_pims = NULL;
-
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- ret_pims = pims_ipc_data_get(ipc_data,&size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- common->type = *(cal_record_type_e*)ret_pims;
- common->plugin_cb = cal_record_get_plugin_cb(common->type);
-
- ret_pims = pims_ipc_data_get(ipc_data,&size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- char *uri = (char*)ret_pims;
- common->view_uri = cal_view_get_uri(uri);
-
- ret_pims = pims_ipc_data_get(ipc_data,&size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- common->properties_max_count = *(unsigned int*)ret_pims;
- if (0 < common->properties_max_count) {
- unsigned char *tmp_properties_flags;
- ret_pims = pims_ipc_data_get(ipc_data,&size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- tmp_properties_flags = (unsigned char*)ret_pims;
- common->properties_flags = calloc(common->properties_max_count, sizeof(char));
- if (NULL == common->properties_flags) {
- ERR("calloc() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- memcpy(common->properties_flags,tmp_properties_flags, sizeof(char)*common->properties_max_count);
- }
-
- ret_pims = pims_ipc_data_get(ipc_data,&size);
- if (NULL == ret_pims) {
- ERR("pims_ipc_data_get() Fail");
- free(common->properties_flags);
- return CALENDAR_ERROR_IPC;
- }
- common->property_flag = *(unsigned char*)ret_pims;
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_char(const char* bufchar, pims_ipc_data_h ipc_data)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (bufchar) {
- int length = strlen(bufchar);
- if (pims_ipc_data_put(ipc_data, (void*)&length, sizeof(int)) != 0) {
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- if (pims_ipc_data_put(ipc_data, (void*)bufchar,length+1) != 0) {
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- return ret;
- }
- }
- else {
- int length = -1;
-
- if (pims_ipc_data_put(ipc_data, (void*)&length, sizeof(int)) != 0) {
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- }
- return ret;
-}
-
-int cal_ipc_marshal_int(const int in, pims_ipc_data_h ipc_data)
-{
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&in, sizeof(int)) != 0) {
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_uint(const unsigned int in, pims_ipc_data_h ipc_data)
-{
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&in, sizeof(unsigned int)) != 0) {
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_lli(const long long int in, pims_ipc_data_h ipc_data)
-{
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&in, sizeof(long long int)) != 0) {
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_long(const long in, pims_ipc_data_h ipc_data)
-{
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&in, sizeof(long)) != 0) {
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_double(const double in, pims_ipc_data_h ipc_data)
-{
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&in, sizeof(double)) != 0) {
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_caltime(const calendar_time_s in, pims_ipc_data_h ipc_data)
-{
- int ret = CALENDAR_ERROR_NONE;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&(in.type), sizeof(int)) != 0) {
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- if (in.type == CALENDAR_TIME_UTIME) {
- return cal_ipc_marshal_lli(in.time.utime,ipc_data);
- }
- else {
- ret = cal_ipc_marshal_int(in.time.date.year,ipc_data);
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_marshal_int(in.time.date.month,ipc_data);
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_marshal_int(in.time.date.mday,ipc_data);
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_marshal_int(in.time.date.hour,ipc_data);
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_marshal_int(in.time.date.minute,ipc_data);
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- ret = cal_ipc_marshal_int(in.time.date.second,ipc_data);
- RETV_IF(ret!=CALENDAR_ERROR_NONE,ret);
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_record_common(const cal_record_s* common, pims_ipc_data_h ipc_data)
-{
-
- RETV_IF(NULL == common, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (pims_ipc_data_put(ipc_data, (void*)&common->type, sizeof(int)) < 0)
- return CALENDAR_ERROR_NO_DATA;
-
- int length = strlen(common->view_uri);
-
- if (pims_ipc_data_put(ipc_data, (void*)common->view_uri,length+1) < 0) {
- ERR("pims_ipc_data_put() Fail");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- if (pims_ipc_data_put(ipc_data, (void*)&common->properties_max_count, sizeof(int)) < 0) {
- ERR("pims_ipc_data_put() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
-
- if (0 < common->properties_max_count) {
- if (pims_ipc_data_put(ipc_data, (void*)common->properties_flags, sizeof(char)*common->properties_max_count) < 0) {
- ERR("pims_ipc_data_put() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
- }
-
- if (pims_ipc_data_put(ipc_data, (void*)&common->property_flag, sizeof(char)) < 0) {
- ERR("pims_ipc_data_put() Fail");
- return CALENDAR_ERROR_NO_DATA;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_query(const pims_ipc_data_h ipc_data, calendar_query_h *query)
-{
- cal_query_s *que = NULL;
- unsigned int size = 0;
- char* str = NULL;
- int count = 0, i = 0;
- int ret = CALENDAR_ERROR_NONE;
-
- RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- str = (char*)pims_ipc_data_get(ipc_data,&size);
-
- ret = calendar_query_create(str, query);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_query_create() Fail(%d)", ret);
- return ret;
- }
-
- que = (cal_query_s *) *query;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- if (count == 0) {
- que->filter = NULL;
- }
- else {
- calendar_filter_h filter = (calendar_filter_h)que->filter;
- ret = calendar_filter_create(que->view_uri, &filter);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_filter_create() Fail(%d)", ret);
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- goto ERROR_RETURN;
- }
- que->filter = (cal_composite_filter_s*)filter;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- ret = _cal_ipc_unmarshal_composite_filter(ipc_data, que->filter);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_unmarshal_composite_filter() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &(que->projection_count));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- if (0 < que->projection_count) {
- que->projection = (unsigned int*)calloc(que->projection_count, sizeof(int));
- if (NULL == que->projection) {
- ERR("calloc() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- goto ERROR_RETURN;
- }
-
- for(i=0;i<que->projection_count;i++) {
- ret = cal_ipc_unmarshal_uint(ipc_data, &(que->projection[i]));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_uint() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
- }
- }
- else {
- que->projection = NULL;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &(que->sort_property_id));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&(que->asc));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- que->properties = (cal_property_info_s *)cal_view_get_property_info(que->view_uri, &que->property_count);
-
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&(que->distinct));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- return CALENDAR_ERROR_NONE;
-
-ERROR_RETURN:
-
- calendar_query_destroy(*query);
- *query = NULL;
-
- return ret;
-}
-
-int cal_ipc_marshal_query(const calendar_query_h query, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_query_s *que = NULL;
- int i = 0;
- int length = 0;
-
- RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- que = (cal_query_s *)query;
-
- length = strlen(que->view_uri);
- if (pims_ipc_data_put(ipc_data, (void*)que->view_uri,length+1) < 0) {
- ERR("pims_ipc_data_put() Fail");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- if (que->filter) {
- ret = cal_ipc_marshal_int(1, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = _cal_ipc_marshal_composite_filter(que->filter, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_marshal_composite_filter() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else {
- ret = cal_ipc_marshal_int(0, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
-
- ret = cal_ipc_marshal_int((que->projection_count), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- for(i=0;i<que->projection_count;i++) {
- ret = cal_ipc_marshal_uint((que->projection[i]), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_uint() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
-
- ret = cal_ipc_marshal_int((que->sort_property_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((int)(que->asc), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((int)(que->distinct), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_list(const pims_ipc_data_h ipc_data, calendar_list_h* list)
-{
- int count = 0, i = 0;
- calendar_record_h record;
- int ret = CALENDAR_ERROR_NONE;
-
- RETVM_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER, "list is NULL");
- RETVM_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER, "ipc_data is NULL");
-
- ret = calendar_list_create(list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_list_create() Fail(%d)", ret);
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &(count));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- for(i=0;i<count;i++) {
- ret = cal_ipc_unmarshal_record(ipc_data, &record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
-
- ret = calendar_list_add(*list, record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_list_add() Fail(%d)", ret);
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- goto ERROR_RETURN;
- }
- }
- calendar_list_first(*list);
-
- return CALENDAR_ERROR_NONE;
-
-ERROR_RETURN:
- if (*list) {
- calendar_list_destroy(*list, true);
- *list = NULL;
- }
-
- return ret;
-}
-
-int cal_ipc_marshal_list(const calendar_list_h list, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- int count = 0;
- int i = 0;
- calendar_record_h record;
- RETV_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- ret = calendar_list_get_count(list, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_list_get_count() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int(count,ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- calendar_list_first(list);
-
- for(i=0;i<count;i++) {
- ret = calendar_list_get_current_record_p(list, &record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_list_get_current_record_p() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_record(record, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_record() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- calendar_list_next(list);
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_child_list(const pims_ipc_data_h ipc_data, calendar_list_h* list)
-{
- int ret = 0;
- unsigned int i = 0;
- int count = 0;
- calendar_record_h record;
-
- RETV_IF(NULL == list, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- ret = cal_ipc_unmarshal_int(ipc_data, &(count));
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- for(i=0;i<count;i++) {
- ret = cal_ipc_unmarshal_record(ipc_data, &record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = calendar_list_add(*list, record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("calendar_list_add() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_marshal_handle(calendar_h handle, const pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_s *h = (cal_s *)handle;
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
-
- RETVM_IF(CALENDAR_ERROR_NONE != ret, ret , "cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_NONE;
-}
-
-int cal_ipc_unmarshal_handle(const pims_ipc_data_h ipc_data, calendar_h *handle)
-{
- int ret = 0;
-
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == handle, CALENDAR_ERROR_INVALID_PARAMETER);
-
- ret = cal_handle_create(handle);
- RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_handle_create() Fail(%d)", ret);
- cal_s *h = (cal_s *)(*handle);
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#ifndef __CAL_IPC_MARSHAL__
-#define __CAL_IPC_MARSHAL__
-
-#include <pims-ipc-data.h>
-#include "calendar_types.h"
-#include "cal_typedef.h"
-#include "cal_record.h"
-
-typedef int (*cal_ipc_unmarshal_record_cb)(const pims_ipc_data_h ipc_data, calendar_record_h record);
-typedef int (*cal_ipc_marshal_record_cb)(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-typedef struct {
- cal_ipc_unmarshal_record_cb unmarshal_record;
- cal_ipc_marshal_record_cb marshal_record;
-} cal_ipc_marshal_record_plugin_cb_s;
-
-int cal_ipc_unmarshal_record(const pims_ipc_data_h ipc_data, calendar_record_h* precord);
-int cal_ipc_marshal_record(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-int cal_ipc_unmarshal_char(const pims_ipc_data_h ipc_data, char** ppbufchar);
-int cal_ipc_unmarshal_int(const pims_ipc_data_h data, int *pout);
-int cal_ipc_unmarshal_uint(const pims_ipc_data_h data, unsigned int *pout);
-int cal_ipc_unmarshal_lli(const pims_ipc_data_h data, long long int *pout);
-int cal_ipc_unmarshal_long(const pims_ipc_data_h data, long *pout);
-int cal_ipc_unmarshal_double(const pims_ipc_data_h data, double *pout);
-int cal_ipc_unmarshal_caltime(const pims_ipc_data_h data, calendar_time_s *pout);
-int cal_ipc_unmarshal_record_common(const pims_ipc_data_h ipc_data, cal_record_s* common);
-
-int cal_ipc_marshal_char(const char* bufchar, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_int(const int in, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_uint(const unsigned int in, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_lli(const long long int in, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_long(const long in, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_double(const double in, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_caltime(const calendar_time_s in, pims_ipc_data_h ipc_data);
-int cal_ipc_marshal_record_common(const cal_record_s* common, pims_ipc_data_h ipc_data);
-
-int cal_ipc_unmarshal_query(const pims_ipc_data_h ipc_data, calendar_query_h *query);
-int cal_ipc_marshal_query(const calendar_query_h query, pims_ipc_data_h ipc_data);
-int cal_ipc_unmarshal_list(const pims_ipc_data_h ipc_data, calendar_list_h *list);
-int cal_ipc_marshal_list(const calendar_list_h list, pims_ipc_data_h ipc_data);
-
-int cal_ipc_unmarshal_child_list(const pims_ipc_data_h ipc_data, calendar_list_h* list);
-
-int cal_ipc_marshal_handle(calendar_h handle, const pims_ipc_data_h ipc_data);
-int cal_ipc_unmarshal_handle(const pims_ipc_data_h ipc_data, calendar_h *handle);
-
-/*
- * for property_id
- */
-#define CAL_IPC_CHECK_PROPERTIES_FLAG(src) (CAL_IPC_CHECK_PROJECTION(src) || CAL_IPC_CHECK_DIRTY(src))
-#define CAL_IPC_CHECK_PROJECTION(src) ((src) & (unsigned char)CAL_PROPERTY_FLAG_PROJECTION)
-#define CAL_IPC_CHECK_DIRTY(src) ((src) & (unsigned char)CAL_PROPERTY_FLAG_DIRTY)
-
-#endif /* __CAL_IPC_MARSHAL__ */
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-
-static int _cal_ipc_unmarshal_alarm(const pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_alarm(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_alarm_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_alarm,
- .marshal_record = _cal_ipc_marshal_alarm
-};
-
-static int _cal_ipc_unmarshal_alarm(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_alarm_s* palarm = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
-
- palarm = (cal_alarm_s*) record;
-
- /* read only or primary/secondary key */
- ret = cal_ipc_unmarshal_int(ipc_data, &palarm->id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &palarm->parent_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &palarm->is_deleted);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &palarm->remind_tick);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&palarm->remind_tick_unit);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &palarm->alarm_description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &palarm->alarm_summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &palarm->alarm_action);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &palarm->alarm_attach);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_caltime(ipc_data, &palarm->alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_alarm(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_alarm_s* palarm = (cal_alarm_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == palarm, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* read only or primary/secondary key */
- ret = cal_ipc_marshal_int((palarm->id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((palarm->parent_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((palarm->is_deleted), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((palarm->remind_tick), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((palarm->remind_tick_unit), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((palarm->alarm_description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((palarm->alarm_summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((palarm->alarm_action), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((palarm->alarm_attach), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((palarm->alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-
-static int _cal_ipc_unmarshal_attendee(const pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_attendee(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_attendee_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_attendee,
- .marshal_record = _cal_ipc_marshal_attendee
-};
-
-static int _cal_ipc_unmarshal_attendee(const pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_attendee_s* pattendee = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
-
- pattendee = (cal_attendee_s*) record;
-
- /* read only or primary/secondary key */
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->parent_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_number);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->attendee_cutype);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->attendee_ct_index);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_uid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_group);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_email);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->attendee_role);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->attendee_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pattendee->attendee_rsvp);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_delegatee_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_delegator_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_char(ipc_data, &pattendee->attendee_member);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_attendee(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_attendee_s* pattendee = (cal_attendee_s*) record;
-
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == pattendee, CALENDAR_ERROR_INVALID_PARAMETER);
-
- /* read only or primary/secondary key */
- ret = cal_ipc_marshal_int((pattendee->id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((pattendee->parent_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_number), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((pattendee->attendee_cutype), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((pattendee->attendee_ct_index), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_uid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_group), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_email), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((pattendee->attendee_role), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((pattendee->attendee_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_int((pattendee->attendee_rsvp), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_delegatee_uri), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_delegator_uri), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_char((pattendee->attendee_member), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d), ret");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_calendar(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_calendar(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_calendar_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_calendar,
- .marshal_record = _cal_ipc_marshal_calendar
-};
-
-static int _cal_ipc_unmarshal_calendar(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_book_s* pcalendar = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pcalendar = (cal_book_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pcalendar->index);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pcalendar->store_type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->uid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_long(ipc_data, &pcalendar->updated);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_long() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->color);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pcalendar->visibility);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pcalendar->sync_event);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pcalendar->account_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->sync_data2);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->sync_data3);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pcalendar->sync_data4);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pcalendar->mode);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_calendar(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_book_s* pcalendar = (cal_book_s*)record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pcalendar, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pcalendar->index), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pcalendar->store_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->uid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_long((pcalendar->updated), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_long() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->color), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pcalendar->visibility), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pcalendar->sync_event), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pcalendar->account_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->sync_data2), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->sync_data3), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pcalendar->sync_data4), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pcalendar->mode), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_event(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_event(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_event_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_event,
- .marshal_record = _cal_ipc_marshal_event
-};
-
-static int _cal_ipc_unmarshal_event(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_event_s *pevent = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pevent = (cal_event_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->index);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->categories);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->exdate);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&pevent->event_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&pevent->priority);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->timezone);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->contact_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->busy_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->sensitivity);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->meeting_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->uid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->organizer_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->organizer_email);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->original_event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pevent->latitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pevent->longitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->email_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &pevent->created_time);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->is_deleted);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &pevent->last_mod);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->freq);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->range_type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pevent->until);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->interval);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->bysecond);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->byminute);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->byhour);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->byday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->bymonthday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->byyearday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->byweekno);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->bymonth);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->bysetpos);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->wkst);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->recurrence_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->rdate);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->has_attendee);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->has_alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->system_type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_long(ipc_data, &pevent->updated);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_long() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->sync_data2);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->sync_data3);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->sync_data4);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pevent->start);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->start_tzid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pevent->end);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pevent->end_tzid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pevent->is_allday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_child_list(ipc_data, (calendar_list_h *)&pevent->alarm_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_child_list(ipc_data, (calendar_list_h *)&pevent->attendee_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_child_list(ipc_data, (calendar_list_h *)&pevent->exception_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_child_list(ipc_data, (calendar_list_h *)&pevent->extended_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_event(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_event_s* pevent = (cal_event_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pevent, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pevent->index), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->categories), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->exdate), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->event_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->priority), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->timezone), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->contact_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->busy_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->sensitivity), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->meeting_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->uid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->organizer_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->organizer_email), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->original_event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pevent->latitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pevent->longitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->email_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((pevent->created_time), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->is_deleted), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((pevent->last_mod), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->freq), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->range_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pevent->until), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->count), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->interval), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->bysecond), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->byminute), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->byhour), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->byday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->bymonthday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->byyearday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->byweekno), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->bymonth), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->bysetpos), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->wkst), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->recurrence_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->rdate), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->has_attendee), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->has_alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->system_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_long((pevent->updated), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_long() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->sync_data2), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->sync_data3), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->sync_data4), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pevent->start), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->start_tzid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pevent->end), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pevent->end_tzid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pevent->is_allday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_list((calendar_list_h)pevent->alarm_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_list((calendar_list_h)pevent->attendee_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_list((calendar_list_h)pevent->exception_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_list((calendar_list_h)pevent->extended_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_extended(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_extended(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_extended_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_extended,
- .marshal_record = _cal_ipc_marshal_extended
-};
-
-static int _cal_ipc_unmarshal_extended(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_extended_s* pextended = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pextended = (cal_extended_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pextended->id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pextended->record_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pextended->record_type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pextended->key);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pextended->value);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_extended(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_extended_s* pextended = (cal_extended_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pextended, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pextended->id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pextended->record_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pextended->record_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pextended->key), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pextended->value), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_instance_allday(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_instance_allday(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_allday_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_instance_allday,
- .marshal_record = _cal_ipc_marshal_instance_allday
-};
-
-static int _cal_ipc_unmarshal_instance_allday(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_instance_allday_s* pinstanceallday = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pinstanceallday = (cal_instance_allday_s*) record;
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstanceallday->start);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstanceallday->end);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->busy_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->event_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->priority);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->sensitivity);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->has_rrule);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstanceallday->latitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstanceallday->longitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->has_alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->original_event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &pinstanceallday->last_mod);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->is_allday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_instance_allday(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_instance_allday_s* pinstanceallday = (cal_instance_allday_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pinstanceallday, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pinstanceallday->event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstanceallday->start), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstanceallday->end), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->busy_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->event_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->priority), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->sensitivity), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->has_rrule), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstanceallday->latitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstanceallday->longitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->has_alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->original_event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((pinstanceallday->last_mod), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->is_allday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_instance_allday_extended(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_instance_allday_extended(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_allday_extended_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_instance_allday_extended,
- .marshal_record = _cal_ipc_marshal_instance_allday_extended
-};
-
-static int _cal_ipc_unmarshal_instance_allday_extended(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_instance_allday_extended_s* pinstanceallday = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pinstanceallday = (cal_instance_allday_extended_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstanceallday->start);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstanceallday->end);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->busy_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->event_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->priority);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->sensitivity);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->has_rrule);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstanceallday->latitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstanceallday->longitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->has_alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->original_event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &pinstanceallday->last_mod);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->organizer_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->categories);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->has_attendee);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->sync_data2);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->sync_data3);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstanceallday->sync_data4);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstanceallday->is_allday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_instance_allday_extended(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_instance_allday_extended_s* pinstanceallday = (cal_instance_allday_extended_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pinstanceallday, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pinstanceallday->event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstanceallday->start), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstanceallday->end), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->busy_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->event_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->priority), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->sensitivity), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->has_rrule), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstanceallday->latitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstanceallday->longitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->has_alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->original_event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((pinstanceallday->last_mod), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->organizer_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->categories), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->has_attendee), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->sync_data2), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->sync_data3), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstanceallday->sync_data4), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstanceallday->is_allday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_instance_normal(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_instance_normal(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_normal_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_instance_normal,
- .marshal_record = _cal_ipc_marshal_instance_normal
-};
-
-static int _cal_ipc_unmarshal_instance_normal(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_instance_normal_s* pinstancenormal = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pinstancenormal = (cal_instance_normal_s*) record;
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstancenormal->start);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstancenormal->end);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->busy_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->event_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->priority);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->sensitivity);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->has_rrule);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstancenormal->latitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstancenormal->longitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->has_alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->original_event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &pinstancenormal->last_mod);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_instance_normal(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_instance_normal_s* pinstancenormal = (cal_instance_normal_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pinstancenormal, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pinstancenormal->event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstancenormal->start), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstancenormal->end), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->busy_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->event_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->priority), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->sensitivity), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->has_rrule), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstancenormal->latitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstancenormal->longitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->has_alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->original_event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((pinstancenormal->last_mod), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_instance_normal_extended(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_instance_normal_extended(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_instance_normal_extended_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_instance_normal_extended,
- .marshal_record = _cal_ipc_marshal_instance_normal_extended
-};
-
-static int _cal_ipc_unmarshal_instance_normal_extended(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_instance_normal_extended_s* pinstancenormal = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pinstancenormal = (cal_instance_normal_extended_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstancenormal->start);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pinstancenormal->end);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->busy_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->event_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->priority);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->sensitivity);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->has_rrule);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstancenormal->latitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &pinstancenormal->longitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->has_alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->original_event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &pinstancenormal->last_mod);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->organizer_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->categories);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &pinstancenormal->has_attendee);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->sync_data2);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->sync_data3);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &pinstancenormal->sync_data4);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_instance_normal_extended(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_instance_normal_extended_s* pinstancenormal = (cal_instance_normal_extended_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pinstancenormal, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pinstancenormal->event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstancenormal->start), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((pinstancenormal->end), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->busy_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->event_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->priority), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->sensitivity), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->has_rrule), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstancenormal->latitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((pinstancenormal->longitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->has_alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->original_event_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((pinstancenormal->last_mod), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->organizer_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->categories), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pinstancenormal->has_attendee), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->sync_data2), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->sync_data3), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((pinstancenormal->sync_data4), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_search(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_search(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_search_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_search,
- .marshal_record = _cal_ipc_marshal_search
-};
-
-static int _cal_ipc_unmarshal_search_value(pims_ipc_data_h ipc_data, cal_search_value_s* pvalue);
-static int _cal_ipc_marshal_search_value(const cal_search_value_s* pvalue, pims_ipc_data_h ipc_data);
-
-static int _cal_ipc_unmarshal_search(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_search_s* psearch = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
-
- psearch = (cal_search_s*) record;
-
- int count = 0,i = 0;
- ret = cal_ipc_unmarshal_int(ipc_data, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- for(i=0;i<count;i++) {
- cal_search_value_s* value_data = NULL;
- value_data = calloc(1, sizeof(cal_search_value_s));
- if (NULL == value_data) {
- ERR("calloc() Fail");
- return CALENDAR_ERROR_OUT_OF_MEMORY;
- }
-
- ret = _cal_ipc_unmarshal_search_value(ipc_data, value_data);
- if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(value_data);
- ERR("_cal_ipc_unmarshal_search_value() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- psearch->values = g_slist_append(psearch->values, value_data);
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_search(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_search_s* psearch = (cal_search_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == psearch, CALENDAR_ERROR_INVALID_PARAMETER);
-
- if (psearch->values) {
- int count = g_slist_length(psearch->values);
- GSList *cursor = psearch->values;
- cal_search_value_s* value_data;
-
- ret = cal_ipc_marshal_int(count, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- while (cursor) {
- value_data = (cal_search_value_s *)cursor->data;
- if (NULL == value_data) {
- cursor = g_slist_next(cursor);
- continue;
- }
- ret = _cal_ipc_marshal_search_value((const cal_search_value_s*)value_data, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("_cal_ipc_marshal_search_value() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- cursor = g_slist_next(cursor);
- }
-
- }
- else {
- ret = cal_ipc_marshal_int(0, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_unmarshal_search_value(pims_ipc_data_h ipc_data, cal_search_value_s* pvalue)
-{
- int ret = 0;
- ret = cal_ipc_unmarshal_int(ipc_data, &pvalue->property_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
- ret = cal_ipc_unmarshal_char(ipc_data, &pvalue->value.s);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
- ret = cal_ipc_unmarshal_int(ipc_data, &pvalue->value.i);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- ret = cal_ipc_unmarshal_double(ipc_data, &pvalue->value.d);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
- ret = cal_ipc_unmarshal_lli(ipc_data, &pvalue->value.lli);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
- ret = cal_ipc_unmarshal_caltime(ipc_data, &pvalue->value.caltime);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else {
- ERR("invalid parameter (property:%d)",pvalue->property_id);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_search_value(const cal_search_value_s* pvalue, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- ret = cal_ipc_marshal_int(pvalue->property_id, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
- ret = cal_ipc_marshal_char(pvalue->value.s, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
- ret = cal_ipc_marshal_int(pvalue->value.i, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- ret = cal_ipc_marshal_double(pvalue->value.d, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
- ret = cal_ipc_marshal_lli(pvalue->value.lli, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(pvalue->property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
- ret = cal_ipc_marshal_caltime(pvalue->value.caltime, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- }
- else {
- ERR("invalid parameter (property:%d)",pvalue->property_id);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_timezone(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_timezone(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_timezone_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_timezone,
- .marshal_record = _cal_ipc_marshal_timezone
-};
-
-static int _cal_ipc_unmarshal_timezone(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_timezone_s* ptimezone = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- ptimezone = (cal_timezone_s*) record;
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->index);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->tz_offset_from_gmt);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptimezone->standard_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->std_start_month);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->std_start_position_of_week);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->std_start_day);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->std_start_hour);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->standard_bias);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptimezone->day_light_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->day_light_start_month);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->day_light_start_position_of_week);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->day_light_start_day);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->day_light_start_hour);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->day_light_bias);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptimezone->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_timezone(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_timezone_s* ptimezone = (cal_timezone_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == ptimezone, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((ptimezone->index), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->tz_offset_from_gmt), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptimezone->standard_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->std_start_month), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->std_start_position_of_week), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->std_start_day), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->std_start_hour), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->standard_bias), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptimezone->day_light_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->day_light_start_month), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->day_light_start_position_of_week), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->day_light_start_day), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->day_light_start_hour), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->day_light_bias), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptimezone->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-#include "cal_view.h"
-
-static int _cal_ipc_unmarshal_todo(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_todo(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_todo_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_todo,
- .marshal_record = _cal_ipc_marshal_todo
-};
-
-static int _cal_ipc_unmarshal_todo(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_todo_s* ptodo = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- ptodo = (cal_todo_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->index);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->summary);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->description);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->location);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->categories);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&ptodo->todo_status);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, (int*)&ptodo->priority);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->sensitivity);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->uid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &ptodo->latitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_double(ipc_data, &ptodo->longitude);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &ptodo->created_time);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &ptodo->completed_time);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->progress);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->is_deleted);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_lli(ipc_data, &ptodo->last_mod);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->freq);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->range_type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &ptodo->until);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->interval);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->bysecond);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->byminute);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->byhour);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->byday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->bymonthday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->byyearday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->byweekno);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->bymonth);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->bysetpos);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->wkst);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->has_alarm);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_long(ipc_data, &ptodo->updated);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_long() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->sync_data1);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->sync_data2);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->sync_data3);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->sync_data4);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &ptodo->start);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->start_tzid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_caltime(ipc_data, &ptodo->due);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->due_tzid);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->organizer_name);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_char(ipc_data, &ptodo->organizer_email);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->has_attendee);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data, &ptodo->is_allday);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_unmarshal_list(ipc_data, (calendar_list_h *)&ptodo->alarm_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_list(ipc_data, (calendar_list_h *)&ptodo->attendee_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_list(ipc_data, (calendar_list_h *)&ptodo->extended_list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_todo(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_todo_s* ptodo = (cal_todo_s*)record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == ptodo, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((ptodo->index), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->calendar_id), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->summary), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->description), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->location), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->categories), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->todo_status), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->priority), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->sensitivity), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->uid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((ptodo->latitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_double((ptodo->longitude), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_double() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((ptodo->created_time), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((ptodo->completed_time), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->progress), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->is_deleted), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_lli((ptodo->last_mod), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_lli() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->freq), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->range_type), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((ptodo->until), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->count), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->interval), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->bysecond), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->byminute), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->byhour), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->byday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->bymonthday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->byyearday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->byweekno), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->bymonth), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->bysetpos), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->wkst), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->has_alarm), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_long((ptodo->updated), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_long() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->sync_data1), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->sync_data2), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->sync_data3), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->sync_data4), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((ptodo->start), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->start_tzid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_caltime((ptodo->due), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_caltime() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->due_tzid), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->organizer_name), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_char((ptodo->organizer_email), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_char() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->has_attendee), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((ptodo->is_allday), ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- ret = cal_ipc_marshal_list((calendar_list_h)ptodo->alarm_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_list((calendar_list_h)ptodo->attendee_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_list((calendar_list_h)ptodo->extended_list, ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "cal_internal.h"
-#include "cal_ipc_marshal.h"
-
-static int _cal_ipc_unmarshal_updated_info(pims_ipc_data_h ipc_data, calendar_record_h record);
-static int _cal_ipc_marshal_updated_info(const calendar_record_h record, pims_ipc_data_h ipc_data);
-
-cal_ipc_marshal_record_plugin_cb_s cal_ipc_record_updated_info_plugin_cb = {
- .unmarshal_record = _cal_ipc_unmarshal_updated_info,
- .marshal_record = _cal_ipc_marshal_updated_info
-};
-
-static int _cal_ipc_unmarshal_updated_info(pims_ipc_data_h ipc_data, calendar_record_h record)
-{
- int ret = 0;
- cal_updated_info_s* pupdatedinfo = NULL;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == record, CALENDAR_ERROR_NO_DATA);
-
- pupdatedinfo = (cal_updated_info_s*) record;
-
- ret = cal_ipc_unmarshal_int(ipc_data,&pupdatedinfo->type);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data,&pupdatedinfo->id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data,&pupdatedinfo->calendar_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_unmarshal_int(ipc_data,&pupdatedinfo->version);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
-
-static int _cal_ipc_marshal_updated_info(const calendar_record_h record, pims_ipc_data_h ipc_data)
-{
- int ret = 0;
- cal_updated_info_s* pupdatedinfo = (cal_updated_info_s*) record;
- RETV_IF(NULL == ipc_data, CALENDAR_ERROR_NO_DATA);
- RETV_IF(NULL == pupdatedinfo, CALENDAR_ERROR_NO_DATA);
-
- ret = cal_ipc_marshal_int((pupdatedinfo->type),ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pupdatedinfo->id),ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pupdatedinfo->calendar_id),ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- ret = cal_ipc_marshal_int((pupdatedinfo->version),ipc_data);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- return CALENDAR_ERROR_NONE;
-}
[D-BUS Service]
Name=ALARM.acalendar-service
Exec=/bin/false
-SystemdService=calendar-serviced.service
User=app
+SystemdService=calendar-service-alarm.service
--- /dev/null
+[Unit]
+Description=Calendar Service Alarm
+
+[Service]
+Type=simple
+BusName=ALARM.acalendar-service
+Environment="TIMEOUT=0"
+ExecStart=/usr/bin/calendar-serviced $TIMEOUT
+
+[Install]
+WantedBy=default.target
Name: calendar-service
Summary: DB library for calendar
-Version: 0.1.153
+Version: 0.1.154
Release: 1
Group: System/Libraries
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-Source1: calendar-serviced.service
-Source2: calendar-serviced.socket
-Source3: ALARM.acalendar-service.service
+Source1: %{name}d.service
+Source2: org.tizen.calendar_service.dbus.service
+Source3: ALARM.a%{name}.service
+Source4: org.tizen.calendar_service.dbus.conf.in
+Source5: %{name}-alarm.service
%if "%{?tizen_profile_name}" == "wearable"
ExcludeArch: %{arm} %ix86 x86_64
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(icu-i18n)
-BuildRequires: pkgconfig(pims-ipc)
BuildRequires: pkgconfig(accounts-svc)
BuildRequires: pkgconfig(contacts-service2)
BuildRequires: pkgconfig(alarm-service)
%prep
%setup -q
-
+cp %{SOURCE4} .
%build
export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+
%cmake . -DBIN_INSTALL_DIR:PATH=%{_bindir} \
-DMAJORVER=${MAJORVER} \
-DFULLVER=%{version}
-
make %{?jobs:-j%jobs}
%install
%make_install
mkdir -p %{buildroot}%{_unitdir_user}/default.target.wants
-install -m 0644 %SOURCE1 %{buildroot}%{_unitdir_user}/calendar-serviced.service
-ln -s ../calendar-serviced.service %{buildroot}%{_unitdir_user}/default.target.wants/calendar-serviced.service
+install -m 0644 %SOURCE1 %{buildroot}%{_unitdir_user}/%{name}d.service
+ln -s ../%{name}d.service %{buildroot}%{_unitdir_user}/default.target.wants/%{name}d.service
+install -m 0644 %SOURCE5 %{buildroot}%{_unitdir_user}/%{name}-alarm.service
-mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
-install -m 0644 %SOURCE2 %{buildroot}%{_unitdir_user}/calendar-serviced.socket
-ln -s ../calendar-serviced.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/calendar-serviced.socket
+mkdir -p %{buildroot}%{_datadir}/license
+cp LICENSE.APLv2 %{buildroot}%{_datadir}/license/%{name}
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
+install -m 0644 %SOURCE2 %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.calendar_service.dbus.service
# alarm dbus service file
-mkdir -p %{buildroot}/usr/share/dbus-1/system-services
-cp -a %SOURCE3 %{buildroot}/usr/share/dbus-1/system-services
+mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
+cp -a %SOURCE3 %{buildroot}%{_datadir}/dbus-1/system-services
%post
/sbin/ldconfig
%manifest calendar-service.manifest
%defattr(-,root,root,-)
%{_bindir}/calendar-serviced*
-%{_libdir}/libcalendar-service2.so.*
-%{_unitdir_user}/default.target.wants/calendar-serviced.service
-%{_unitdir_user}/calendar-serviced.service
-%{_unitdir_user}/sockets.target.wants/calendar-serviced.socket
-%{_unitdir_user}/calendar-serviced.socket
-/usr/share/license/%{name}
-/usr/share/dbus-1/system-services/ALARM.acalendar-service.service
+%{_libdir}/lib%{name}2.so.*
+%{_unitdir_user}/default.target.wants/%{name}d.service
+%{_unitdir_user}/%{name}d.service
+%{_unitdir_user}/%{name}-alarm.service
+%{_datadir}/license/%{name}
+%{_datadir}/dbus-1/system-services/ALARM.acalendar-service.service
+%{_datadir}/dbus-1/system-services/org.tizen.calendar_service.dbus.service
+%config %{_sysconfdir}/dbus-1/system.d/org.tizen.calendar_service.dbus.conf
%files devel
%defattr(-,root,root,-)
[Unit]
Description=Calendar Service daemon
-After=contacts-service.service
-Requires=contacts-service.service
[Service]
Type=simple
-ExecStart=/usr/bin/calendar-serviced
-Restart=always
-RestartSec=1
+BusName=org.tizen.calendar_service.dbus
+Environment="TIMEOUT=0"
+ExecStart=/usr/bin/calendar-serviced $TIMEOUT
[Install]
WantedBy=default.target
+++ /dev/null
-[Unit]
-Description=Calendar Service socket
-
-[Socket]
-ListenStream=/run/user/%U/.cal_svc_ipc
-Service=calendar-serviced.service
-
-[Install]
-WantedBy=sockets.target
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy user="root">
+ <allow own="org.tizen.calendar_service.dbus"/>
+ <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
+ <allow receive_sender="@DBUS_INTERFACE@"/>
+ </policy>
+ <policy user="system">
+ <allow own="org.tizen.calendar_service.dbus"/>
+ <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
+ <allow receive_sender="@DBUS_INTERFACE@"/>
+ </policy>
+ <policy group="users">
+ <allow own="org.tizen.calendar_service.dbus"/>
+ <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
+ </policy>
+ <policy at_console="true">
+ <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
+ </policy>
+ <policy context="default">
+ <allow send_destination="org.tizen.calendar_service.dbus"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="insert_record"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="update_record"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="delete_record"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="replace_record"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="insert_records"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="update_records"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="delete_records"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="replace_records"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_record"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_all_records"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_records_with_query"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_count"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_count_with_query"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_current_version"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_changes_by_version"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_last_change_version"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="get_changes_exception_by_version"
+ privilege="http://tizen.org/privilege/calendar.read"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="clean_after_sync"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="insert_vcalendars"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ <check send_destination="@DBUS_INTERFACE@"
+ send_interface="@DBUS_INTERFACE@" send_member="replace_vcalendars"
+ privilege="http://tizen.org/privilege/calendar.write"/>
+ </policy>
+</busconfig>
+
--- /dev/null
+[D-BUS Service]
+Name=org.tizen.calendar_service.dbus
+Exec=/bin/false
+User=root
+SystemdServier=calendar-serviced.service
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/ipc)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/dbus)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/db)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/schema)
FILE(GLOB DAEMON_SRCS
- ${CMAKE_SOURCE_DIR}/common/ipc/*.c
+ ${CMAKE_SOURCE_DIR}/common/dbus/*.c
${CMAKE_SOURCE_DIR}/common/*.c*
db/*.c
*.c)
+SET(DAEMON_SRCS ${DAEMON_SRCS} ${CMAKE_SOURCE_DIR}/common/dbus/cal_dbus.c)
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/common/dbus/cal_dbus.c
+ PROPERTIES GENERATED TRUE)
pkg_check_modules(daemon_pkgs REQUIRED
glib-2.0
contacts-service2
libtzplatform-config
capi-appfw-package-manager
- pims-ipc
dlog
capi-base-common
accounts-svc
capi-appfw-application
- libsmack)
+ libsmack
+ gio-2.0
+ gio-unix-2.0)
INCLUDE_DIRECTORIES(${daemon_pkgs_INCLUDE_DIRS})
LINK_DIRECTORIES(${daemon_pkgs_LIBRARY_DIRS})
ADD_DEFINITIONS("-DCAL_IPC_SERVER")
+ADD_DEFINITIONS("-DCAL_DBUS_INTERFACE=\"${DBUS_INTERFACE}\"")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--hash-style=both -pie")
ADD_EXECUTABLE(${DAEMON} ${DAEMON_SRCS})
+ADD_DEPENDENCIES(${DAEMON} GENERATED_DBUS_CODE)
SET_TARGET_PROPERTIES(${DAEMON} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
TARGET_LINK_LIBRARIES(${DAEMON} ${daemon_pkgs_LIBRARIES})
#include <signal.h>
#include <string.h>
#include <sys/smack.h>
-#include <pims-ipc-svc.h>
#include "calendar_db.h"
#include "cal_internal.h"
typedef struct {
unsigned int thread_id;
- pims_ipc_h ipc;
+ void *ipc;
char *smack_label;
int *write_list;
int write_list_count;
static GList *__thread_list = NULL;
static int have_smack = CAL_SMACK_NOT_CHECKED;
-static void _cal_access_control_disconnected_cb(pims_ipc_h ipc, void *user_data);
static cal_permission_info_s* _cal_access_control_find_permission_info(unsigned int thread_id)
{
sqlite3_finalize(stmt);
}
-void cal_access_control_set_client_info(pims_ipc_h ipc, const char *smack_label)
+void cal_access_control_set_client_info(void *ipc, const char *smack_label)
{
unsigned int thread_id = (unsigned int)pthread_self();
cal_permission_info_s *info = NULL;
info->smack_label = cal_strdup(smack_label);
_cal_access_control_set_permission_info(info);
- /* for close DB or free access_control when client is disconnected */
- if (info->ipc)
- pims_ipc_svc_set_client_disconnected_cb(_cal_access_control_disconnected_cb,NULL);
-
cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
}
cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
}
-bool cal_access_control_have_permission(pims_ipc_h ipc, cal_permission_e permission)
-{
- have_smack = _cal_have_smack();
- if (CAL_SMACK_DISABLED == have_smack)
- return true;
-
- if (NULL == ipc) // calendar-service daemon
- return true;
-
- if ((CAL_PERMISSION_READ & permission) && !pims_ipc_svc_check_privilege(ipc, CAL_PRIVILEGE_READ))
- return false;
-
- if ((CAL_PERMISSION_WRITE & permission) && !pims_ipc_svc_check_privilege(ipc, CAL_PRIVILEGE_WRITE))
- return false;
-
- return true;
-}
-
char* cal_access_control_get_label(void)
{
unsigned int thread_id = (unsigned int)pthread_self();
return false;
}
-static void _cal_access_control_disconnected_cb(pims_ipc_h ipc, void *user_data)
-{
- CAL_FN_CALL();
- cal_permission_info_s *info = NULL;
-
- cal_mutex_lock(CAL_MUTEX_ACCESS_CONTROL);
- info = (cal_permission_info_s *)user_data;
- if (info) {
- INFO("Thread(0x%x), info(%p)", info->thread_id, info);
- free(info->smack_label);
- free(info->write_list);
- __thread_list = g_list_remove(__thread_list, info);
- free(info);
- }
- cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
- /*
- * if client did not call disconnect function such as disconnect
- * DB will be closed in cal_db_internal_disconnect()
- */
- cal_service_internal_disconnect();
-}
-
int cal_is_owner(int book_id)
{
int ret;
#ifndef __CALENDAR_SVC_ACCESS_CONTROL_H__
#define __CALENDAR_SVC_ACCESS_CONTROL_H__
-#include <pims-ipc.h>
#include "cal_typedef.h"
#define CAL_PRIVILEGE_READ "http://tizen.org/privilege/calendar.read"
#define CAL_PRIVILEGE_WRITE "http://tizen.org/privilege/calendar.write"
-void cal_access_control_set_client_info(pims_ipc_h ipc, const char* smack_label);
+void cal_access_control_set_client_info(void *ipc, const char* smack_label);
void cal_access_control_unset_client_info(void);
char* cal_access_control_get_label(void);
void cal_access_control_reset(void); // reset read_list, write_list..
bool cal_access_control_have_write_permission(int book_id);
int cal_is_owner(int book_id);
-bool cal_access_control_have_permission(pims_ipc_h ipc, cal_permission_e permission);
#endif /* __CALENDAR_SVC_ACCESS_CONTROL_H__ */
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <glib-object.h>
#include <glib.h>
#include <grp.h>
#include <sys/param.h>
#include <unistd.h>
-#include <alarm.h>
-#include <contacts.h>
-#include <account.h>
+#include <sys/param.h>
+#include <unistd.h>
#include "calendar.h"
#include "cal_typedef.h"
#include "cal_internal.h"
-#include "cal_ipc.h"
-#include "cal_server_ipc.h"
#include "cal_inotify.h"
-#include "cal_db.h" // CAL_SECURITY_FILE_GROUP
-#include "cal_server_contacts.h"
+#include "cal_db.h"
+#include "cal_access_control.h"
+#include "cal_db_plugin_calendar_helper.h"
+#include "cal_time.h"
#include "cal_server_alarm.h"
+#include "cal_server_contacts.h"
#include "cal_server_calendar_delete.h"
#include "cal_server_schema.h"
#include "cal_server_update.h"
#include "cal_server_service.h"
-#include "cal_access_control.h"
-#include "cal_db_plugin_calendar_helper.h"
-#include "cal_time.h"
+#include "cal_server_account.h"
+#include "cal_server_dbus.h"
#define CAL_TIMEOUT_FOR_DECLARE 1
#define CAL_TIMEOUT_FOR_DEFAULT 0
-static account_subscribe_h cal_account_h = NULL;
GMainLoop* main_loop = NULL;
static int cal_timeout = 0;
main_loop = NULL;
}
-static gboolean _cal_server_timeout_cb(gpointer argv)
+static int _cal_server_init(void)
{
- int ret;
- int *try_count = (int *)argv;
- DBG("called count(%d)", *try_count);
- if (*try_count > 2)
- {
- ERR("Tried 3 times but Failed to contacts connect");
- return false;
- }
-
- ret = contacts_connect();
- if (CONTACTS_ERROR_NONE == ret)
- {
- DBG("contact connected");
- }
- else
- {
- ERR("Failed to connect (%d) times", *try_count + 1);
- *try_count += 1;
- return true;
- }
-
- ret = cal_server_contacts();
- return false;
-}
-
-static bool _cal_server_account_delete_cb(const char* event_type, int account_id, void* user_data)
-{
- CAL_FN_CALL();
-
- if (CAL_STRING_EQUAL == strcmp(event_type, ACCOUNT_NOTI_NAME_DELETE))
- {
- cal_db_delete_account(account_id);
- cal_server_contacts_delete(account_id);
- }
- return true;
-}
-
-static void _cal_server_init(void)
-{
- int ret;
- int on_contact = 0;
- int try_count = 0;
+ int ret = 0;
#if !GLIB_CHECK_VERSION(2,35,0)
g_type_init();
#endif
-
- //loop = g_main_loop_new(NULL, FALSE);
-
- //calendar_alarm_init();
-/*
- ret = contacts_connect();
- if (CONTACTS_ERROR_NONE != ret)
- {
- ERR("contacts_connect() Failed");
- g_timeout_add_seconds(30, _cal_server_timeout_cb, (gpointer)&try_count);
- }
- else
- {
- DBG("contacts connected");
- on_contact = 1;
- }
-*/
ret = cal_connect();
- if (CALENDAR_ERROR_NONE != ret)
- {
+ if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_connect() Failed");
return ret;
}
- cal_db_initialize_view_table();
-
- if (on_contact)
- {
-/* ret = cal_server_contacts();
- if (CALENDAR_ERROR_NONE != ret)
- {
- contacts_disconnect();
- ERR("cal_server_contacts() Failed");
- return -1;
- }
-
- cal_server_contacts_sync_start();
-*/ }
-
- // access_control
- cal_access_control_set_client_info(NULL, NULL);
+ cal_access_control_set_client_info(NULL, "calendar-service");
- ret = account_subscribe_create(&cal_account_h);
- if (ACCOUNT_ERROR_NONE == ret) {
- ret = account_subscribe_notification(cal_account_h, _cal_server_account_delete_cb, NULL);
- if (ACCOUNT_ERROR_NONE != ret) {
- DBG("account_subscribe_notification Failed (%d)", ret);
- }
- }
- else
- DBG("account_subscribe_create Failed (%d)", ret);
+ cal_db_initialize_view_table();
- cal_server_alarm_register();
cal_server_calendar_delete_start();
+ return CALENDAR_ERROR_NONE;
}
static void _cal_server_deinit(void)
{
- cal_disconnect();
-
- if (cal_account_h) {
- account_unsubscribe_notification(cal_account_h);
- cal_account_h = NULL;
- }
-
cal_access_control_unset_client_info();
+ cal_disconnect();
}
static int _cal_server_main(void)
{
main_loop = g_main_loop_new(NULL, FALSE);
- cal_server_ipc_run(main_loop);
+ g_main_loop_run(main_loop);
g_main_loop_unref(main_loop);
static void _cal_server_create_directory(const char* directory, mode_t mode)
{
- int ret = 0;
if (0 == access (directory, F_OK))
return;
_cal_server_set_directory_permission(CAL_NOTI_CALENDAR_CHANGED, 0660);
_cal_server_set_directory_permission(CAL_NOTI_EVENT_CHANGED, 0660);
_cal_server_set_directory_permission(CAL_NOTI_TODO_CHANGED, 0660);
- _cal_server_set_directory_permission(CAL_NOTI_IPC_READY, 0660);
}
int cal_server_get_timeout(void)
int main(int argc, char *argv[])
{
- INFO("server start");
- if (getuid() == 0) {
+ INFO("---------------------[SERVER START]------------------------");
+ if (getuid() == 0) { /* root */
gid_t glist[] = {CAL_SECURITY_FILE_GROUP};
if (setgroups(1, glist) < 0)
ERR("setgroups() Failed");
_cal_server_create_file();
cal_server_schema_check();
- cal_server_alarm_init();
cal_server_update();
_cal_server_init();
- cal_server_ipc_init();
+ cal_server_alarm_init();
+ cal_server_account_init();
+
+ guint id;
+ id = cal_server_dbus_init();
_cal_server_main();
cal_time_u_cleanup();
-
- cal_server_ipc_deinit();
- _cal_server_deinit();
+ cal_server_account_deinit();
cal_server_alarm_deinit();
+ _cal_server_deinit();
+ cal_server_dbus_deinit(id);
cal_inotify_deinit();
return 0;
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <pthread.h>
+#include <account.h>
+
+#include "calendar.h"
+#include "cal_typedef.h"
+#include "cal_internal.h"
+#include "cal_db_plugin_calendar_helper.h"
+#include "cal_server_contacts.h"
+
+static pthread_mutex_t cal_mutex_account = PTHREAD_MUTEX_INITIALIZER;
+static account_subscribe_h cal_account_h = NULL;
+
+static bool _noti_cb(const char* event_type, int account_id,
+ void* user_data)
+{
+ CAL_FN_CALL();
+
+ if (CAL_STRING_EQUAL == strcmp(event_type, ACCOUNT_NOTI_NAME_DELETE)) {
+ cal_db_delete_account(account_id);
+ cal_server_contacts_delete(account_id);
+ }
+ return true;
+}
+
+int cal_server_account_init(void)
+{
+ int ret = 0;
+
+ pthread_mutex_lock(&cal_mutex_account);
+ ret = account_subscribe_create(&cal_account_h);
+ if (ACCOUNT_ERROR_NONE != ret) {
+ ERR("account_subscribe_create() Fail(%d)", ret);
+ pthread_mutex_unlock(&cal_mutex_account);
+ return CALENDAR_ERROR_SYSTEM;
+ }
+
+ ret = account_subscribe_notification(cal_account_h, _noti_cb, NULL);
+ if (ACCOUNT_ERROR_NONE != ret) {
+ WARN("account_subscribe_notification Failed (%d)", ret);
+ }
+
+ pthread_mutex_unlock(&cal_mutex_account);
+ return CALENDAR_ERROR_NONE;
+}
+
+void cal_server_account_deinit(void)
+{
+ pthread_mutex_lock(&cal_mutex_account);
+
+ RET_IF(NULL == cal_account_h);
+
+ account_unsubscribe_notification(cal_account_h);
+ cal_account_h = NULL;
+
+ pthread_mutex_unlock(&cal_mutex_account);
+}
+
*
*/
-#ifndef __CAL_SERVER_REMINDER_H__
-#define __CAL_SERVER_REMINDER_H__
+#ifndef __CALENDAR_SVC_ACCOUNT_H__
+#define __CALENDAR_SVC_ACCOUNT_H__
-void cal_server_reminder_publish(char *p, int p_len);
-int cal_server_reminder_add_callback_data(char **p, char *key, char *value);
+int cal_server_account_init(void);
+void cal_server_account_deinit(void);
-#endif /* __CAL_SERVER_REMINDER_H__ */
+#endif /*__CALENDAR_SVC_ACCOUNT_H__ */
#include "cal_db_util.h"
#include "cal_db.h"
#include "cal_db_query.h"
-#include "cal_server_reminder.h"
+#include "cal_server_dbus.h"
#define CAL_SEARCH_LOOP_MAX 4
static bool __app_matched_cb(app_control_h app_control, const char *package, void *user_data)
{
+ CAL_FN_CALL();
+
int ret = 0;
struct alarm_ud *au = (struct alarm_ud *)user_data;
static void _cal_server_alarm_noti_with_control(GList *alarm_list)
{
+ CAL_FN_CALL();
RETM_IF(NULL == alarm_list, "No alarm list");
app_control_h app_control = NULL;
len += snprintf(extra+len, sizeof(extra)-len, "&%s=%d", "tick", ad->tick);
len += snprintf(extra+len, sizeof(extra)-len, "&%s=%d", "unit", ad->unit);
len += snprintf(extra+len, sizeof(extra)-len, "&%s=%d", "type", ad->record);
-
- cal_server_reminder_publish(extra, len);
+ cal_dbus_publish_reminder(len, extra);
l = g_list_next(l);
}
_cal_server_alarm_timechange_cb, NULL);
}
-static void __changed_cb(const char* view_uri, void* data)
+static void _changed_cb(const char* view_uri, void* data)
{
CAL_FN_CALL();
cal_server_alarm_register_next_alarm(time(NULL));
return 0;
}
-void cal_server_alarm_init(void)
+int cal_server_alarm_init(void)
{
+ CAL_FN_CALL();
+
int ret = 0;
_cal_server_alarm_set_timechange();
+ _cal_server_alarm_set_inotify(_changed_cb);
ret = alarmmgr_init("calendar-service");
- RETM_IF(ret < 0, "alarmmgr_init() Fail(%d)", ret);
-}
-
-void cal_server_alarm_register(void)
-{
- CAL_FN_CALL();
- int ret = 0;
+ if (ret < 0) {
+ ERR("alarmmgr_init() Fail(%d)", ret);
+ return CALENDAR_ERROR_SYSTEM;
+ }
ret = alarmmgr_set_cb(_alert_cb, NULL);
- RETM_IF(ret < 0, "alarmmgr_set_cb() Fail(%d)", ret);
- _cal_server_alarm_set_inotify(__changed_cb);
+ if (ret < 0) {
+ ERR("alarmmgr_set_cb() Fail(%d)", ret);
+ return CALENDAR_ERROR_SYSTEM;
+ }
+
cal_server_alarm_register_next_alarm(time(NULL));
+ return CALENDAR_ERROR_NONE;
}
void cal_server_alarm_deinit(void)
#ifndef __CAL_SERVER_ALARM_H__
#define __CAL_SERVER_ALARM_H__
-void cal_server_alarm_init(void);
+int cal_server_alarm_init(void);
void cal_server_alarm_deinit(void);
-void cal_server_alarm_register(void);
void cal_server_alarm_alert(time_t tt_alert);
int cal_server_alarm_register_next_alarm(time_t tt);
if (data->calendar_id_list)
g_list_free(data->calendar_id_list);
CAL_FREE(data);
- ERR("step_1 no_data");
-
return false;
}
data->step = STEP_2;
#include "cal_time.h"
#include "cal_access_control.h"
#include "cal_server_contacts.h"
-#include "cal_server_ipc.h"
#include "cal_server_service.h"
#include "cal_server_ondemand.h"
break;
}
- cal_access_control_set_client_info(NULL, NULL);
+ cal_access_control_set_client_info(NULL, "calendar-service");
while(1) {
if (CALENDAR_ERROR_NONE != _cal_server_contacts_sync()) {
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <gio/gio.h>
+
+#include "calendar.h"
+#include "cal_internal.h"
+#include "cal_typedef.h"
+#include "cal_handle.h"
+#include "cal_dbus_helper.h"
+#include "cal_dbus.h"
+#include "cal_db.h"
+#include "cal_db_util.h"
+#include "cal_server_dbus.h"
+#include "cal_utils.h"
+#include "cal_server_ondemand.h"
+
+static calDbus *dbus_object = NULL;
+static GMutex cal_server_dbus_sender;
+static GList *cal_sender_list; /* global list to care resource handle for each sender bus */
+
+typedef struct _cal_sender {
+ gchar *name;
+} cal_sender_s;
+
+calDbus* cal_dbus_get_object(void)
+{
+ return dbus_object;
+}
+
+static bool _has_sender(const char *name, GList **out_cursor)
+{
+ bool has_sender = false;
+
+ GList *cursor = NULL;
+ cursor = cal_sender_list;
+ while (cursor) {
+ cal_sender_s *sender = (cal_sender_s *)cursor->data;
+ if (NULL == sender) {
+ ERR("sender is NULL");
+ cursor = g_list_next(cursor);
+ continue;
+ }
+ if (CAL_STRING_EQUAL == g_strcmp0(sender->name, name)) {
+ DBG("sender[%s] is already existed", name);
+ has_sender = true;
+ if (out_cursor)
+ *out_cursor = cursor;
+ break;
+ }
+ cursor = g_list_next(cursor);
+ }
+ return has_sender;
+}
+
+static int _append_sender(const char *name)
+{
+ cal_sender_s *sender = NULL;
+ sender = calloc(1, sizeof(cal_sender_s));
+ if (NULL == sender) {
+ ERR("calloc() Fail");
+ return CALENDAR_ERROR_OUT_OF_MEMORY;
+ }
+ sender->name = cal_strdup(name);
+ DBG("sender name[%s]", sender->name);
+ cal_sender_list = g_list_append(cal_sender_list, sender);
+ return CALENDAR_ERROR_NONE;
+}
+
+static void _free_sender(void)
+{
+ g_list_free_full(cal_sender_list, free);
+ cal_sender_list = NULL;
+}
+
+static gboolean _handle_register_resource(calDbus *object,
+ GDBusMethodInvocation *invocation)
+{
+ CAL_FN_CALL();
+
+ int ret = 0;
+ const char *sender_name = NULL;
+ sender_name = g_dbus_method_invocation_get_sender(invocation);
+
+ g_mutex_lock(&cal_server_dbus_sender);
+ if (true == _has_sender(sender_name, NULL)) {
+ ERR("Already has sender");
+ g_mutex_unlock(&cal_server_dbus_sender);
+ return TRUE;
+ }
+ ret = _append_sender(sender_name);
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("_append_sender() Fail");
+ g_mutex_unlock(&cal_server_dbus_sender);
+ return TRUE;
+ }
+ DBG("append sender");
+ g_mutex_unlock(&cal_server_dbus_sender);
+
+ cal_dbus_complete_register_resource(object, invocation, ret);
+
+ return TRUE;
+}
+
+static gboolean _handle_unregister_resource(calDbus *object,
+ GDBusMethodInvocation *invocation)
+{
+ CAL_FN_CALL();
+
+ int ret = 0;
+ const char *sender_name = NULL;
+ sender_name = g_dbus_method_invocation_get_sender(invocation);
+
+ GList *cursor = NULL;
+ g_mutex_lock(&cal_server_dbus_sender);
+ if (true == _has_sender(sender_name, &cursor)) {
+ DBG("found sender[%s]", sender_name);
+ cal_sender_list = g_list_delete_link(cal_sender_list, cursor);
+ }
+
+ if (0 == g_list_length(cal_sender_list)) {
+ DBG("sender list is 0");
+ _free_sender();
+ }
+ g_mutex_unlock(&cal_server_dbus_sender);
+
+ cal_dbus_complete_unregister_resource(object, invocation, ret);
+
+ return TRUE;
+}
+
+static gboolean _handle_insert_record(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_record)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_record_h record = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_record(arg_record, &record);
+
+ int id = 0;
+ ret = cal_db_insert_record(record, &id);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_insert_record(object, invocation, id, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_update_record(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_record)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_record_h record = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_record(arg_record, &record);
+
+ ret = cal_db_update_record(record);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_update_record(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_delete_record(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *view_uri, int id)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ ret = cal_db_delete_record(view_uri, id);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_delete_record(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_replace_record(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_record, int id)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_record_h record = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_record(arg_record, &record);
+
+ ret = cal_db_replace_record(record, id);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_replace_record(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_insert_records(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_list)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_list_h list = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_list(arg_list, &list);
+
+ int *ids = NULL;
+ int count = 0;
+ ret = cal_db_insert_records(list, &ids, &count);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ GVariant *arg_ids = cal_dbus_utils_ids_to_gvariant(ids, count);
+ cal_dbus_complete_insert_records(object, invocation, arg_ids, count, version, ret);
+ cal_server_ondemand_start();
+
+ return TRUE;
+}
+
+static gboolean _handle_update_records(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_list)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_list_h list = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_list(arg_list, &list);
+
+ ret = cal_db_update_records(list);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_update_records(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_delete_records(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *view_uri, GVariant *arg_ids, int count)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+
+ int *ids = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ ret = cal_dbus_utils_gvariant_to_ids(arg_ids, count, &ids);
+
+ ret = cal_db_delete_records(view_uri, ids, count);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_delete_records(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_replace_records(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_list, GVariant *arg_ids, int count)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_list_h list = NULL;
+ int *ids = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_list(arg_list, &list);
+ ret = cal_dbus_utils_gvariant_to_ids(arg_ids, count, &ids);
+
+ ret = cal_db_replace_records(list, ids, count);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_replace_records(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_record(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *view_uri, int id)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ calendar_record_h record = NULL;
+ ret = cal_db_get_record(view_uri, id, &record);
+
+ GVariant *arg_record = cal_dbus_utils_record_to_gvariant(record);
+
+ cal_dbus_complete_get_record(object, invocation, arg_record, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_all_records(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *view_uri, int offset, int limit)
+{
+ CAL_FN_CALL();
+
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ calendar_list_h list = NULL;
+ ret = cal_db_get_all_records(view_uri, offset, limit, &list);
+
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ cal_dbus_complete_get_all_records(object, invocation, arg_list, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_records_with_query(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_query, int offset, int limit)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_query_h query = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_query(arg_query, &query);
+
+ calendar_list_h list = NULL;
+ ret = cal_db_get_records_with_query(query, offset, limit, &list);
+
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ cal_dbus_complete_get_records_with_query(object, invocation, arg_list, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_count(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *view_uri)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ int count = 0;
+ ret = cal_db_get_count(view_uri, &count);
+
+ cal_dbus_complete_get_count(object, invocation, count, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_count_with_query(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, GVariant *arg_query)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ calendar_query_h query = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_query(arg_query, &query);
+
+ int count = 0;
+ ret = cal_db_get_count_with_query(query, &count);
+
+ cal_dbus_complete_get_count_with_query(object, invocation, count, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_current_version(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ int version = 0;
+ ret = cal_db_get_current_version(&version);
+
+ cal_dbus_complete_get_current_version(object, invocation, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_changes_by_version(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *view_uri, int book_id, int in_version)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ calendar_list_h list = NULL;
+ int out_version = 0;
+ ret = cal_db_get_changes_by_version(view_uri, book_id, in_version,
+ &list, &out_version);
+
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ cal_dbus_complete_get_changes_by_version(object, invocation, arg_list, out_version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_get_changes_exception_by_version(calDbus *object,
+ GDBusMethodInvocation *invocation,
+ GVariant *arg_handle,
+ char *view_uri,
+ int original_id,
+ int version)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ calendar_list_h list = NULL;
+ ret = cal_db_get_changes_exception_by_version(view_uri, original_id,
+ version, &list);
+
+ GVariant *arg_list = cal_dbus_utils_list_to_gvariant(list);
+ cal_dbus_complete_get_changes_exception_by_version(object, invocation, arg_list, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_clean_after_sync(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, int book_id, int version)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ ret = cal_db_clean_after_sync(book_id, version);
+
+ cal_dbus_complete_clean_after_sync(object, invocation, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_insert_vcalendars(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *stream)
+{
+ int ret = 0;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+
+ int *ids = NULL;
+ int count = 0;
+ ret = cal_db_insert_vcalendars(stream, &ids, &count);
+
+ GVariant *arg_ids = cal_dbus_utils_ids_to_gvariant(ids, count);
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_insert_vcalendars(object, invocation, arg_ids, count, version, ret);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static gboolean _handle_replace_vcalendars(calDbus *object, GDBusMethodInvocation *invocation,
+ GVariant *arg_handle, char *stream, GVariant *arg_ids, int count)
+{
+ int ret = 0;
+ int *ids = NULL;
+ calendar_h handle = NULL;
+ ret = cal_dbus_utils_gvariant_to_handle(arg_handle, &handle);
+ ret = cal_dbus_utils_gvariant_to_ids(arg_ids, count, &ids);
+
+ ret = cal_db_replace_vcalendars(stream, ids, count);
+
+ int version = 0;
+ version = cal_db_util_get_transaction_ver();
+
+ cal_dbus_complete_replace_vcalendars(object, invocation, ret, version);
+ cal_server_ondemand_start();
+ return TRUE;
+}
+
+static int _cal_server_dbus_find_sender(const char *owner_name, cal_sender_s **out_sender)
+{
+ GList *cursor = NULL;
+
+ RETV_IF(NULL == owner_name, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_sender, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ cursor = cal_sender_list;
+ while (cursor) {
+ cal_sender_s *sender = (cal_sender_s *)cursor->data;
+ if (NULL == sender) {
+ ERR("sender is NULL");
+ return CALENDAR_ERROR_NO_DATA;
+ }
+
+ if (CAL_STRING_EQUAL == g_strcmp0(sender->name, owner_name)) {
+ *out_sender = sender;
+ break;
+ }
+ cursor = g_list_next(cursor);
+ }
+ return CALENDAR_ERROR_NONE;
+}
+
+static int _cal_server_dbus_cleanup_sender(cal_sender_s *sender) // cleanup_handle_list
+{
+ CAL_FN_CALL();
+ RETV_IF(NULL == sender, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ return CALENDAR_ERROR_NONE;
+}
+
+static void _cal_server_dbus_delete_link(cal_sender_s *sender)
+{
+ GList *cursor = NULL;
+
+ RET_IF(NULL == sender);
+
+ cursor = cal_sender_list;
+ while (cursor) {
+ if (cursor->data == sender) {
+ cal_sender_list = g_list_delete_link(cal_sender_list, cursor);
+ break;
+ }
+ cursor = g_list_next(cursor);
+ }
+}
+
+static void _cal_server_dbus_name_owner_changed_cb(GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
+{
+ CAL_FN_CALL();
+
+ int ret = 0;
+ gchar *name = NULL;
+ gchar *old_owner = NULL;
+ gchar *new_owner = NULL;
+
+ g_variant_get(parameters, "(&s&s&s)", &name, &old_owner, &new_owner);
+ if (new_owner) {
+ DBG("new_owner is NULL");
+ return;
+ }
+
+ DBG("name[%s] old_owner[%s] new_owner[%s]", name, old_owner, new_owner);
+
+ /* empty new_owner means server-kill */
+ cal_sender_s *sender = NULL;
+ ret = _cal_server_dbus_find_sender(old_owner, &sender);
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("_cal_server_dbus_find_sender() Fail(%d)", ret);
+ return;
+ }
+
+ if (sender) { /* found bus name in our bus list */
+ DBG("owner[%s] stopped", old_owner);
+
+ ret = _cal_server_dbus_cleanup_sender(sender);
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("_cal_server_dbus_cleanup_sender() Fail(%d)", ret);
+ return;
+ }
+ _cal_server_dbus_delete_link(sender);
+ }
+}
+
+static int _cal_server_dbus_subscribe_name_owner_changed(GDBusConnection *conn)
+{
+ CAL_FN_CALL();
+
+ unsigned int id = 0;
+ id = g_dbus_connection_signal_subscribe(conn,
+ "org.freedesktop.DBus", /* bus name */
+ "org.freedesktop.DBus", /* interface */
+ "NameOwnerChanged", /* member */
+ "/org/freedesktop/DBus", /* path */
+ NULL, /* arg0 */
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ _cal_server_dbus_name_owner_changed_cb,
+ NULL,
+ NULL);
+ if (0 == id) {
+ ERR("g_dbus_connection_signal_subscribe() Fail");
+ return CALENDAR_ERROR_IPC;
+ }
+ return CALENDAR_ERROR_NONE;
+}
+
+static void _dbus_on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
+{
+ gboolean ret = 0;
+ GError *error = NULL;
+
+ dbus_object = cal_dbus_skeleton_new();
+ if (NULL == dbus_object) {
+ ERR("cal_dbus_skeleton_new() Fail");
+ return;
+ }
+
+ g_signal_connect(dbus_object, "handle-register-resource",
+ G_CALLBACK(_handle_register_resource), NULL);
+ g_signal_connect(dbus_object, "handle-unregister-resource",
+ G_CALLBACK(_handle_unregister_resource), NULL);
+ g_signal_connect(dbus_object, "handle-insert-record",
+ G_CALLBACK(_handle_insert_record), NULL);
+ g_signal_connect(dbus_object, "handle-update-record",
+ G_CALLBACK(_handle_update_record), NULL);
+ g_signal_connect(dbus_object, "handle-delete-record",
+ G_CALLBACK(_handle_delete_record), NULL);
+ g_signal_connect(dbus_object, "handle-replace-record",
+ G_CALLBACK(_handle_replace_record), NULL);
+ g_signal_connect(dbus_object, "handle-insert-records",
+ G_CALLBACK(_handle_insert_records), NULL);
+ g_signal_connect(dbus_object, "handle-update-records",
+ G_CALLBACK(_handle_update_records), NULL);
+ g_signal_connect(dbus_object, "handle-delete-records",
+ G_CALLBACK(_handle_delete_records), NULL);
+ g_signal_connect(dbus_object, "handle-replace-records",
+ G_CALLBACK(_handle_replace_records), NULL);
+ g_signal_connect(dbus_object, "handle-get-record",
+ G_CALLBACK(_handle_get_record), NULL);
+ g_signal_connect(dbus_object, "handle-get-all-records",
+ G_CALLBACK(_handle_get_all_records), NULL);
+ g_signal_connect(dbus_object, "handle-get-records-with-query",
+ G_CALLBACK(_handle_get_records_with_query), NULL);
+ g_signal_connect(dbus_object, "handle-get-count",
+ G_CALLBACK(_handle_get_count), NULL);
+ g_signal_connect(dbus_object, "handle-get-count-with-query",
+ G_CALLBACK(_handle_get_count_with_query), NULL);
+ g_signal_connect(dbus_object, "handle-get-current-version",
+ G_CALLBACK(_handle_get_current_version), NULL);
+// g_signal_connect(dbus_object, "handle-add-changed-cb",
+// G_CALLBACK(_handle_add_changed_cb), NULL);
+// g_signal_connect(dbus_object, "handle-remove-changed-cb",
+// G_CALLBACK(_handle_remove_changed_cb), NULL);
+ g_signal_connect(dbus_object, "handle-get-changes-by-version",
+ G_CALLBACK(_handle_get_changes_by_version), NULL);
+// g_signal_connect(dbus_object, "handle-get-last-change-version",
+// G_CALLBACK(_handle_get_last_change_version), NULL);
+ g_signal_connect(dbus_object, "handle-get-changes-exception-by-version",
+ G_CALLBACK(_handle_get_changes_exception_by_version), NULL);
+ g_signal_connect(dbus_object, "handle-clean-after-sync",
+ G_CALLBACK(_handle_clean_after_sync), NULL);
+ g_signal_connect(dbus_object, "handle-insert-vcalendars",
+ G_CALLBACK(_handle_insert_vcalendars), NULL);
+ g_signal_connect(dbus_object, "handle-replace-vcalendars",
+ G_CALLBACK(_handle_replace_vcalendars), NULL);
+
+ ret = g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(dbus_object),
+ conn, CAL_DBUS_OBJPATH, &error);
+ if (FALSE == ret) {
+ ERR("g_dbus_interface_skeleton_export() Fail(%s)", error->message);
+ g_error_free(error);
+ return;
+ }
+
+ ret = _cal_server_dbus_subscribe_name_owner_changed(conn);
+ if (CALENDAR_ERROR_NONE != ret) {
+ ERR("_cal_server_dbus_subscribe_name_owner_changed() Fail(%d)", ret);
+ return;
+ }
+}
+
+static void _dbus_on_name_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
+{
+ DBG("Acquired the name %s", name);
+}
+
+static void _dbus_on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data)
+{
+ DBG("Lost the name %s", name);
+}
+
+unsigned int cal_server_dbus_init(void)
+{
+ guint id = 0;
+ id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+ CAL_DBUS_INTERFACE,
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ _dbus_on_bus_acquired,
+ _dbus_on_name_acquired,
+ _dbus_on_name_lost,
+ NULL,
+ NULL);
+ if (0 == id) {
+ ERR("g_bus_own_name() Fail");
+ return 0;
+ }
+ return id;
+}
+
+void cal_server_dbus_deinit(unsigned int id)
+{
+ g_bus_unown_name(id);
+}
+
+int cal_dbus_emit_signal(const char *dest, const char *signal_name, GVariant *value)
+{
+ gboolean ret;
+ GError *error = NULL;
+
+ DBG("signal_name[%s]", signal_name);
+ DBG("data[%s]", g_variant_print(value, FALSE));
+
+ calDbusSkeleton *skeleton = NULL;
+ skeleton = CAL_DBUS_SKELETON(cal_dbus_get_object());
+ GDBusConnection *conn = NULL;
+ conn = g_dbus_interface_skeleton_get_connection(G_DBUS_INTERFACE_SKELETON(skeleton));
+ ret = g_dbus_connection_emit_signal(conn,
+ dest,
+ CAL_DBUS_OBJPATH,
+ CAL_DBUS_INTERFACE,
+ signal_name,
+ value,
+ &error);
+ if (FALSE == ret) {
+ ERR("g_dbus_connection_emit_signal() Fail(%s)", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ if (FALSE == g_dbus_connection_flush_sync(conn, NULL, &error)) {
+ ERR("g_dbus_connection_flush_sync() Fail(%s)", error->message);
+ g_error_free(error);
+ return CALENDAR_ERROR_IPC;
+ }
+
+ return CALENDAR_ERROR_NONE;
+}
+
+int cal_dbus_publish_reminder(int stream_size, char *stream)
+{
+ CAL_FN_CALL();
+
+ GVariant *value = NULL;
+ value = cal_dbus_utils_stream_to_gvariant(stream_size, stream);
+
+ GList *cursor = NULL;
+ cursor = cal_sender_list;
+ while (cursor) {
+ cal_sender_s *sender = (cal_sender_s *)cursor->data;
+ if (NULL == sender) {
+ ERR("sender is NULL");
+ cursor = g_list_next(cursor);
+ continue;
+ }
+
+ DBG("------------------[%s]", sender->name);
+ cal_dbus_emit_signal(sender->name, CAL_NOTI_REMINDER_CAHNGED, value);
+ cursor = g_list_next(cursor);
+ }
+ return CALENDAR_ERROR_NONE;
+}
--- /dev/null
+/*
+ * Calendar Service
+ *
+ * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __CAL_SERVER_DBUS_H__
+#define __CAL_SERVER_DBUS_H__
+
+unsigned int cal_server_dbus_init(void);
+void cal_server_dbus_deinit(unsigned int id);
+int cal_dbus_publish_reminder(int stream_size, char *stream);
+
+#endif /* __CAL_SERVER_DBUS_H__ */
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include <malloc.h>
-#include <glib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <pims-ipc-data.h>
-#include <pims-ipc-svc.h>
-
-#include "calendar.h"
-#include "cal_typedef.h"
-#include "cal_internal.h"
-#include "cal_db_util.h"
-#include "cal_ipc.h"
-#include "cal_ipc_marshal.h"
-#include "cal_server_ipc.h"
-#include "cal_access_control.h"
-#include "cal_handle.h"
-#include "cal_server_service.h"
-#include "cal_db.h"
-#include "cal_server.h"
-#include "cal_server_ondemand.h"
-
-
-static void _cal_server_ipc_return(pims_ipc_data_h *outdata, int ret)
-{
- RET_IF(NULL == outdata);
-
- *outdata = pims_ipc_data_create(0);
- RETM_IF(NULL == *outdata, "pims_ipc_data_create() Fail");
-
- if (0 != pims_ipc_data_put(*outdata, (void *)&ret, sizeof(int))) {
- ERR("pims_ipc_data_put() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- }
-}
-
-void cal_server_ipc_connect(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- ret = cal_connect();
- if (CALENDAR_ERROR_NONE == ret) {
- char *smack_label = NULL;
- if (0 != pims_ipc_svc_get_smack_label(ipc, &smack_label))
- ERR("pims_ipc_svc_get_smack_label() Fail");
- cal_access_control_set_client_info(ipc, smack_label);
- }
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
-}
-
-void cal_server_ipc_disconnect(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- ret = cal_disconnect();
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_check_permission(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- int permission = 0;
- ret = cal_ipc_unmarshal_int(indata, &permission);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- bool result = cal_access_control_have_permission(ipc, permission);
- _cal_server_ipc_return(outdata, ret);
-
- if (0 != pims_ipc_data_put(*outdata, (void *)&result, sizeof(bool))) {
- ERR("pims_ipc_data_put() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- _cal_server_ipc_return(outdata, ret);
- }
-
- cal_handle_destroy(handle);
-}
-
-void cal_server_ipc_db_insert_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_record_h record = NULL;
- ret = cal_ipc_unmarshal_record(indata, &record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int id = 0;
- ret = cal_db_insert_record(record, &id);
- _cal_server_ipc_return(outdata, ret);
-
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- calendar_record_destroy(record, true);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_ipc_marshal_int(id, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
-
- calendar_record_destroy(record, true);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
- return;
-}
-
-void cal_server_ipc_db_get_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char* view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- int id = 0;
- ret = cal_ipc_unmarshal_int(indata, &id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- calendar_record_h record = NULL;
- ret = cal_db_get_record(view_uri, id, &record);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_record(record, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_record() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_record_destroy(record, true);
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_update_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_record_h record = NULL;
- ret = cal_ipc_unmarshal_record(indata, &record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_update_record(record);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_record_destroy(record, true);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_delete_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char* view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int id = 0;
- ret = cal_ipc_unmarshal_int(indata, &id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_delete_record(view_uri,id);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_get_all_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char* view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int offset = 0;
- ret = cal_ipc_unmarshal_int(indata, &offset);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- int limit = 0;
- ret = cal_ipc_unmarshal_int(indata, &limit);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- calendar_list_h list = NULL;
- ret = cal_db_get_all_records(view_uri, offset, limit, &list);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_list(list, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_list_destroy(list, true);
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_get_records_with_query(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_query_h query = NULL;
- ret = cal_ipc_unmarshal_query(indata, &query);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_query() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int offset = 0;
- ret = cal_ipc_unmarshal_int(indata, &offset);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- calendar_query_destroy(query);
- cal_handle_destroy(handle);
- return;
- }
-
- int limit = 0;
- ret = cal_ipc_unmarshal_int(indata, &limit);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- calendar_query_destroy(query);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- calendar_query_destroy(query);
- cal_handle_destroy(handle);
- return;
- }
-
- calendar_list_h list = NULL;
- ret = cal_db_get_records_with_query(query, offset, limit, &list);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_list(list, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_list_destroy(list, true);
- calendar_query_destroy(query);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_clean_after_sync(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- int calendar_book_id = 0;
- ret = cal_ipc_unmarshal_int(indata,&calendar_book_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int calendar_db_version = 0;
- ret = cal_ipc_unmarshal_int(indata, &calendar_db_version);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_clean_after_sync(calendar_book_id, calendar_db_version);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_get_count(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char *view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int count = 0;
- ret = cal_db_get_count(view_uri, &count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_int(count, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_get_count_with_query(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_query_h query = NULL;
- ret = cal_ipc_unmarshal_query(indata,&query);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_query() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int count = 0;
- ret = cal_db_get_count_with_query(query, &count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_int(count, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_query_destroy(query);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_list_h list = NULL;
- ret = cal_ipc_unmarshal_list(indata, &list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int *ids = NULL;
- int id_count = 0;
- ret = cal_db_insert_records(list, &ids, &id_count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
- /*
- * marshal : id_count+[ids]*id_count
- * id_count
- */
- if (pims_ipc_data_put(*outdata, (void*)&id_count, sizeof(int)) != 0) {
- ERR("pims_ipc_data_put() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
-
- /* marshal ids */
- int i=0;
- for(i = 0; i < id_count; i++) {
- if (pims_ipc_data_put(*outdata, (void*)&ids[i], sizeof(int)) != 0) {
- ERR("pims_ipc_data_put() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
- }
- }
-
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_update_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_list_h list = NULL;
- ret = cal_ipc_unmarshal_list(indata, &list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_update_records(list);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_list_destroy(list,true);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char *view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int count = 0;
- ret = cal_ipc_unmarshal_int(indata, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- g_free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- if (count <= 0) {
- ERR("count(%d)", count);
- ret = CALENDAR_ERROR_NO_DATA;
- _cal_server_ipc_return(outdata, ret);
- g_free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- int *ids = NULL;
- ids = (int*)calloc(count, sizeof(int));
- if (NULL == ids) {
- ERR("calloc() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- int i = 0;
- for(i = 0; i < count; i++) {
- ret = cal_ipc_unmarshal_int(indata, &ids[i]);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_IPC;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_delete_records(view_uri, ids, count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- free(ids);
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
- return;
-}
-
-void cal_server_ipc_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char *view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int calendar_book_id = 0;
- ret = cal_ipc_unmarshal_int(indata, &calendar_book_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- int calendar_db_version = 0;
- ret = cal_ipc_unmarshal_int(indata, &calendar_db_version);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- calendar_list_h list = NULL;
- int current_calendar_db_version = 0;
- ret = cal_db_get_changes_by_version(view_uri, calendar_book_id, calendar_db_version, &list, ¤t_calendar_db_version);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_list(list,*outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- calendar_list_destroy(list, true);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_ipc_marshal_int(current_calendar_db_version,*outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- calendar_list_destroy(list, true);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
- }
-
- calendar_list_destroy(list, true);
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_get_current_version(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int calendar_db_version = 0;
- ret = cal_db_get_current_version(&calendar_db_version);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_int(calendar_db_version, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- }
- }
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
- return;
-}
-
-void cal_server_ipc_db_insert_vcalendars(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char *stream = NULL;
- ret = cal_ipc_unmarshal_char(indata, &stream);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int count = 0;
- int *ids = NULL;
- ret = cal_db_insert_vcalendars(stream, &ids, &count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_ipc_marshal_int(count, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
-
- int i;
- for(i = 0; i < count; i++) {
- ret = cal_ipc_marshal_int(ids[i], *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
- }
- }
-
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_replace_vcalendars(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char *stream = NULL;
- ret = cal_ipc_unmarshal_char(indata, &stream);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int count = 0;
- ret = cal_ipc_unmarshal_int(indata, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
-
- int *ids = NULL;
- ids = (int*)calloc(count, sizeof(int));
- if (NULL == ids) {
- ERR("calloc() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- _cal_server_ipc_return(outdata, ret);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
-
- int i = 0;
- for(i = 0; i < count; i++) {
- ret = cal_ipc_unmarshal_int(indata, &ids[i]);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- return;
- }
-
-
- ret = cal_db_replace_vcalendars(stream, ids, count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail(%d)", ret);
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- free(ids);
- free(stream);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_replace_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_record_h record = NULL;
- ret = cal_ipc_unmarshal_record(indata, &record);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_record() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int id = 0;
- ret = cal_ipc_unmarshal_int(indata, &id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- calendar_record_destroy(record, true);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- calendar_record_destroy(record, true);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_replace_record(record, id);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_record_destroy(record, true);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_list_h list = NULL;
- ret = cal_ipc_unmarshal_list(indata, &list);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_list() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int count = 0;
- ret = cal_ipc_unmarshal_int(indata, &count);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
-
- if (count <= 0) {
- ERR("count(%d) <= 0", count);
- ret = CALENDAR_ERROR_NO_DATA;
- _cal_server_ipc_return(outdata, ret);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
-
- int *ids = NULL;
- ids = (int*)calloc(count, sizeof(int));
- if (NULL == ids) {
- ERR("calloc() Fail");
- ret = CALENDAR_ERROR_OUT_OF_MEMORY;
- _cal_server_ipc_return(outdata, ret);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
-
- int i;
- for(i = 0; i < count; i++) {
- ret = cal_ipc_unmarshal_int(indata, &ids[i]);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- ret = CALENDAR_ERROR_IPC;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_WRITE)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- return;
- }
-
- ret = cal_db_replace_records(list, ids, count);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- int transaction_ver = 0;
- transaction_ver = cal_db_util_get_transaction_ver();
- ret = cal_ipc_marshal_int(transaction_ver,*outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_int() Fail");
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- free(ids);
- calendar_list_destroy(list, true);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-void cal_server_ipc_db_changes_exception(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- if (NULL == indata) {
- ERR("No indata");
- ret = CALENDAR_ERROR_INVALID_PARAMETER;
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- calendar_h handle = NULL;
- ret = cal_ipc_unmarshal_handle(indata, &handle);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_handle() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- return;
- }
-
- char *view_uri = NULL;
- ret = cal_ipc_unmarshal_char(indata, &view_uri);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_char() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- cal_handle_destroy(handle);
- return;
- }
-
- int original_event_id = 0;
- ret = cal_ipc_unmarshal_int(indata, &original_event_id);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- int calendar_db_version = 0;
- ret = cal_ipc_unmarshal_int(indata, &calendar_db_version);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_unmarshal_int() Fail(%d)", ret);
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- if (false == cal_access_control_have_permission(ipc, CAL_PERMISSION_READ)) {
- ret = CALENDAR_ERROR_PERMISSION_DENIED;
- _cal_server_ipc_return(outdata, ret);
- free(view_uri);
- cal_handle_destroy(handle);
- return;
- }
-
- calendar_list_h list = NULL;
- ret = cal_db_get_changes_exception_by_version(view_uri, original_event_id, calendar_db_version, &list);
- _cal_server_ipc_return(outdata, ret);
-
- if (CALENDAR_ERROR_NONE == ret) {
- ret = cal_ipc_marshal_list(list, *outdata);
- if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_ipc_marshal_list() Fail(%d)", ret);
- ret = CALENDAR_ERROR_IPC;
- _cal_server_ipc_return(outdata, ret);
- }
- }
-
- calendar_list_destroy(list, true);
- free(view_uri);
- cal_handle_destroy(handle);
- cal_server_ondemand_start();
-}
-
-#ifdef CAL_MEMORY_TEST
-static gboolean _cal_server_ipc_destroy_idle(void* user_data)
-{
- g_main_loop_quit(main_loop);
-}
-void cal_server_ipc_destroy(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata)
-{
- int ret = CALENDAR_ERROR_NONE;
-
- /* kill daemon destroy */
- g_timeout_add_seconds(1, &_cal_server_ipc_destroy_idle, NULL);
-
- if (outdata) {
- *outdata = pims_ipc_data_create(0);
- if (!*outdata) {
- ERR("pims_ipc_data_create() Fail");
- goto DATA_FREE;
- }
- if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ERR("pims_ipc_data_put() Fail");
- goto DATA_FREE;
- }
-
- }
- else {
- ERR("outdata is NULL");
- }
- goto DATA_FREE;
-
-ERROR_RETURN:
- if (outdata) {
- *outdata = pims_ipc_data_create(0);
- if (!*outdata) {
- ERR("pims_ipc_data_create() Fail");
- goto DATA_FREE;
- }
- if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
- pims_ipc_data_destroy(*outdata);
- *outdata = NULL;
- ERR("pims_ipc_data_put() Fail");
- goto DATA_FREE;
- }
- }
- else {
- ERR("outdata is NULL");
- }
-DATA_FREE:
-
- return;
-}
-#endif /* CAL_MEMORY_TEST */
-
-int cal_server_ipc_init(void)
-{
-#if !GLIB_CHECK_VERSION(2,35,0)
- g_type_init();
-#endif
-
- char sock_file[CAL_STR_MIDDLE_LEN] = {0};
- snprintf(sock_file, sizeof(sock_file), CAL_SOCK_PATH"/.%s", getuid(), CAL_IPC_SERVICE);
- pims_ipc_svc_init(sock_file,CAL_SECURITY_FILE_GROUP, 0777);
-
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_CONNECT, cal_server_ipc_connect, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DISCONNECT, cal_server_ipc_disconnect, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_CHECK_PERMISSION, cal_server_ipc_check_permission, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_INSERT_RECORD, cal_server_ipc_db_insert_record, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_RECORD, cal_server_ipc_db_get_record, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_UPDATE_RECORD, cal_server_ipc_db_update_record, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_DELETE_RECORD, cal_server_ipc_db_delete_record, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_ALL_RECORDS, cal_server_ipc_db_get_all_records, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_RECORDS_WITH_QUERY, cal_server_ipc_db_get_records_with_query, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_CLEAN_AFTER_SYNC, cal_server_ipc_db_clean_after_sync, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_COUNT, cal_server_ipc_db_get_count, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_COUNT_WITH_QUERY, cal_server_ipc_db_get_count_with_query, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_INSERT_RECORDS, cal_server_ipc_db_insert_records, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_UPDATE_RECORDS, cal_server_ipc_db_update_records, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_DELETE_RECORDS, cal_server_ipc_db_delete_records, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_CHANGES_BY_VERSION, cal_server_ipc_db_get_changes_by_version, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_GET_CURRENT_VERSION, cal_server_ipc_db_get_current_version, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_INSERT_VCALENDARS, cal_server_ipc_db_insert_vcalendars, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_REPLACE_VCALENDARS, cal_server_ipc_db_replace_vcalendars, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_REPLACE_RECORD, cal_server_ipc_db_replace_record, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_REPLACE_RECORDS, cal_server_ipc_db_replace_records, NULL) != 0, -1);
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DB_CHANGES_EXCEPTION, cal_server_ipc_db_changes_exception, NULL) != 0, -1);
-#ifdef CAL_MEMORY_TEST
- RETV_IF(pims_ipc_svc_register(CAL_IPC_MODULE, CAL_IPC_SERVER_DESTROY, cal_server_ipc_destroy, NULL) != 0, -1);
-#endif /* CAL_MEMORY_TEST */
-
- /* for subscribe */
- snprintf(sock_file, sizeof(sock_file), CAL_SOCK_PATH"/.%s_for_subscribe", getuid(), CAL_IPC_SERVICE);
- pims_ipc_svc_init_for_publish(sock_file, CAL_SECURITY_FILE_GROUP, CAL_SECURITY_DEFAULT_PERMISSION);
- return CALENDAR_ERROR_NONE;
-}
-
-void cal_server_ipc_deinit(void)
-{
- pims_ipc_svc_deinit_for_publish();
- pims_ipc_svc_deinit();
-}
-
-void cal_server_ipc_run(GMainLoop *loop)
-{
- pims_ipc_svc_run_main_loop(loop);
-}
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#ifndef __CAL_SERVER_IPC_H__
-#define __CAL_SERVER_IPC_H__
-
-#include <pims-ipc-data.h>
-
-/* calendar_service.h */
-void cal_server_ipc_connect(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_disconnect(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_check_permission(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-
-/* calendar_db.h */
-void cal_server_ipc_db_insert_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_update_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_delete_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_all_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_records_with_query(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_clean_after_sync(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_count(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_count_with_query(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_update_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_get_current_version(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_insert_vcalendars(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_replace_vcalendars(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_replace_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-void cal_server_ipc_db_changes_exception(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_data_h *outdata, void *userdata);
-
-int cal_server_ipc_init(void);
-void cal_server_ipc_deinit(void);
-void cal_server_ipc_run(GMainLoop *loop);
-
-#endif /* __CAL_SERVER_IPC_H__ */
{
CAL_FN_CALL();
+ int timeout = cal_server_get_timeout();
+ if (timeout < 1)
+ return;
+
pthread_mutex_lock(&cal_mutex_timeout);
g_source_remove(cal_timeout_id);
cal_timeout_id = 0;
static gboolean _timeout_cb(gpointer user_data)
{
+ CAL_FN_CALL();
+
pthread_mutex_lock(&cal_mutex_holding);
if (FALSE == cal_holding) {
DBG("exit");
if (timeout < 1)
return;
+ DBG("timeout(%d)", timeout);
pthread_mutex_lock(&cal_mutex_timeout);
if (cal_timeout_id > 0)
g_source_remove(cal_timeout_id);
+++ /dev/null
-/*
- * Calendar Service
- *
- * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-#include <stdlib.h>
-#include <pims-ipc-svc.h>
-#include <pims-ipc-data.h>
-
-#include "calendar.h"
-#include "cal_internal.h"
-#include "cal_typedef.h"
-#include "cal_db.h"
-#include "cal_db_util.h"
-#include "cal_ipc.h"
-#include "cal_ipc_marshal.h"
-#include "cal_server_ipc.h"
-
-#define CAL_SUBSCRIBE_MAX_LEN 1024
-
-void cal_server_reminder_publish(char *p, int p_len)
-{
- RET_IF(NULL == p);
-
- pims_ipc_data_h indata = NULL;
- indata = pims_ipc_data_create(0);
- RETM_IF(NULL == indata, "pims_ipc_data_create() Fail");
-
- if (pims_ipc_data_put(indata, &p_len, sizeof(int)) != 0) {
- ERR("pims_ipc_data_put() Fail");
- pims_ipc_data_destroy(indata);
- return;
- }
- if (pims_ipc_data_put(indata, p, p_len + 1) != 0) {
- ERR("pims_ipc_data_put() Fail");
- pims_ipc_data_destroy(indata);
- return;
- }
- if (pims_ipc_svc_publish(CAL_IPC_MODULE_FOR_SUBSCRIPTION, (char *)CAL_NOTI_REMINDER_CAHNGED, indata) != 0) {
- ERR("pims_ipc_svc_publish() Fail");
- pims_ipc_data_destroy(indata);
- return;
- }
- pims_ipc_data_destroy(indata);
-}
-
-int cal_server_reminder_add_callback_data(char **p, char *key, char *value)
-{
- int len_key = 0;
- int len_value = 0;
-
- if (NULL == key || NULL == value)
- {
- ERR("Invalid parameter");
- return CALENDAR_ERROR_INVALID_PARAMETER;
- }
-
- len_key = strlen(key);
- len_value = strlen(value);
- DBG("key[%s]value[%s]", key, value);
-
- if (NULL == *p)
- {
- int len = len_key + len_value + 2;
- *p = calloc(len, sizeof(char));
- if (NULL == *p) {
- ERR("calloc() failed");
- return CALENDAR_ERROR_DB_FAILED;
- }
- snprintf(*p, len, "%s=%s", key, value);
-
- } else {
- int len = strlen(*p) + len_key + len_value + 3;
- char *temp = calloc(len, sizeof(char));
- if (NULL == temp) {
- ERR("recalloc() failed");
- return CALENDAR_ERROR_DB_FAILED;
- }
- snprintf(temp, len, "%s&%s=%s", *p, key, value);
- free(*p);
- *p = temp;
- }
- return CALENDAR_ERROR_NONE;
-}
-
ERR("open Fail ");
return -1;
}
-
- ret = fchown(fd, getuid(), CAL_SECURITY_FILE_GROUP);
- if (-1 == ret) {
- ERR("Fail to fchown ");
- close(fd);
- return -1;
- }
fchmod(fd, CAL_SECURITY_DEFAULT_PERMISSION);
close(fd);
ERR("open Fail ");
return -1;
}
-
- ret = fchown(fd, getuid(), CAL_SECURITY_FILE_GROUP);
- if (-1 == ret) {
- ERR("Fail to fchown ");
- close(fd);
- return -1;
- }
fchmod(fd, CAL_SECURITY_DEFAULT_PERMISSION);
close(fd);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_total_connection--;
- cal_mutex_unlock(CAL_MUTEX_CONNECTION);
+ cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_NONE;
}
que = (cal_query_s *)query;
type = cal_view_get_type(que->view_uri);
+ DBG("uri[%s]", que->view_uri);
cal_db_plugin_cb_s* plugin_cb = _cal_db_get_plugin(type);
RETV_IF(NULL == plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
snprintf(query, sizeof(query), "INSERT INTO %s (uid, updated, name, description, "
"color, location, visibility, sync_event, account_id, store_type, "
"sync_data1, sync_data2, sync_data3, sync_data4, mode, owner_label) "
- "VALUES (?, %ld, ?, ?, ?, ?, %d, %d, %d, %d, ?, ?, ?, ?, %d, ?)",
+ "VALUES (?, %d, ?, ?, ?, ?, %d, %d, %d, %d, ?, ?, ?, ?, %d, ?)",
CAL_TABLE_CALENDAR, book->updated, book->visibility, book->sync_event,
book->account_id, book->store_type, book->mode);
char query[CAL_DB_SQL_MAX_LEN] = {0};
snprintf(query, sizeof(query), "UPDATE %s SET "
- "uid =?, updated = %ld, name =?, description =?, color =?, location =?, "
+ "uid =?, updated = %d, name =?, description =?, color =?, location =?, "
"visibility =%d, sync_event =%d, account_id =%d, store_type =%d, "
"sync_data1 =?, sync_data2 =?, sync_data3 =?, sync_data4 =?, mode =%d "
"WHERE id =%d",
return ret;
}
sqlite3_finalize(stmt);
-
cal_db_util_notify(CAL_NOTI_TYPE_CALENDAR);
return CALENDAR_ERROR_NONE;
char query[CAL_DB_SQL_MAX_LEN] = {0};
snprintf(query, sizeof(query), "UPDATE %s SET "
- "uid =?, updated =%ld, name =?, description =?, color =?, location =?, "
+ "uid =?, updated =%d, name =?, description =?, color =?, location =?, "
"visibility =%d, sync_event =%d, account_id =%d, store_type =%d, "
"sync_data1 =?, sync_data2 =?, sync_data3 =?, sync_data4 =?, mode =%d "
"WHERE id =%d",
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
+ SECURE("[TEST]---------query[%s]", query_str);
if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
*out_record = NULL;
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
}
- if (CALENDAR_ERROR_NONE == cal_db_rrule_get_rrule(event->index, &rrule)) {
- cal_db_rrule_set_rrule_to_event(rrule, *out_record);
- CAL_FREE(rrule);
+ if (CALENDAR_RECURRENCE_NONE != event->freq) {
+ ret = cal_db_rrule_get_rrule(event->index, &rrule);
+ if (CALENDAR_ERROR_NONE == ret) {
+ cal_db_rrule_set_rrule_to_record(rrule, *out_record);
+ CAL_FREE(rrule);
+ }
}
if (event->has_alarm == 1)
"has_attendee = %d, "
"has_alarm = %d, "
"system_type = %d, "
- "updated = %ld, "
+ "updated = %d, "
"sync_data1 = ?, "
"sync_data2 = ?, "
"sync_data3 = ?, "
* which is original_event_id > 0
*/
cal_db_event_update_original_event_version(event->original_event_id, input_ver);
- cal_db_rrule_get_rrule_from_event(record, &rrule);
+ cal_db_rrule_get_rrule_from_record(record, &rrule);
cal_db_rrule_update_record(event->index, rrule); /* if rrule turns none, update 0. */
CAL_FREE(rrule);
return ret;
}
+ SECURE("[TEST]---------query[%s]", query_str);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
int exception=0, extended=0;
"has_attendee = %d, "
"has_alarm = %d, "
"system_type = %d, "
- "updated = %ld, "
+ "updated = %d, "
"sync_data1 = ?, "
"sync_data2 = ?, "
"sync_data3 = ?, "
* which is original_event_id > 0
*/
cal_db_event_update_original_event_version(event->original_event_id, input_ver);
- cal_db_rrule_get_rrule_from_event(record, &rrule);
+ cal_db_rrule_get_rrule_from_record(record, &rrule);
cal_db_rrule_update_record(id, rrule);
CAL_FREE(rrule);
cal_rrule_s *rrule = NULL;
cal_event_s *event = (cal_event_s *)record;
- if (CALENDAR_ERROR_NONE == cal_db_rrule_get_rrule(event->index, &rrule)) {
- cal_db_rrule_set_rrule_to_event(rrule, record);
- CAL_FREE(rrule);
+ if (CALENDAR_RECURRENCE_NONE != event->freq) {
+ ret = cal_db_rrule_get_rrule(event->index, &rrule);
+ if (CALENDAR_ERROR_NONE == ret) {
+ cal_db_rrule_set_rrule_to_record(rrule, record);
+ CAL_FREE(rrule);
+ }
}
if (event->has_alarm == 1)
return CALENDAR_ERROR_NONE;
}
-static int _cal_db_event_get_deleted_data(int id, int* calendar_book_id, int* created_ver,
+static int _cal_db_event_get_deleted_data(int id, int* book_id, int* created_ver,
int* original_event_id, char** recurrence_id)
{
int ret = 0;
- char query[CAL_DB_SQL_MAX_LEN];
+ char query[CAL_DB_SQL_MAX_LEN] = {0};
sqlite3_stmt *stmt = NULL;
+ RETV_IF(NULL == book_id, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == created_ver, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == original_event_id, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == recurrence_id, CALENDAR_ERROR_INVALID_PARAMETER);
+
snprintf(query, sizeof(query), "SELECT calendar_id, created_ver, "
"original_event_id, recurrence_id FROM %s WHERE id = %d ",
CAL_TABLE_SCHEDULE, id);
return ret;
}
- const unsigned char *tmp;
- if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
- *calendar_book_id = sqlite3_column_int(stmt, 0);
- *created_ver = sqlite3_column_int(stmt, 1);
- *original_event_id = sqlite3_column_int(stmt, 2);
- tmp = sqlite3_column_text(stmt, 3);
- *recurrence_id = cal_strdup((const char*)tmp);
- }
- else {
+ ret = cal_db_util_stmt_step(stmt);
+ if (CAL_SQLITE_ROW != ret) {
+ ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
- stmt = NULL;
- DBG("Failed to get deleted_data: event_id(%d)", id);
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
}
+ *book_id = sqlite3_column_int(stmt, 0);
+ *created_ver = sqlite3_column_int(stmt, 1);
+ *original_event_id = sqlite3_column_int(stmt, 2);
+ *recurrence_id = cal_strdup((const char *)sqlite3_column_text(stmt, 3));
+
sqlite3_finalize(stmt);
- stmt = NULL;
return CALENDAR_ERROR_NONE;
}
"%d, %lld, ?, ?, "
"%d, %lld, ?, ?, "
"strftime('%%s', 'now'), %d, "
- "?, ?, %d, %d, %d, %ld, "
+ "?, ?, %d, %d, %d, %d, "
"?, ?, ?, ?, "
"%d, %d, %d, %d) ",
CAL_TABLE_SCHEDULE,
*id = event_id;
}
- cal_db_rrule_get_rrule_from_event(record, &rrule);
+ cal_db_rrule_get_rrule_from_record(record, &rrule);
if (rrule) {
cal_db_rrule_insert_record(event_id, rrule);
CAL_FREE(rrule);
return ret;
}
+ SECURE("[TEST]---------query[%s]", query_str);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_instance_localtime_calendar_book._uri,&record);
return ret;
}
+ SECURE("[TEST]---------query[%s]", query_str);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_instance_utime_calendar_book._uri,&record);
"%d, %lld, ?, ?, "
"%d, %lld, ?, ?, "
"strftime('%%s', 'now'), %d, "
- "%d, %d, %ld, "
+ "%d, %d, %d, "
"?, ?, ?, ?, "
"?, ?, "
"%d, %d, "
*id = index;
}
- cal_db_rrule_get_rrule_from_todo(record, &rrule);
+ cal_db_rrule_get_rrule_from_record(record, &rrule);
cal_db_rrule_insert_record(index, rrule);
if (todo->alarm_list && 0 < todo->alarm_list->count) {
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
}
- if (CALENDAR_ERROR_NONE == cal_db_rrule_get_rrule(todo->index, &rrule)) {
- cal_db_rrule_set_rrule_to_todo(rrule, *out_record);
- CAL_FREE(rrule);
+ if (CALENDAR_RECURRENCE_NONE != todo->freq) {
+ ret = cal_db_rrule_get_rrule(todo->index, &rrule);
+ if (CALENDAR_ERROR_NONE == ret) {
+ cal_db_rrule_set_rrule_to_record(rrule, *out_record);
+ CAL_FREE(rrule);
+ }
}
if (todo->has_alarm == 1)
"last_mod = strftime('%%s', 'now'), "
"has_alarm = %d, "
"system_type = %d, "
- "updated = %ld, "
+ "updated = %d, "
"sync_data1 = ?, "
"sync_data2 = ?, "
"sync_data3 = ?, "
return ret;
}
- cal_db_rrule_get_rrule_from_todo(record, &rrule);
+ cal_db_rrule_get_rrule_from_record(record, &rrule);
cal_db_rrule_update_record(todo->index, rrule);
CAL_FREE(rrule);
"last_mod = strftime('%%s', 'now'), "
"has_alarm = %d, "
"system_type = %d, "
- "updated = %ld, "
+ "updated = %d, "
"sync_data1 = ?, "
"sync_data2 = ?, "
"sync_data3 = ?, "
return ret;
}
- cal_db_rrule_get_rrule_from_todo(record, &rrule);
+ cal_db_rrule_get_rrule_from_record(record, &rrule);
cal_db_rrule_update_record(id, rrule);
CAL_FREE(rrule);
return CALENDAR_ERROR_NONE;
}
-void cal_db_rrule_get_rrule_from_event(calendar_record_h record, cal_rrule_s **out_rrule)
+void cal_db_rrule_get_rrule_from_record(calendar_record_h record, cal_rrule_s **out_rrule)
{
RET_IF(NULL == record);
- cal_event_s *event = NULL;
- event = (cal_event_s *)record;
- if (event->freq == CALENDAR_RECURRENCE_NONE) {
- return;
- }
-
cal_rrule_s *rrule = NULL;
- rrule = calloc(1, sizeof(cal_rrule_s));
- RETM_IF(NULL == rrule, "calloc() Fail");
-
- rrule->freq = event->freq;
-
- rrule->range_type = event->range_type;
- switch (rrule->range_type) {
- case CALENDAR_RANGE_UNTIL:
- rrule->until = event->until;
- break;
- case CALENDAR_RANGE_COUNT:
- break;
- case CALENDAR_RANGE_NONE:
- break;
- }
-
- rrule->count = event->count;
- rrule->interval = event->interval;
- rrule->bysecond = event->bysecond;
- rrule->byminute = event->byminute;
- rrule->byhour = event->byhour;
- rrule->byday = event->byday;
- rrule->bymonthday = event->bymonthday;
- rrule->byyearday = event->byyearday;
- rrule->byweekno = event->byweekno;
- rrule->bymonth = event->bymonth;
- rrule->bysetpos = event->bysetpos;
- rrule->wkst = event->wkst;
-
- /* check default */
- switch (event->freq) {
- case CALENDAR_RECURRENCE_YEARLY:
- if (rrule->bymonth && *rrule->bymonth) {
- if ((NULL == rrule->bymonthday || '\0' == *rrule->bymonthday) &&
- (NULL == rrule->byday || '\0' == *rrule->byday)) {
- DBG("Not enough data, set default");
- free(rrule->bymonthday);
- rrule->bymonthday = NULL;
- _get_start_date(event, NULL, &rrule->bymonthday);
- DBG("set bymonthday as start time mday[%s]", rrule->bymonthday);
- }
- }
- else if (rrule->byyearday && *rrule->byyearday) {
-
- }
- else if (rrule->byweekno && *rrule->byweekno) {
-
- }
- else if ((rrule->bymonthday && *rrule->bymonthday) || (rrule->byday && *rrule->byday)) {
- if (NULL == rrule->bymonth || '\0' == *rrule->bymonth) {
- DBG("Not enough data, set default");
- free(rrule->bymonth);
- rrule->bymonth = NULL;
- _get_start_date(event, &rrule->bymonth, NULL);
- DBG("set bymonth as start time month[%s]", rrule->bymonth);
- }
- }
- else {
- if (NULL == rrule->bymonth || '\0' == *rrule->bymonth) {
- DBG("Not enough data, set default");
- free(rrule->bymonth);
- rrule->bymonth = NULL;
- free(rrule->bymonthday);
- rrule->bymonthday = NULL;
- _get_start_date(event, &rrule->bymonth, &rrule->bymonthday);
- DBG("set bymonth, bymonthday as start time month[%s], mday[%s]",
- rrule->bymonth, rrule->bymonthday);
- }
+ cal_record_s *rec = (cal_record_s *)record;
+ switch (rec->type) {
+ case CAL_RECORD_TYPE_EVENT:
+ if (CALENDAR_RECURRENCE_NONE == ((cal_event_s *)record)->freq)
+ break;
+ rrule = calloc(1, sizeof(cal_rrule_s));
+ if (NULL == rrule)
+ break;
+ rrule->freq = ((cal_event_s *)record)->freq;
+ rrule->interval = ((cal_event_s *)record)->interval;
+ rrule->bysecond = ((cal_event_s *)record)->bysecond;
+ rrule->byminute = ((cal_event_s *)record)->byminute;
+ rrule->byhour = ((cal_event_s *)record)->byhour;
+ rrule->byday = ((cal_event_s *)record)->byday;
+ rrule->bymonthday = ((cal_event_s *)record)->bymonthday;
+ rrule->byyearday = ((cal_event_s *)record)->byyearday;
+ rrule->byweekno = ((cal_event_s *)record)->byweekno;
+ rrule->bymonth = ((cal_event_s *)record)->bymonth;
+ rrule->bysetpos = ((cal_event_s *)record)->bysetpos;
+ rrule->wkst = ((cal_event_s *)record)->wkst;
+ rrule->range_type = ((cal_event_s *)record)->range_type;
+ switch (rrule->range_type) {
+ case CALENDAR_RANGE_UNTIL:
+ rrule->until = ((cal_event_s *)record)->until;
+ break;
+ case CALENDAR_RANGE_COUNT:
+ rrule->count = ((cal_event_s *)record)->count;
+ break;
+ case CALENDAR_RANGE_NONE:
+ break;
}
break;
- case CALENDAR_RECURRENCE_MONTHLY:
- if (NULL == rrule->bymonth || '\0' == *rrule->bymonth) {
- /* get start time month */
- free(rrule->bymonth);
- rrule->bymonth = NULL;
- _get_start_date(event, &rrule->bymonth, NULL);
- DBG("set start time month[%s]", rrule->bymonth);
+ case CAL_RECORD_TYPE_TODO:
+ if (CALENDAR_RECURRENCE_NONE == ((cal_todo_s *)record)->freq)
+ break;
+ rrule = calloc(1, sizeof(cal_rrule_s));
+ if (NULL == rrule)
+ break;
+ rrule->freq = ((cal_todo_s *)record)->freq;
+ rrule->interval = ((cal_todo_s *)record)->interval;
+ rrule->bysecond = ((cal_todo_s *)record)->bysecond;
+ rrule->byminute = ((cal_todo_s *)record)->byminute;
+ rrule->byhour = ((cal_todo_s *)record)->byhour;
+ rrule->byday = ((cal_todo_s *)record)->byday;
+ rrule->bymonthday = ((cal_todo_s *)record)->bymonthday;
+ rrule->byyearday = ((cal_todo_s *)record)->byyearday;
+ rrule->byweekno = ((cal_todo_s *)record)->byweekno;
+ rrule->bymonth = ((cal_todo_s *)record)->bymonth;
+ rrule->bysetpos = ((cal_todo_s *)record)->bysetpos;
+ rrule->wkst = ((cal_todo_s *)record)->wkst;
+ rrule->range_type = ((cal_todo_s *)record)->range_type;
+ switch (rrule->range_type) {
+ case CALENDAR_RANGE_UNTIL:
+ rrule->until = ((cal_todo_s *)record)->until;
+ break;
+ case CALENDAR_RANGE_COUNT:
+ rrule->count = ((cal_todo_s *)record)->count;
+ break;
+ case CALENDAR_RANGE_NONE:
+ break;
}
+ break;
default:
break;
}
-
*out_rrule = rrule;
}
-void cal_db_rrule_set_rrule_to_event(cal_rrule_s *rrule, calendar_record_h event)
-{
- cal_event_s *_event;
-
- RET_IF(NULL == rrule);
- RET_IF(NULL == event);
-
- _event = (cal_event_s *)event;
-
- _event->freq = rrule->freq;
- _event->range_type = rrule->range_type;
- _event->until = rrule->until;
- _event->count = rrule->count;
- _event->interval = rrule->interval;
- _event->bysecond = rrule->bysecond;
- _event->byminute = rrule->byminute;
- _event->byhour = rrule->byhour;
- _event->byday = rrule->byday;
- _event->bymonthday = rrule->bymonthday;
- _event->byyearday = rrule->byyearday;
- _event->byweekno = rrule->byweekno;
- _event->bymonth = rrule->bymonth;
- _event->bysetpos = rrule->bysetpos;
- _event->wkst = rrule->wkst;
-}
-
-void cal_db_rrule_set_rrule_to_todo(cal_rrule_s *rrule, calendar_record_h todo)
+void cal_db_rrule_set_rrule_to_record(cal_rrule_s *rrule, calendar_record_h record)
{
- cal_todo_s *_todo;
-
RET_IF(NULL == rrule);
- RET_IF(NULL == todo);
-
- _todo = (cal_todo_s *)todo;
-
- _todo->freq = rrule->freq;
- _todo->range_type = rrule->range_type;
- _todo->until = rrule->until;
- _todo->count = rrule->count;
- _todo->interval = rrule->interval;
- _todo->bysecond = rrule->bysecond;
- _todo->byminute = rrule->byminute;
- _todo->byhour = rrule->byhour;
- _todo->byday = rrule->byday;
- _todo->bymonthday = rrule->bymonthday;
- _todo->byyearday = rrule->byyearday;
- _todo->byweekno = rrule->byweekno;
- _todo->bymonth = rrule->bymonth;
- _todo->bysetpos = rrule->bysetpos;
- _todo->wkst = rrule->wkst;
-}
-
-void cal_db_rrule_get_rrule_from_todo(calendar_record_h todo, cal_rrule_s **rrule)
-{
- cal_rrule_s *_rrule;
- cal_todo_s *_todo;
-
- RET_IF(NULL == todo);
-
- _todo = (cal_todo_s *)todo;
-
- _rrule = calloc(1, sizeof(cal_rrule_s));
- RETM_IF(NULL == _rrule, "calloc() Fail");
-
- _rrule->freq = _todo->freq;
- _rrule->range_type = _todo->range_type;
- _rrule->until = _todo->until;
- _rrule->count = _todo->count;
- _rrule->interval = _todo->interval;
- _rrule->bysecond = _todo->bysecond;
- _rrule->byminute = _todo->byminute;
- _rrule->byhour = _todo->byhour;
- _rrule->byday = _todo->byday;
- _rrule->bymonthday = _todo->bymonthday;
- _rrule->byyearday = _todo->byyearday;
- _rrule->byweekno = _todo->byweekno;
- _rrule->bymonth = _todo->bymonth;
- _rrule->bysetpos = _todo->bysetpos;
- _rrule->wkst = _todo->wkst;
+ RET_IF(NULL == record);
- *rrule = _rrule;
+ cal_record_s *rec = (cal_record_s *)record;
+ switch (rec->type) {
+ case CAL_RECORD_TYPE_EVENT:
+ ((cal_event_s *)record)->freq = rrule->freq;
+ ((cal_event_s *)record)->range_type = rrule->range_type;
+ ((cal_event_s *)record)->until = rrule->until;
+ ((cal_event_s *)record)->count = rrule->count;
+ ((cal_event_s *)record)->interval = rrule->interval;
+ ((cal_event_s *)record)->bysecond = rrule->bysecond;
+ ((cal_event_s *)record)->byminute = rrule->byminute;
+ ((cal_event_s *)record)->byhour = rrule->byhour;
+ ((cal_event_s *)record)->byday = rrule->byday;
+ ((cal_event_s *)record)->bymonthday = rrule->bymonthday;
+ ((cal_event_s *)record)->byyearday = rrule->byyearday;
+ ((cal_event_s *)record)->byweekno = rrule->byweekno;
+ ((cal_event_s *)record)->bymonth = rrule->bymonth;
+ ((cal_event_s *)record)->bysetpos = rrule->bysetpos;
+ ((cal_event_s *)record)->wkst = rrule->wkst;
+ break;
+ case CAL_RECORD_TYPE_TODO:
+ ((cal_todo_s *)record)->freq = rrule->freq;
+ ((cal_todo_s *)record)->range_type = rrule->range_type;
+ ((cal_todo_s *)record)->until = rrule->until;
+ ((cal_todo_s *)record)->count = rrule->count;
+ ((cal_todo_s *)record)->interval = rrule->interval;
+ ((cal_todo_s *)record)->bysecond = rrule->bysecond;
+ ((cal_todo_s *)record)->byminute = rrule->byminute;
+ ((cal_todo_s *)record)->byhour = rrule->byhour;
+ ((cal_todo_s *)record)->byday = rrule->byday;
+ ((cal_todo_s *)record)->bymonthday = rrule->bymonthday;
+ ((cal_todo_s *)record)->byyearday = rrule->byyearday;
+ ((cal_todo_s *)record)->byweekno = rrule->byweekno;
+ ((cal_todo_s *)record)->bymonth = rrule->bymonth;
+ ((cal_todo_s *)record)->bysetpos = rrule->bysetpos;
+ ((cal_todo_s *)record)->wkst = rrule->wkst;
+ break;
+ default:
+ break;
+ }
}
int _cal_db_rrule_insert_record(int id, cal_rrule_s *rrule)
#ifndef __CAL_DB_RRULE_H__
#define __CAL_DB_RRULE_H__
-void cal_db_rrule_set_default(calendar_record_h event);
+int cal_db_rrule_get_rrule_from_record(calendar_record_h record, cal_rrule_s **out_rrule);
+int cal_db_rrule_set_rrule_to_record(cal_rrule_s *rrule, calendar_record_h record);
int cal_db_rrule_insert_record(int id, cal_rrule_s *rrule);
int cal_db_rrule_update_record(int id, cal_rrule_s *rrule);
int cal_db_rrule_get_rrule(int id, cal_rrule_s **rrule);
-void cal_db_rrule_get_rrule_from_event(calendar_record_h event, cal_rrule_s **rrule);
-void cal_db_rrule_set_rrule_to_event(cal_rrule_s *rrule, calendar_record_h event);
-void cal_db_rrule_get_rrule_from_todo(calendar_record_h todo, cal_rrule_s **rrule);
-void cal_db_rrule_set_rrule_to_todo(cal_rrule_s *rrule, calendar_record_h todo);
#endif /* __CAL_DB_RRULE_H__ */
static TLS bool todo_change=false;
static TLS bool calendar_change=false;
-static inline void _cal_db_util_notify_event_change(void)
+static void _cal_db_util_notify_event_change(void)
{
int fd = open(CAL_NOTI_EVENT_CHANGED, O_TRUNC | O_RDWR);
if (0 <= fd) {
#define CAL_SQLITE_ROW SQLITE_ROW
-void cal_db_util_notify_ipc_ready(void);
int cal_db_util_open(void);
int cal_db_util_close(void);
int cal_db_util_query_prepare(char *query, sqlite3_stmt** stmt);