+//Getters & Setters of local caltime
+EXPORT_API calendar_time_s *cal_caltime_create(void)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ calendar_time_s *caltime = NULL;
+ caltime = calloc(1, sizeof(calendar_time_s));
+ WARN_IF(NULL == caltime, "calloc() Fail");
+
+ return caltime;
+}
+
+EXPORT_API void cal_caltime_destroy(calendar_time_s *caltime)
+{
+ CAL_FREE(caltime);
+}
+
+
+EXPORT_API calendar_time_type_e cal_caltime_get_local_type(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ return caltime->type;
+}
+
+
+EXPORT_API int cal_caltime_set_local_type(calendar_time_s *caltime, calendar_time_type_e type)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ caltime->type = type;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+EXPORT_API long long int cal_caltime_get_local_utime(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_UTIME != caltime->type, 0);
+
+ return caltime->time.utime;
+}
+
+EXPORT_API int cal_caltime_set_local_utime(calendar_time_s *caltime, long long int utime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_UTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.utime = utime;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+EXPORT_API int cal_caltime_get_local_year(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, 0);
+
+ return caltime->time.date.year;
+}
+
+EXPORT_API int cal_caltime_set_local_year(calendar_time_s *caltime, int year)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.date.year = year;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+
+EXPORT_API int cal_caltime_get_local_month(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, 0);
+
+ return caltime->time.date.month;
+}
+
+EXPORT_API int cal_caltime_set_local_month(calendar_time_s *caltime, int month)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.date.year = month;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+EXPORT_API int cal_caltime_get_local_mday(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, 0);
+
+ return caltime->time.date.mday;
+}
+
+EXPORT_API int cal_caltime_set_local_mday(calendar_time_s *caltime, int mday)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.date.mday = mday;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+EXPORT_API int cal_caltime_get_local_hour(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, 0);
+
+ return caltime->time.date.hour;
+}
+
+EXPORT_API int cal_caltime_set_local_hour(calendar_time_s *caltime, int hour)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.date.hour = hour;
+
+ return CALENDAR_ERROR_NONE;
+}
+EXPORT_API int cal_caltime_get_local_minute(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, 0);
+
+ return caltime->time.date.minute;
+}
+
+EXPORT_API int cal_caltime_set_local_minute(calendar_time_s *caltime, int minute)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.date.minute = minute;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+EXPORT_API int cal_caltime_get_local_second(calendar_time_s *caltime)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, 0);
+
+ return caltime->time.date.second;
+}
+
+EXPORT_API int cal_caltime_set_local_second(calendar_time_s *caltime, int second)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+ RETV_IF(NULL == caltime, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(CALENDAR_TIME_LOCALTIME != caltime->type, CALENDAR_ERROR_INVALID_PARAMETER);
+
+ caltime->time.date.second = second;
+
+ return CALENDAR_ERROR_NONE;
+}
+
+EXPORT_API int cal_caltime_set_caltime(calendar_record_h record, unsigned int property_id, calendar_time_s *value)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
+ __CHECK_READ_ONLY_PROPERTY();
+
+ int ret = cal_record_set_caltime(record, property_id, *value);
+
+ return ret;
+}
+
+
+
+EXPORT_API int cal_caltime_get_caltime(calendar_record_h record, unsigned int property_id, calendar_time_s **out_value)
+{
+ CHECK_CALENDAR_SUPPORTED(CALENDAR_FEATURE);
+
+ int ret = CALENDAR_ERROR_NONE;
+
+ cal_record_s *temp = (cal_record_s*)(record);
+
+ RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_value, CALENDAR_ERROR_INVALID_PARAMETER);
+ RETVM_IF(NULL == temp->plugin_cb->get_caltime, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
+ RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
+
+ *out_value = cal_caltime_create();
+ ret = temp->plugin_cb->get_caltime(record, property_id, *out_value);
+
+ return ret;
+}
+
+EXPORT_API int calendar_record_get_caltime(calendar_record_h record, unsigned int property_id, calendar_time_s *out_value)