4 * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
25 #include "cal_internal.h"
26 #include "cal_typedef.h"
28 #include "cal_record.h"
30 #define __CHECK_READ_ONLY_PROPERTY() \
31 if (CAL_PROPERTY_CHECK_FLAGS(property_id, CAL_PROPERTY_FLAGS_READ_ONLY) == true) { \
32 ERR("Invalid parameter: Don't try to change read-only property."); \
33 return CALENDAR_ERROR_NOT_PERMITTED; \
36 extern cal_record_plugin_cb_s cal_record_calendar_plugin_cb;
37 extern cal_record_plugin_cb_s cal_record_event_plugin_cb;
38 extern cal_record_plugin_cb_s cal_record_todo_plugin_cb;
39 extern cal_record_plugin_cb_s cal_record_alarm_plugin_cb;
40 extern cal_record_plugin_cb_s cal_record_attendee_plugin_cb;
41 extern cal_record_plugin_cb_s cal_record_timezone_plugin_cb;
42 extern cal_record_plugin_cb_s cal_record_updated_info_plugin_cb;
43 extern cal_record_plugin_cb_s cal_record_instance_normal_plugin_cb;
44 extern cal_record_plugin_cb_s cal_record_instance_allday_plugin_cb;
45 extern cal_record_plugin_cb_s cal_record_instance_normal_extended_plugin_cb;
46 extern cal_record_plugin_cb_s cal_record_instance_allday_extended_plugin_cb;
47 extern cal_record_plugin_cb_s cal_record_search_plugin_cb;
48 extern cal_record_plugin_cb_s cal_record_extended_plugin_cb;
50 cal_record_plugin_cb_s* cal_record_get_plugin_cb(cal_record_type_e type)
53 case CAL_RECORD_TYPE_CALENDAR:
54 return (&cal_record_calendar_plugin_cb);
55 case CAL_RECORD_TYPE_EVENT:
56 return (&cal_record_event_plugin_cb);
57 case CAL_RECORD_TYPE_TODO:
58 return (&cal_record_todo_plugin_cb);
59 case CAL_RECORD_TYPE_ALARM:
60 return (&cal_record_alarm_plugin_cb);
61 case CAL_RECORD_TYPE_ATTENDEE:
62 return (&cal_record_attendee_plugin_cb);
63 case CAL_RECORD_TYPE_TIMEZONE:
64 return (&cal_record_timezone_plugin_cb);
65 case CAL_RECORD_TYPE_INSTANCE_NORMAL:
66 return (&cal_record_instance_normal_plugin_cb);
67 case CAL_RECORD_TYPE_INSTANCE_ALLDAY:
68 return (&cal_record_instance_allday_plugin_cb);
69 case CAL_RECORD_TYPE_INSTANCE_NORMAL_EXTENDED:
70 return (&cal_record_instance_normal_extended_plugin_cb);
71 case CAL_RECORD_TYPE_INSTANCE_ALLDAY_EXTENDED:
72 return (&cal_record_instance_allday_extended_plugin_cb);
73 case CAL_RECORD_TYPE_UPDATED_INFO:
74 return (&cal_record_updated_info_plugin_cb);
75 case CAL_RECORD_TYPE_SEARCH:
76 return (&cal_record_search_plugin_cb);
77 case CAL_RECORD_TYPE_EXTENDED:
78 return (&cal_record_extended_plugin_cb);
84 static inline void _cal_record_set_property_flag(calendar_record_h record, unsigned int property_id, cal_properties_flag_e flag)
87 cal_record_s *_record = NULL;
89 _record = (cal_record_s *)record;
90 index = property_id & 0x00000FFF;
92 if (NULL == _record->properties_flags) {
94 cal_view_get_property_info(_record->view_uri, &count);
97 _record->properties_flags = calloc(count, sizeof(char));
98 _record->properties_max_count = count;
99 if (NULL == _record->properties_flags) {
100 /* LCOV_EXCL_START */
101 ERR("calloc() Fail");
106 /* LCOV_EXCL_START */
107 ERR("get property_info_Fail");
113 _record->properties_flags[index] |= flag;
114 _record->property_flag |= flag;
117 bool cal_record_check_property_flag(calendar_record_h record, unsigned int property_id, cal_properties_flag_e flag)
120 cal_record_s *_record = NULL;
122 _record = (cal_record_s *)record;
123 index = property_id & 0x00000FFF;
125 if (NULL == _record->properties_flags) {
126 if (flag == CAL_PROPERTY_FLAG_PROJECTION)
132 if (flag == CAL_PROPERTY_FLAG_PROJECTION) {
133 if (_record->property_flag & CAL_PROPERTY_FLAG_PROJECTION) {
134 if (_record->properties_flags[index] & CAL_PROPERTY_FLAG_PROJECTION)
143 return (_record->properties_flags[index] & flag) ? true : false;
147 int cal_record_set_projection(calendar_record_h record, const unsigned int *projection, const int projection_count, int properties_max_count)
151 cal_record_s *_record = NULL;
153 RETV_IF(NULL == record, -1);
155 _record = (cal_record_s *)record;
157 CAL_FREE(_record->properties_flags);
158 _record->properties_flags = calloc(properties_max_count, sizeof(char));
160 RETVM_IF(NULL == _record->properties_flags, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
162 _record->properties_max_count = properties_max_count;
164 for (i = 0; i < projection_count; i++)
165 _cal_record_set_property_flag(record, projection[i], CAL_PROPERTY_FLAG_PROJECTION);
167 return CALENDAR_ERROR_NONE;
170 API int calendar_record_create(const char* view_uri, calendar_record_h* out_record)
172 int ret = CALENDAR_ERROR_NONE;
173 cal_record_type_e type = CAL_RECORD_TYPE_INVALID;
175 RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
176 RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
178 type = cal_view_get_type(view_uri);
179 RETV_IF(CAL_RECORD_TYPE_INVALID == type, CALENDAR_ERROR_INVALID_PARAMETER);
181 cal_record_plugin_cb_s *plugin_cb = cal_record_get_plugin_cb(type);
182 RETV_IF(NULL == plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
183 RETVM_IF(NULL == plugin_cb->create, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted in [%s]", view_uri);
185 ret = plugin_cb->create(out_record);
187 if (CALENDAR_ERROR_NONE == ret)
188 CAL_RECORD_INIT_COMMON((cal_record_s*)*out_record, type, plugin_cb, cal_view_get_uri(view_uri));
193 API int calendar_record_destroy(calendar_record_h record, bool delete_child)
195 int ret = CALENDAR_ERROR_NONE;
197 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
199 cal_record_s *temp = (cal_record_s*)(record);
201 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
202 RETVM_IF(NULL == temp->plugin_cb->destroy, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted in [%s]", temp->view_uri);
204 CAL_FREE(temp->properties_flags);
206 ret = temp->plugin_cb->destroy(record, delete_child);
211 API int calendar_record_clone(calendar_record_h record, calendar_record_h* out_record)
213 int ret = CALENDAR_ERROR_NONE;
215 cal_record_s *temp = (cal_record_s*)(record);
217 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
218 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
219 RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
220 RETVM_IF(NULL == temp->plugin_cb->clone, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted in [%s]", temp->view_uri);
222 ret = temp->plugin_cb->clone(record, out_record);
227 API int calendar_record_get_uri_p(calendar_record_h record, char** out_str)
229 int ret = CALENDAR_ERROR_NONE;
231 cal_record_s *temp = (cal_record_s*)(record);
233 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
234 RETV_IF(NULL == out_str, CALENDAR_ERROR_INVALID_PARAMETER);
236 *out_str = (char*)(temp->view_uri);
241 API int calendar_record_get_str(calendar_record_h record, unsigned int property_id, char** out_str)
243 int ret = CALENDAR_ERROR_NONE;
245 cal_record_s *temp = (cal_record_s*)(record);
247 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
248 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
249 RETV_IF(NULL == out_str, CALENDAR_ERROR_INVALID_PARAMETER);
250 RETVM_IF(NULL == temp->plugin_cb->get_str, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
251 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
253 ret = temp->plugin_cb->get_str(record, property_id, out_str);
258 API int calendar_record_get_str_p(calendar_record_h record, unsigned int property_id, char** out_str)
260 int ret = CALENDAR_ERROR_NONE;
262 cal_record_s *temp = (cal_record_s*)(record);
264 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
265 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
266 RETV_IF(NULL == out_str, CALENDAR_ERROR_INVALID_PARAMETER);
267 RETVM_IF(NULL == temp->plugin_cb->get_str_p, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
268 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
270 ret = temp->plugin_cb->get_str_p(record, property_id, out_str);
274 API int calendar_record_get_int(calendar_record_h record, unsigned int property_id, int* out_value)
276 int ret = CALENDAR_ERROR_NONE;
278 cal_record_s *temp = (cal_record_s*)(record);
280 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
281 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
282 RETV_IF(NULL == out_value, CALENDAR_ERROR_INVALID_PARAMETER);
283 RETVM_IF(NULL == temp->plugin_cb->get_int, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
284 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
286 ret = temp->plugin_cb->get_int(record, property_id, out_value);
291 API int calendar_record_get_double(calendar_record_h record, unsigned int property_id, double* out_value)
293 int ret = CALENDAR_ERROR_NONE;
295 cal_record_s *temp = (cal_record_s*)(record);
297 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
298 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
299 RETV_IF(NULL == out_value, CALENDAR_ERROR_INVALID_PARAMETER);
300 RETVM_IF(NULL == temp->plugin_cb->get_double, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
301 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
303 ret = temp->plugin_cb->get_double(record, property_id, out_value);
307 API int calendar_record_get_lli(calendar_record_h record, unsigned int property_id, long long int* out_value)
309 int ret = CALENDAR_ERROR_NONE;
311 cal_record_s *temp = (cal_record_s*)(record);
313 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
314 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
315 RETV_IF(NULL == out_value, CALENDAR_ERROR_INVALID_PARAMETER);
316 RETVM_IF(NULL == temp->plugin_cb->get_lli, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
317 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
319 ret = temp->plugin_cb->get_lli(record, property_id, out_value);
324 API int calendar_record_get_caltime(calendar_record_h record, unsigned int property_id, calendar_time_s *out_value)
326 int ret = CALENDAR_ERROR_NONE;
328 cal_record_s *temp = (cal_record_s*)(record);
330 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
331 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
332 RETV_IF(NULL == out_value, CALENDAR_ERROR_INVALID_PARAMETER);
333 RETVM_IF(NULL == temp->plugin_cb->get_caltime, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
334 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
336 ret = temp->plugin_cb->get_caltime(record, property_id, out_value);
341 API int calendar_record_set_str(calendar_record_h record, unsigned int property_id, const char* value)
343 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
344 __CHECK_READ_ONLY_PROPERTY();
346 int ret = cal_record_set_str(record, property_id, value);
351 API int calendar_record_set_int(calendar_record_h record, unsigned int property_id, int value)
353 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
354 __CHECK_READ_ONLY_PROPERTY();
356 int ret = cal_record_set_int(record, property_id, value);
361 API int calendar_record_set_double(calendar_record_h record, unsigned int property_id, double value)
363 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
364 __CHECK_READ_ONLY_PROPERTY();
366 int ret = cal_record_set_double(record, property_id, value);
371 API int calendar_record_set_lli(calendar_record_h record, unsigned int property_id, long long int value)
373 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
374 __CHECK_READ_ONLY_PROPERTY();
376 int ret = cal_record_set_lli(record, property_id, value);
381 API int calendar_record_set_caltime(calendar_record_h record, unsigned int property_id, calendar_time_s value)
383 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
384 __CHECK_READ_ONLY_PROPERTY();
386 int ret = cal_record_set_caltime(record, property_id, value);
391 API int calendar_record_add_child_record(calendar_record_h record, unsigned int property_id, calendar_record_h child_record)
393 int ret = CALENDAR_ERROR_NONE;
395 cal_record_s *temp = (cal_record_s*)(record);
397 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
398 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
399 RETV_IF(NULL == child_record, CALENDAR_ERROR_INVALID_PARAMETER);
400 RETVM_IF(NULL == temp->plugin_cb->add_child_record, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
401 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
403 ret = temp->plugin_cb->add_child_record(record, property_id, child_record);
407 API int calendar_record_remove_child_record(calendar_record_h record, unsigned int property_id, calendar_record_h child_record)
409 int ret = CALENDAR_ERROR_NONE;
411 cal_record_s *temp = (cal_record_s*)(record);
413 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
414 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
415 RETV_IF(NULL == child_record, CALENDAR_ERROR_INVALID_PARAMETER);
416 RETVM_IF(NULL == temp->plugin_cb->remove_child_record, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
417 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
419 ret = temp->plugin_cb->remove_child_record(record, property_id, child_record);
424 API int calendar_record_get_child_record_count(calendar_record_h record, unsigned int property_id, unsigned int* count)
426 int ret = CALENDAR_ERROR_NONE;
428 cal_record_s *temp = (cal_record_s*)(record);
430 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
431 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
432 RETV_IF(NULL == count, CALENDAR_ERROR_INVALID_PARAMETER);
433 RETVM_IF(NULL == temp->plugin_cb->get_child_record_count, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
434 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
436 ret = temp->plugin_cb->get_child_record_count(record, property_id, count);
440 API int calendar_record_get_child_record_at_p(calendar_record_h record, unsigned int property_id, int index, calendar_record_h* child_record)
442 int ret = CALENDAR_ERROR_NONE;
444 cal_record_s *temp = (cal_record_s*)(record);
446 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
447 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
448 RETV_IF(NULL == child_record, CALENDAR_ERROR_INVALID_PARAMETER);
449 RETVM_IF(NULL == temp->plugin_cb->get_child_record_at_p, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
450 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
452 ret = temp->plugin_cb->get_child_record_at_p(record, property_id, index, child_record);
457 API int calendar_record_clone_child_record_list(calendar_record_h record, unsigned int property_id, calendar_list_h* out_list)
459 int ret = CALENDAR_ERROR_NONE;
461 cal_record_s *temp = (cal_record_s*)(record);
463 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
464 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
465 RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
466 RETVM_IF(NULL == temp->plugin_cb->clone_child_record_list, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
467 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
469 ret = temp->plugin_cb->clone_child_record_list(record, property_id, out_list);
474 int cal_record_set_str(calendar_record_h record, unsigned int property_id, const char* value)
476 int ret = CALENDAR_ERROR_NONE;
478 cal_record_s *temp = (cal_record_s*)(record);
480 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
481 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
482 RETVM_IF(NULL == temp->plugin_cb->set_str, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
483 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
485 ret = temp->plugin_cb->set_str(record, property_id, value);
486 if (CALENDAR_ERROR_NONE == ret)
487 _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
492 int cal_record_set_int(calendar_record_h record, unsigned int property_id, int value)
494 int ret = CALENDAR_ERROR_NONE;
496 cal_record_s *temp = (cal_record_s*)(record);
498 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
499 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
500 RETVM_IF(NULL == temp->plugin_cb->set_int, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
501 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
503 ret = temp->plugin_cb->set_int(record, property_id, value);
504 if (CALENDAR_ERROR_NONE == ret)
505 _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
510 int cal_record_set_double(calendar_record_h record, unsigned int property_id, double value)
512 int ret = CALENDAR_ERROR_NONE;
514 cal_record_s *temp = (cal_record_s*)(record);
516 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
517 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
518 RETVM_IF(NULL == temp->plugin_cb->set_double, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
519 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
521 ret = temp->plugin_cb->set_double(record, property_id, value);
522 if (CALENDAR_ERROR_NONE == ret)
523 _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
528 int cal_record_set_lli(calendar_record_h record, unsigned int property_id, long long int value)
530 int ret = CALENDAR_ERROR_NONE;
532 cal_record_s *temp = (cal_record_s*)(record);
534 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
535 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
536 RETVM_IF(NULL == temp->plugin_cb->set_lli, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
537 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
539 ret = temp->plugin_cb->set_lli(record, property_id, value);
540 if (CALENDAR_ERROR_NONE == ret)
541 _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
546 int cal_record_set_caltime(calendar_record_h record, unsigned int property_id, calendar_time_s value)
548 int ret = CALENDAR_ERROR_NONE;
550 cal_record_s *temp = (cal_record_s*)(record);
552 RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
553 RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
554 RETVM_IF(NULL == temp->plugin_cb->set_caltime, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted(%x) in [%s]", property_id, temp->view_uri);
555 RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
557 ret = temp->plugin_cb->set_caltime(record, property_id, value);
558 if (CALENDAR_ERROR_NONE == ret)
559 _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);