4 * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Dohyung Jin <dh.jin@samsung.com>
7 * Jongwon Lee <gogosing.lee@samsung.com>
8 * Donghee Ye <donghee.ye@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 #ifndef __TIZEN_SOCIAL_CTSVC_RECORD_H__
25 #define __TIZEN_SOCIAL_CTSVC_RECORD_H__
27 #define CTSVC_RECORD_INIT_BASE(base, type, cb, uri) do {\
28 (base)->r_type = (type);\
29 (base)->plugin_cbs = (cb);\
30 (base)->view_uri = (uri);\
31 (base)->property_max_count = 0;\
34 #define CTSVC_RECORD_COPY_BASE(dest, src) do {\
35 (dest)->r_type = (src)->r_type;\
36 (dest)->plugin_cbs = (src)->plugin_cbs;\
37 (dest)->view_uri = (src)->view_uri;\
38 (dest)->property_max_count = (src)->property_max_count;\
39 (dest)->property_flag = (src)->property_flag;\
40 if ((src)->properties_flags) \
42 (dest)->properties_flags = calloc((dest)->property_max_count, sizeof(char));\
43 memcpy((dest)->properties_flags,(src)->properties_flags,sizeof(char)*(dest)->property_max_count);\
47 #define CTSVC_RECORD_RESET_PROPERTY_FLAGS(base)do {\
48 if ((base)->properties_flags) \
50 free((base)->properties_flags); \
51 (base)->property_max_count = 0;\
52 (base)->properties_flags = NULL;\
53 (base)->property_flag = 0;\
57 int ctsvc_record_set_property_flag(ctsvc_record_s* _record, int property_id, contacts_property_flag_e flag);
58 int ctsvc_record_set_projection_flags( contacts_record_h record, const unsigned int *projection, const unsigned int projection_count, const unsigned int property_max_count);
59 int ctsvc_record_set_str( contacts_record_h record, unsigned int property_id, const char* value );
60 int ctsvc_record_set_bool( contacts_record_h record, unsigned int property_id, bool value );
61 int ctsvc_record_set_int( contacts_record_h record, unsigned int property_id, int value );
62 int ctsvc_record_set_lli( contacts_record_h record, unsigned int property_id, long long int value );
63 int ctsvc_record_set_double( contacts_record_h record, unsigned int property_id, double value );
64 bool ctsvc_record_check_property_flag(const ctsvc_record_s* s_record, unsigned int property_id, contacts_property_flag_e flag);
66 #endif /* __TIZEN_SOCIAL_CTSVC_RECORD_H__ */