summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-04 17:28:06 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-04 17:28:06 -0200
commit2339c34a8b737e2ef56e955ff61fa47ebff29835 (patch)
tree88990053b8200c93a0aab7f168af3117414f0e47
parent2ed2b84d6b5c6b9e43151b5fabf5e8f7eabc1b62 (diff)
ecordova: More things
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile_Ecordova.am35
-rw-r--r--src/lib/ecordova/ecordova_main.c6
-rw-r--r--src/modules/ecordova/linux/ecordova_filewriter.c1
-rw-r--r--src/modules/ecordova/tizen/ecordova_batterystatus.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contact.c34
-rw-r--r--src/modules/ecordova/tizen/ecordova_contact_private.h5
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactaddress.c39
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactaddress_private.h3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactfield.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactfield_private.h3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactname.c3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactname_private.h3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactorganization.c3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactorganization_private.h3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts.c4
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_record_utils.c4
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_record_utils.h3
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_service.c271
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_service.h403
-rw-r--r--src/modules/ecordova/tizen/ecordova_systeminfo.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_tizen.c13
-rw-r--r--src/modules/ecordova/tizen/ecordova_vibration.c2
-rw-r--r--src/tests/ecordova/ecordova_contacts_test.c132
24 files changed, 821 insertions, 156 deletions
diff --git a/configure.ac b/configure.ac
index 2d291f8ef9..f278a36f8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4599,7 +4599,6 @@ EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [eo])
4599EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [efl]) 4599EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [efl])
4600EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore]) 4600EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore])
4601 4601
4602EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_CONTACTS_SERVICE], [contacts-service2])
4603EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_INFO], [capi-system-info]) 4602EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_INFO], [capi-system-info])
4604EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_SENSOR], [capi-system-sensor]) 4603EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_SENSOR], [capi-system-sensor])
4605EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_LOCATION_MANAGER], [capi-location-manager]) 4604EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_LOCATION_MANAGER], [capi-location-manager])
diff --git a/src/Makefile_Ecordova.am b/src/Makefile_Ecordova.am
index 342b4c4105..1de10a678d 100644
--- a/src/Makefile_Ecordova.am
+++ b/src/Makefile_Ecordova.am
@@ -100,8 +100,6 @@ modules_ecordova_linux_module_la_DEPENDENCIES = \
100modules_ecordova_linux_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ 100modules_ecordova_linux_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
101modules_ecordova_linux_module_la_LIBTOOLFLAGS = --tag=disable-static 101modules_ecordova_linux_module_la_LIBTOOLFLAGS = --tag=disable-static
102 102
103if HAVE_TIZEN_CONFIGURATION_MANAGER
104
105ecordovatizenpkgdir = $(libdir)/ecordova/tizen/$(MODULE_ARCH) 103ecordovatizenpkgdir = $(libdir)/ecordova/tizen/$(MODULE_ARCH)
106ecordovatizenpkg_LTLIBRARIES = modules/ecordova/tizen/module.la 104ecordovatizenpkg_LTLIBRARIES = modules/ecordova/tizen/module.la
107 105
@@ -112,17 +110,25 @@ $(install_ecordovatizenpkgLTLIBRARIES): install-libLTLIBRARIES
112 110
113modules_ecordova_tizen_module_la_SOURCES = \ 111modules_ecordova_tizen_module_la_SOURCES = \
114modules/ecordova/tizen/ecordova_tizen.c \ 112modules/ecordova/tizen/ecordova_tizen.c \
115modules/ecordova/tizen/ecordova_console.c \ 113modules/ecordova/tizen/ecordova_contactaddress.c \
116modules/ecordova/tizen/ecordova_directoryentry.c \ 114modules/ecordova/tizen/ecordova_contact.c \
117modules/ecordova/tizen/ecordova_directoryreader.c \ 115modules/ecordova/tizen/ecordova_contactfield.c \
118modules/ecordova/tizen/ecordova_entry.c \ 116modules/ecordova/tizen/ecordova_contactname.c \
119modules/ecordova/tizen/ecordova_fileentry.c \ 117modules/ecordova/tizen/ecordova_contactorganization.c \
120modules/ecordova/tizen/ecordova_file.c \ 118modules/ecordova/tizen/ecordova_contacts.c \
121modules/ecordova/tizen/ecordova_filereader.c \ 119modules/ecordova/tizen/ecordova_contacts_service.c \
122modules/ecordova/tizen/ecordova_filetransfer.c \ 120modules/ecordova/tizen/ecordova_contacts_record_utils.c \
123modules/ecordova/tizen/ecordova_filewriter.c \ 121modules/ecordova/tizen/ecordova_batterystatus.c \
122modules/ecordova/tizen/ecordova_device.c \
123modules/ecordova/tizen/ecordova_devicemotion.c \
124modules/ecordova/tizen/ecordova_deviceorientation.c \
125modules/ecordova/tizen/ecordova_geolocation.c \
126modules/ecordova/tizen/ecordova_globalization.c \
124modules/ecordova/tizen/ecordova_media.c \ 127modules/ecordova/tizen/ecordova_media.c \
125modules/ecordova/tizen/ecordova_mediafile.c 128modules/ecordova/tizen/ecordova_mediafile.c \
129modules/ecordova/tizen/ecordova_networkinformation.c \
130modules/ecordova/tizen/ecordova_systeminfo.c \
131modules/ecordova/tizen/ecordova_vibration.c
126modules_ecordova_tizen_module_la_CPPFLAGS = \ 132modules_ecordova_tizen_module_la_CPPFLAGS = \
127-I$(top_builddir)/src/lib/efl \ 133-I$(top_builddir)/src/lib/efl \
128@ECORDOVA_CFLAGS@ -DEFL_ECORDOVA_BUILD 134@ECORDOVA_CFLAGS@ -DEFL_ECORDOVA_BUILD
@@ -133,8 +139,6 @@ modules_ecordova_tizen_module_la_DEPENDENCIES = \
133modules_ecordova_tizen_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ 139modules_ecordova_tizen_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
134modules_ecordova_tizen_module_la_LIBTOOLFLAGS = --tag=disable-static 140modules_ecordova_tizen_module_la_LIBTOOLFLAGS = --tag=disable-static
135 141
136endif
137
138### Unit tests 142### Unit tests
139 143
140if EFL_ENABLE_TESTS 144if EFL_ENABLE_TESTS
@@ -142,7 +146,6 @@ if EFL_ENABLE_TESTS
142check_PROGRAMS += tests/ecordova/ecordova_suite 146check_PROGRAMS += tests/ecordova/ecordova_suite
143TESTS += tests/ecordova/ecordova_suite 147TESTS += tests/ecordova/ecordova_suite
144 148
145
146tests_ecordova_ecordova_suite_SOURCES = \ 149tests_ecordova_ecordova_suite_SOURCES = \
147tests/ecordova/ecordova_suite.c \ 150tests/ecordova/ecordova_suite.c \
148tests/ecordova/ecordova_console_test.c \ 151tests/ecordova/ecordova_console_test.c \
@@ -166,7 +169,7 @@ tests/ecordova/ecordova_vibration_test.c \
166tests/ecordova/ecordova_mediafile_test.c \ 169tests/ecordova/ecordova_mediafile_test.c \
167tests/ecordova/ecordova_globalization_test.c 170tests/ecordova/ecordova_globalization_test.c
168 171
169$(tests_ecordova_ecordova_suite_SOURCES:%.c=%.$(OBJEXT)): modules/ecordova/linux/module.la 172$(tests_ecordova_ecordova_suite_SOURCES:%.c=%.$(OBJEXT)): modules/ecordova/linux/module.la modules/ecordova/tizen/module.la
170 173
171tests_ecordova_ecordova_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 174tests_ecordova_ecordova_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
172-DTESTS_SRC_DIR=\"$(abs_top_srcdir)/src/tests/ecordova\" \ 175-DTESTS_SRC_DIR=\"$(abs_top_srcdir)/src/tests/ecordova\" \
diff --git a/src/lib/ecordova/ecordova_main.c b/src/lib/ecordova/ecordova_main.c
index 29200f9605..c09e9c4b5e 100644
--- a/src/lib/ecordova/ecordova_main.c
+++ b/src/lib/ecordova/ecordova_main.c
@@ -142,9 +142,9 @@ _ecordova_engine_load()
142 fprintf(stderr, "is in tree? %d\n", (int)run_in_tree); fflush(stderr); 142 fprintf(stderr, "is in tree? %d\n", (int)run_in_tree); fflush(stderr);
143 143
144 const char *built_modules[] = { 144 const char *built_modules[] = {
145#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER 145//#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
146 "tizen", 146 "tizen",
147#endif 147//#endif
148 "linux", 148 "linux",
149 NULL 149 NULL
150 }; 150 };
@@ -311,6 +311,8 @@ ECORDOVA_define_data(Vibration)
311#include "ecordova_batterystatus.eo.c" 311#include "ecordova_batterystatus.eo.c"
312#include "ecordova_contactaddress.eo.h" 312#include "ecordova_contactaddress.eo.h"
313#include "ecordova_contactaddress.eo.c" 313#include "ecordova_contactaddress.eo.c"
314#include "ecordova_contacts.eo.h"
315#include "ecordova_contacts.eo.c"
314#include "ecordova_contact.eo.h" 316#include "ecordova_contact.eo.h"
315#include "ecordova_contact.eo.c" 317#include "ecordova_contact.eo.c"
316#include "ecordova_contactfield.eo.h" 318#include "ecordova_contactfield.eo.h"
diff --git a/src/modules/ecordova/linux/ecordova_filewriter.c b/src/modules/ecordova/linux/ecordova_filewriter.c
index 735b317419..d721c89fc9 100644
--- a/src/modules/ecordova/linux/ecordova_filewriter.c
+++ b/src/modules/ecordova/linux/ecordova_filewriter.c
@@ -68,7 +68,6 @@ _ecordova_filewriter_eo_base_constructor(Eo *obj,
68 pd->truncate_size = 0; 68 pd->truncate_size = 0;
69 69
70 eo_do_super(obj, MY_CLASS, obj = eo_constructor()); 70 eo_do_super(obj, MY_CLASS, obj = eo_constructor());
71 eo_do(obj, ecordova_entry_file_is_set(EINA_TRUE));
72 return obj; 71 return obj;
73} 72}
74 73
diff --git a/src/modules/ecordova/tizen/ecordova_batterystatus.c b/src/modules/ecordova/tizen/ecordova_batterystatus.c
index 246c3ba970..48b659c1e6 100644
--- a/src/modules/ecordova/tizen/ecordova_batterystatus.c
+++ b/src/modules/ecordova/tizen/ecordova_batterystatus.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
5#include "ecordova_batterystatus_private.h" 6#include "ecordova_batterystatus_private.h"
6#include "ecordova_systeminfo.eo.h" 7#include "ecordova_systeminfo.eo.h"
7 8
@@ -186,3 +187,4 @@ _on_battery_changed(void *data,
186} 187}
187 188
188#include "ecordova_batterystatus.eo.c" 189#include "ecordova_batterystatus.eo.c"
190#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contact.c b/src/modules/ecordova/tizen/ecordova_contact.c
index 2a26ecd494..14b7441fa1 100644
--- a/src/modules/ecordova/tizen/ecordova_contact.c
+++ b/src/modules/ecordova/tizen/ecordova_contact.c
@@ -2,7 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6#include "ecordova_contact_private.h" 5#include "ecordova_contact_private.h"
7 6
8#include "ecordova_contactname_private.h" 7#include "ecordova_contactname_private.h"
@@ -11,8 +10,6 @@
11#include "ecordova_contactaddress_private.h" 10#include "ecordova_contactaddress_private.h"
12#include "ecordova_contactorganization_private.h" 11#include "ecordova_contactorganization_private.h"
13 12
14#include <contacts.h>
15
16#include <assert.h> 13#include <assert.h>
17#include <stdint.h> 14#include <stdint.h>
18#include <stdlib.h> 15#include <stdlib.h>
@@ -508,14 +505,14 @@ _contactaddress_copy(Ecordova_ContactAddress *address)
508 505
509 return eo_add(ECORDOVA_CONTACTADDRESS_CLASS, 506 return eo_add(ECORDOVA_CONTACTADDRESS_CLASS,
510 NULL, 507 NULL,
511 ecordova_contactaddress_constructor(pref, 508 ecordova_contactaddress_pref_set(pref),
512 type, 509 ecordova_contactaddress_type_set(type),
513 formatted, 510 ecordova_contactaddress_formatted_set(formatted),
514 street_address, 511 ecordova_contactaddress_street_address_set(street_address),
515 locality, 512 ecordova_contactaddress_locality_set(locality),
516 region, 513 ecordova_contactaddress_region_set(region),
517 postal_code, 514 ecordova_contactaddress_postal_code_set(postal_code),
518 country)); 515 ecordova_contactaddress_country_set(country));
519} 516}
520 517
521static Ecordova_ContactField * 518static Ecordova_ContactField *
@@ -533,7 +530,9 @@ _contactfield_copy(Ecordova_ContactField *field)
533 pref = ecordova_contactfield_pref_get()); 530 pref = ecordova_contactfield_pref_get());
534 531
535 return eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL, 532 return eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL,
536 ecordova_contactfield_constructor(type, value, pref)); 533 ecordova_contactfield_type_set(type),
534 ecordova_contactfield_value_set(value),
535 ecordova_contactfield_pref_set(pref));
537} 536}
538 537
539static Ecordova_ContactOrganization * 538static Ecordova_ContactOrganization *
@@ -556,11 +555,11 @@ _contactorganization_copy(Ecordova_ContactOrganization *organization)
556 555
557 return eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, 556 return eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS,
558 NULL, 557 NULL,
559 ecordova_contactorganization_constructor(pref, 558 ecordova_contactorganization_pref_set(pref),
560 type, 559 ecordova_contactorganization_type_set(type),
561 name, 560 ecordova_contactorganization_name_set(name),
562 dept, 561 ecordova_contactorganization_dept_set(dept),
563 title)); 562 ecordova_contactorganization_title_set(title));
564} 563}
565 564
566static Eina_Array * 565static Eina_Array *
@@ -1115,4 +1114,3 @@ _ecordova_contactorganizations_export(Eina_Array *organizations,
1115} 1114}
1116 1115
1117#include "ecordova_contact.eo.c" 1116#include "ecordova_contact.eo.c"
1118#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contact_private.h b/src/modules/ecordova/tizen/ecordova_contact_private.h
index 5b0f9b5ce5..c776d8d396 100644
--- a/src/modules/ecordova/tizen/ecordova_contact_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contact_private.h
@@ -7,10 +7,7 @@
7#include "ecordova_contactname.eo.h" 7#include "ecordova_contactname.eo.h"
8#include "ecordova_contactorganization.eo.h" 8#include "ecordova_contactorganization.eo.h"
9#include "ecordova_contact.eo.h" 9#include "ecordova_contact.eo.h"
10 10#include "ecordova_contacts_service.h"
11#include <contacts.h>
12
13typedef struct _Ecordova_Contact_Data Ecordova_Contact_Data;
14 11
15/** 12/**
16 * Ecordova.Contact private data 13 * Ecordova.Contact private data
diff --git a/src/modules/ecordova/tizen/ecordova_contactaddress.c b/src/modules/ecordova/tizen/ecordova_contactaddress.c
index 704bcab514..78f3cdf30f 100644
--- a/src/modules/ecordova/tizen/ecordova_contactaddress.c
+++ b/src/modules/ecordova/tizen/ecordova_contactaddress.c
@@ -2,8 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6
7#include "ecordova_contactaddress_private.h" 5#include "ecordova_contactaddress_private.h"
8#include "ecordova_contacts_record_utils.h" 6#include "ecordova_contacts_record_utils.h"
9 7
@@ -22,7 +20,7 @@ _ecordova_contactaddress_eo_base_constructor(Eo *obj,
22 pd->obj = obj; 20 pd->obj = obj;
23 pd->id = 0; 21 pd->id = 0;
24 pd->record = NULL; 22 pd->record = NULL;
25 int ret = contacts_record_create(_contacts_address._uri, &pd->record); 23 int ret = contacts_record_create((*_contacts_address)._uri, &pd->record);
26 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 24 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
27 25
28 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 26 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
@@ -52,7 +50,7 @@ _ecordova_contactaddress_pref_get(Eo *obj EINA_UNUSED,
52 Ecordova_ContactAddress_Data *pd) 50 Ecordova_ContactAddress_Data *pd)
53{ 51{
54 Eina_Bool value = EINA_FALSE; 52 Eina_Bool value = EINA_FALSE;
55 get_bool(pd->record, _contacts_address.is_default, &value); 53 get_bool(pd->record, (*_contacts_address).is_default, &value);
56 return value; 54 return value;
57} 55}
58 56
@@ -61,7 +59,7 @@ _ecordova_contactaddress_pref_set(Eo *obj EINA_UNUSED,
61 Ecordova_ContactAddress_Data *pd, 59 Ecordova_ContactAddress_Data *pd,
62 Eina_Bool value) 60 Eina_Bool value)
63{ 61{
64 set_bool(pd->record, _contacts_address.is_default, value); 62 set_bool(pd->record, (*_contacts_address).is_default, value);
65} 63}
66 64
67static const char * 65static const char *
@@ -69,7 +67,7 @@ _ecordova_contactaddress_type_get(Eo *obj EINA_UNUSED,
69 Ecordova_ContactAddress_Data *pd) 67 Ecordova_ContactAddress_Data *pd)
70{ 68{
71 int type; 69 int type;
72 if (!get_int(pd->record, _contacts_address.type, &type)) 70 if (!get_int(pd->record, (*_contacts_address).type, &type))
73 return NULL; 71 return NULL;
74 72
75 switch (type) 73 switch (type)
@@ -91,7 +89,7 @@ _ecordova_contactaddress_type_get(Eo *obj EINA_UNUSED,
91 default: 89 default:
92 { 90 {
93 const char *custom = NULL; 91 const char *custom = NULL;
94 get_str_p(pd->record, _contacts_address.label, &custom); 92 get_str_p(pd->record, (*_contacts_address).label, &custom);
95 return custom; 93 return custom;
96 } 94 }
97 } 95 }
@@ -121,9 +119,9 @@ _ecordova_contactaddress_type_set(Eo *obj EINA_UNUSED,
121 else 119 else
122 type = CONTACTS_ADDRESS_TYPE_CUSTOM; 120 type = CONTACTS_ADDRESS_TYPE_CUSTOM;
123 121
124 set_int(pd->record, _contacts_address.type, type); 122 set_int(pd->record, (*_contacts_address).type, type);
125 if (strlen(value) != 0) 123 if (strlen(value) != 0)
126 set_str(pd->record, _contacts_address.label, value); 124 set_str(pd->record, (*_contacts_address).label, value);
127} 125}
128 126
129static const char * 127static const char *
@@ -148,7 +146,7 @@ _ecordova_contactaddress_street_address_get(Eo *obj EINA_UNUSED,
148 Ecordova_ContactAddress_Data *pd) 146 Ecordova_ContactAddress_Data *pd)
149{ 147{
150 const char *value = NULL; 148 const char *value = NULL;
151 get_str_p(pd->record, _contacts_address.street, &value); 149 get_str_p(pd->record, (*_contacts_address).street, &value);
152 return value; 150 return value;
153} 151}
154 152
@@ -157,7 +155,7 @@ _ecordova_contactaddress_street_address_set(Eo *obj EINA_UNUSED,
157 Ecordova_ContactAddress_Data *pd, 155 Ecordova_ContactAddress_Data *pd,
158 const char *value) 156 const char *value)
159{ 157{
160 set_str(pd->record, _contacts_address.street, value); 158 set_str(pd->record, (*_contacts_address).street, value);
161} 159}
162 160
163static const char * 161static const char *
@@ -165,7 +163,7 @@ _ecordova_contactaddress_locality_get(Eo *obj EINA_UNUSED,
165 Ecordova_ContactAddress_Data *pd) 163 Ecordova_ContactAddress_Data *pd)
166{ 164{
167 const char *value = NULL; 165 const char *value = NULL;
168 get_str_p(pd->record, _contacts_address.locality, &value); 166 get_str_p(pd->record, (*_contacts_address).locality, &value);
169 return value; 167 return value;
170} 168}
171 169
@@ -174,7 +172,7 @@ _ecordova_contactaddress_locality_set(Eo *obj EINA_UNUSED,
174 Ecordova_ContactAddress_Data *pd, 172 Ecordova_ContactAddress_Data *pd,
175 const char *value) 173 const char *value)
176{ 174{
177 set_str(pd->record, _contacts_address.locality, value); 175 set_str(pd->record, (*_contacts_address).locality, value);
178} 176}
179 177
180static const char * 178static const char *
@@ -182,7 +180,7 @@ _ecordova_contactaddress_region_get(Eo *obj EINA_UNUSED,
182 Ecordova_ContactAddress_Data *pd) 180 Ecordova_ContactAddress_Data *pd)
183{ 181{
184 const char *value = NULL; 182 const char *value = NULL;
185 get_str_p(pd->record, _contacts_address.region, &value); 183 get_str_p(pd->record, (*_contacts_address).region, &value);
186 return value; 184 return value;
187} 185}
188 186
@@ -191,7 +189,7 @@ _ecordova_contactaddress_region_set(Eo *obj EINA_UNUSED,
191 Ecordova_ContactAddress_Data *pd, 189 Ecordova_ContactAddress_Data *pd,
192 const char *value) 190 const char *value)
193{ 191{
194 set_str(pd->record, _contacts_address.region, value); 192 set_str(pd->record, (*_contacts_address).region, value);
195} 193}
196 194
197static const char * 195static const char *
@@ -199,7 +197,7 @@ _ecordova_contactaddress_postal_code_get(Eo *obj EINA_UNUSED,
199 Ecordova_ContactAddress_Data *pd) 197 Ecordova_ContactAddress_Data *pd)
200{ 198{
201 const char *value = NULL; 199 const char *value = NULL;
202 get_str_p(pd->record, _contacts_address.postal_code, &value); 200 get_str_p(pd->record, (*_contacts_address).postal_code, &value);
203 return value; 201 return value;
204} 202}
205 203
@@ -208,7 +206,7 @@ _ecordova_contactaddress_postal_code_set(Eo *obj EINA_UNUSED,
208 Ecordova_ContactAddress_Data *pd, 206 Ecordova_ContactAddress_Data *pd,
209 const char *value) 207 const char *value)
210{ 208{
211 set_str(pd->record, _contacts_address.postal_code, value); 209 set_str(pd->record, (*_contacts_address).postal_code, value);
212} 210}
213 211
214static const char * 212static const char *
@@ -216,7 +214,7 @@ _ecordova_contactaddress_country_get(Eo *obj EINA_UNUSED,
216 Ecordova_ContactAddress_Data *pd) 214 Ecordova_ContactAddress_Data *pd)
217{ 215{
218 const char *value = NULL; 216 const char *value = NULL;
219 get_str_p(pd->record, _contacts_address.country, &value); 217 get_str_p(pd->record, (*_contacts_address).country, &value);
220 return value; 218 return value;
221} 219}
222 220
@@ -225,7 +223,7 @@ _ecordova_contactaddress_country_set(Eo *obj EINA_UNUSED,
225 Ecordova_ContactAddress_Data *pd, 223 Ecordova_ContactAddress_Data *pd,
226 const char *value) 224 const char *value)
227{ 225{
228 set_str(pd->record, _contacts_address.country, value); 226 set_str(pd->record, (*_contacts_address).country, value);
229} 227}
230 228
231Eina_Bool 229Eina_Bool
@@ -243,7 +241,7 @@ ecordova_contactaddress_import(Ecordova_ContactAddress *obj,
243 ret = contacts_record_clone(child_record, &pd->record); 241 ret = contacts_record_clone(child_record, &pd->record);
244 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE); 242 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
245 243
246 return get_int(child_record, _contacts_address.id, &pd->id); 244 return get_int(child_record, (*_contacts_address).id, &pd->id);
247} 245}
248 246
249Eina_Bool 247Eina_Bool
@@ -288,4 +286,3 @@ ecordova_contactaddress_clone(Ecordova_ContactAddress *other)
288 286
289#include "ecordova_contactaddress.eo.c" 287#include "ecordova_contactaddress.eo.c"
290 288
291#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactaddress_private.h b/src/modules/ecordova/tizen/ecordova_contactaddress_private.h
index 87b0449568..13b13cdd1f 100644
--- a/src/modules/ecordova/tizen/ecordova_contactaddress_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactaddress_private.h
@@ -3,8 +3,7 @@
3 3
4#include "ecordova_private.h" 4#include "ecordova_private.h"
5#include "ecordova_contactaddress.eo.h" 5#include "ecordova_contactaddress.eo.h"
6 6#include "ecordova_contacts_service.h"
7#include <contacts.h>
8 7
9typedef struct _Ecordova_ContactAddress_Data Ecordova_ContactAddress_Data; 8typedef struct _Ecordova_ContactAddress_Data Ecordova_ContactAddress_Data;
10 9
diff --git a/src/modules/ecordova/tizen/ecordova_contactfield.c b/src/modules/ecordova/tizen/ecordova_contactfield.c
index 4d49fae416..08b4f4758b 100644
--- a/src/modules/ecordova/tizen/ecordova_contactfield.c
+++ b/src/modules/ecordova/tizen/ecordova_contactfield.c
@@ -2,7 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6#include "ecordova_contactfield_private.h" 5#include "ecordova_contactfield_private.h"
7#include "ecordova_contacts_record_utils.h" 6#include "ecordova_contacts_record_utils.h"
8 7
@@ -403,4 +402,3 @@ ecordova_contacturl_label2type(const char *label)
403} 402}
404 403
405#include "ecordova_contactfield.eo.c" 404#include "ecordova_contactfield.eo.c"
406#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactfield_private.h b/src/modules/ecordova/tizen/ecordova_contactfield_private.h
index b69b2cf6f2..c9abcc2907 100644
--- a/src/modules/ecordova/tizen/ecordova_contactfield_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactfield_private.h
@@ -3,8 +3,7 @@
3 3
4#include "ecordova_private.h" 4#include "ecordova_private.h"
5#include "ecordova_contactfield.eo.h" 5#include "ecordova_contactfield.eo.h"
6 6#include "ecordova_contacts_service.h"
7#include <contacts.h>
8 7
9typedef enum _Ecordova_ContactField_Property 8typedef enum _Ecordova_ContactField_Property
10{ 9{
diff --git a/src/modules/ecordova/tizen/ecordova_contactname.c b/src/modules/ecordova/tizen/ecordova_contactname.c
index d44d0d0bb5..e2f3635450 100644
--- a/src/modules/ecordova/tizen/ecordova_contactname.c
+++ b/src/modules/ecordova/tizen/ecordova_contactname.c
@@ -2,7 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6#include "ecordova_contactname_private.h" 5#include "ecordova_contactname_private.h"
7#include "ecordova_contact_private.h" 6#include "ecordova_contact_private.h"
8#include "ecordova_contacts_record_utils.h" 7#include "ecordova_contacts_record_utils.h"
@@ -236,4 +235,4 @@ ecordova_contactname_clone(Ecordova_ContactName *other)
236 235
237 236
238#include "ecordova_contactname.eo.c" 237#include "ecordova_contactname.eo.c"
239#endif 238
diff --git a/src/modules/ecordova/tizen/ecordova_contactname_private.h b/src/modules/ecordova/tizen/ecordova_contactname_private.h
index 6c11f9a223..bb15dacedc 100644
--- a/src/modules/ecordova/tizen/ecordova_contactname_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactname_private.h
@@ -3,8 +3,7 @@
3 3
4#include "ecordova_private.h" 4#include "ecordova_private.h"
5#include "ecordova_contactname.eo.h" 5#include "ecordova_contactname.eo.h"
6 6#include "ecordova_contacts_service.h"
7#include <contacts.h>
8 7
9typedef struct _Ecordova_ContactName_Data Ecordova_ContactName_Data; 8typedef struct _Ecordova_ContactName_Data Ecordova_ContactName_Data;
10 9
diff --git a/src/modules/ecordova/tizen/ecordova_contactorganization.c b/src/modules/ecordova/tizen/ecordova_contactorganization.c
index e981cb920f..6ebd3614fc 100644
--- a/src/modules/ecordova/tizen/ecordova_contactorganization.c
+++ b/src/modules/ecordova/tizen/ecordova_contactorganization.c
@@ -2,7 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6#include "ecordova_contactorganization_private.h" 5#include "ecordova_contactorganization_private.h"
7#include "ecordova_contacts_record_utils.h" 6#include "ecordova_contacts_record_utils.h"
8 7
@@ -213,4 +212,4 @@ ecordova_contactorganization_clone(Ecordova_ContactOrganization *other)
213} 212}
214 213
215#include "ecordova_contactorganization.eo.c" 214#include "ecordova_contactorganization.eo.c"
216#endif 215
diff --git a/src/modules/ecordova/tizen/ecordova_contactorganization_private.h b/src/modules/ecordova/tizen/ecordova_contactorganization_private.h
index ac9381b58b..54fd2110cb 100644
--- a/src/modules/ecordova/tizen/ecordova_contactorganization_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactorganization_private.h
@@ -3,8 +3,7 @@
3 3
4#include "ecordova_private.h" 4#include "ecordova_private.h"
5#include "ecordova_contactorganization.eo.h" 5#include "ecordova_contactorganization.eo.h"
6 6#include "ecordova_contacts_service.h"
7#include <contacts.h>
8 7
9typedef struct _Ecordova_ContactOrganization_Data Ecordova_ContactOrganization_Data; 8typedef struct _Ecordova_ContactOrganization_Data Ecordova_ContactOrganization_Data;
10 9
diff --git a/src/modules/ecordova/tizen/ecordova_contacts.c b/src/modules/ecordova/tizen/ecordova_contacts.c
index 0d1d24510b..c225f43aa5 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts.c
+++ b/src/modules/ecordova/tizen/ecordova_contacts.c
@@ -2,13 +2,10 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6#include "ecordova_contacts_private.h" 5#include "ecordova_contacts_private.h"
7#include "ecordova_contact_private.h" 6#include "ecordova_contact_private.h"
8#include "ecordova_contacts_record_utils.h" 7#include "ecordova_contacts_record_utils.h"
9 8
10#include <contacts.h>
11
12#include <stdint.h> 9#include <stdint.h>
13#include <stdlib.h> 10#include <stdlib.h>
14 11
@@ -510,4 +507,3 @@ on_error:
510} 507}
511 508
512#include "ecordova_contacts.eo.c" 509#include "ecordova_contacts.eo.c"
513#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
index 98fb688221..b28b7dc2ff 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
+++ b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
@@ -2,7 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6#include "ecordova_contacts_record_utils.h" 5#include "ecordova_contacts_record_utils.h"
7 6
8#include <Eina.h> 7#include <Eina.h>
@@ -67,7 +66,7 @@ get_bool(contacts_record_h record, unsigned int property_id, Eina_Bool *value)
67{ 66{
68 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE); 67 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
69 68
70 Eina_Bool raw_value; 69 bool raw_value;
71 int ret = contacts_record_get_bool(record, property_id, &raw_value); 70 int ret = contacts_record_get_bool(record, property_id, &raw_value);
72 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE); 71 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
73 72
@@ -120,4 +119,3 @@ clear_all_contact_record(contacts_record_h contacts_record,
120 119
121 return EINA_TRUE; 120 return EINA_TRUE;
122} 121}
123#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.h b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.h
index 9cdeec8892..006bb8477e 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.h
+++ b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.h
@@ -2,7 +2,8 @@
2#define _ECORDOVA_CONTACTS_RECORD_UTILS_H 2#define _ECORDOVA_CONTACTS_RECORD_UTILS_H
3 3
4#include <Eina.h> 4#include <Eina.h>
5#include <contacts.h> 5
6#include "ecordova_contacts_service.h"
6 7
7Eina_Bool get_str(contacts_record_h, unsigned int, char **); 8Eina_Bool get_str(contacts_record_h, unsigned int, char **);
8Eina_Bool get_str_p(contacts_record_h, unsigned int, const char **); 9Eina_Bool get_str_p(contacts_record_h, unsigned int, const char **);
diff --git a/src/modules/ecordova/tizen/ecordova_contacts_service.c b/src/modules/ecordova/tizen/ecordova_contacts_service.c
new file mode 100644
index 0000000000..718c5f8b47
--- /dev/null
+++ b/src/modules/ecordova/tizen/ecordova_contacts_service.c
@@ -0,0 +1,271 @@
1
2#include "ecordova_contacts_service.h"
3
4#include <dlfcn.h>
5
6// Record
7int (*contacts_record_create)(const char *view_uri, contacts_record_h *record) = 0;
8int (*contacts_record_destroy )(contacts_record_h record, bool delete_child) = 0;
9int (*contacts_record_clone)(contacts_record_h record, contacts_record_h* cloned_record) = 0;
10int (*contacts_record_get_child_record_count)(contacts_record_h record, unsigned int property_id, int *count) = 0;
11int (*contacts_record_get_child_record_at_p)(contacts_record_h record, unsigned int property_id, int index, contacts_record_h* child_record) = 0;
12int (*contacts_record_get_str)(contacts_record_h record, unsigned int property_id, char** value) = 0;
13int (*contacts_record_get_str_p)(contacts_record_h record, unsigned int property_id, char** value) = 0;
14int (*contacts_record_get_int)(contacts_record_h record, unsigned int property_id, int* value) = 0;
15int (*contacts_record_set_str)(contacts_record_h record, unsigned int property_id, const char* value) = 0;
16int (*contacts_record_set_int)(contacts_record_h record, unsigned int property_id, int value) = 0;
17int (*contacts_record_get_bool)(contacts_record_h record, unsigned int property_id, bool *value) = 0;
18int (*contacts_record_set_bool)(contacts_record_h record, unsigned int property_id, bool value) = 0;
19int (*contacts_record_remove_child_record)(contacts_record_h record, unsigned int property_id, contacts_record_h child_record) = 0;
20int (*contacts_record_add_child_record)(contacts_record_h record, unsigned int property_id, contacts_record_h child_record) = 0;
21
22// DB
23int (*contacts_db_delete_record)(const char* view_uri, int record_id) = 0;
24int (*contacts_db_update_record)(contacts_record_h record) = 0;
25int (*contacts_db_insert_record)(contacts_record_h record, int *id) = 0;
26int (*contacts_db_get_record)(const char* view_uri, int record_id, contacts_record_h* record) = 0;
27int (*contacts_db_get_all_records)(const char* view_uri, int offset, int limit, contacts_list_h* record_list) = 0;
28int (*contacts_db_get_records_with_query)(contacts_query_h query, int offset, int limit, contacts_list_h* record_list) = 0;
29
30// List
31int (*contacts_list_get_current_record_p)(contacts_list_h contacts_list, contacts_record_h* record) = 0;
32int (*contacts_list_next)(contacts_list_h contacts_list) = 0;
33int (*contacts_list_destroy)(contacts_list_h contacts_list, bool delete_child) = 0;
34int (*contacts_list_first)(contacts_list_h contacts_list) = 0;
35int (*contacts_list_create)(contacts_list_h* contacts_list) = 0;
36int (*contacts_list_get_count)(contacts_list_h contacts_list, int *count) = 0;
37int (*contacts_list_add)(contacts_list_h contacts_list, contacts_record_h record) = 0;
38
39// Filter
40int (*contacts_filter_create)(const char* view_uri, contacts_filter_h* filter) = 0;
41int (*contacts_filter_add_operator)(contacts_filter_h filter, contacts_filter_operator_e operator_type) = 0;
42int (*contacts_filter_add_int)(contacts_filter_h filter, unsigned int property_id, contacts_match_int_flag_e match, int match_value) = 0;
43int (*contacts_filter_destroy)(contacts_filter_h filter) = 0;
44int (*contacts_filter_add_str)(contacts_filter_h filter, unsigned int property_id, contacts_match_str_flag_e match, const char* match_value) = 0;
45
46// Query
47int (*contacts_query_create)(const char* view_uri, contacts_query_h* query) = 0;
48int (*contacts_query_set_filter)(contacts_query_h query, contacts_filter_h filter) = 0;
49int (*contacts_query_destroy)(contacts_query_h query) = 0;
50
51_contacts_address_property_ids* _contacts_address = NULL;
52_contacts_contact_property_ids* _contacts_contact = NULL;
53_contacts_nickname_property_ids* _contacts_nickname = NULL;
54_contacts_note_property_ids* _contacts_note = NULL;
55_contacts_name_property_ids* _contacts_name = NULL;
56_contacts_number_property_ids* _contacts_number = NULL;
57_contacts_company_property_ids* _contacts_company = NULL;
58_contacts_email_property_ids* _contacts_email = NULL;
59_contacts_messenger_property_ids* _contacts_messenger = NULL;
60_contacts_image_property_ids* _contacts_image = NULL;
61_contacts_url_property_ids* _contacts_url = NULL;
62_contacts_event_property_ids* _contacts_event = NULL;
63
64static void* contacts_service_lib;
65
66void ecordova_contacts_service_shutdown()
67{
68 dlclose(contacts_service_lib);
69 contacts_service_lib = NULL;
70 contacts_record_destroy = NULL;
71 contacts_record_clone = NULL;
72 contacts_record_get_child_record_count = NULL;
73 contacts_record_get_child_record_at_p = NULL;
74 contacts_record_get_str = NULL;
75 contacts_record_get_str_p = NULL;
76 contacts_record_get_int = NULL;
77 contacts_record_set_str = NULL;
78 contacts_record_set_int = NULL;
79 contacts_record_get_bool = NULL;
80 contacts_record_set_bool = NULL;
81 contacts_record_remove_child_record = NULL;
82 contacts_record_add_child_record = NULL;
83 contacts_db_delete_record = NULL;
84 contacts_db_update_record = NULL;
85 contacts_db_insert_record = NULL;
86 contacts_db_get_record = NULL;
87 contacts_db_get_all_records = NULL;
88 contacts_db_get_records_with_query = NULL;
89 contacts_list_get_current_record_p = NULL;
90 contacts_list_next = NULL;
91 contacts_list_destroy = NULL;
92 contacts_list_first = NULL;
93 contacts_list_create = NULL;
94 contacts_list_get_count = NULL;
95 contacts_list_add = NULL;
96 contacts_filter_create = NULL;
97 contacts_filter_add_operator = NULL;
98 contacts_filter_add_int = NULL;
99 contacts_filter_destroy = NULL;
100 contacts_filter_add_str = NULL;
101 contacts_query_create = NULL;
102 contacts_query_set_filter = NULL;
103 contacts_query_destroy = NULL;
104 _contacts_address = NULL;
105 _contacts_contact = NULL;
106 _contacts_nickname = NULL;
107 _contacts_note = NULL;
108 _contacts_name = NULL;
109 _contacts_number = NULL;
110 _contacts_company = NULL;
111 _contacts_email = NULL;
112 _contacts_messenger = NULL;
113 _contacts_image = NULL;
114 _contacts_url = NULL;
115 _contacts_event = NULL;
116}
117
118void ecordova_contacts_service_init()
119{
120 if(!contacts_service_lib)
121 {
122 contacts_service_lib = dlopen("contacts-service2.so", RTLD_NOW);
123
124 contacts_record_create = dlsym(contacts_service_lib, "contacts_record_create");
125 if(!contacts_record_create)
126 goto on_error;
127 contacts_record_destroy = dlsym(contacts_service_lib, "contacts_record_destroy ");
128 if(!contacts_record_destroy )
129 goto on_error;
130 contacts_record_clone = dlsym(contacts_service_lib, "contacts_record_clone");
131 if(!contacts_record_clone)
132 goto on_error;
133 contacts_record_get_child_record_count = dlsym(contacts_service_lib, "contacts_record_get_child_record_count");
134 if(!contacts_record_get_child_record_count)
135 goto on_error;
136 contacts_record_get_child_record_at_p = dlsym(contacts_service_lib, "contacts_record_get_child_record_at_p");
137 if(!contacts_record_get_child_record_at_p)
138 goto on_error;
139 contacts_record_get_str = dlsym(contacts_service_lib, "contacts_record_get_str");
140 if(!contacts_record_get_str)
141 goto on_error;
142 contacts_record_get_str_p = dlsym(contacts_service_lib, "contacts_record_get_str_p");
143 if(!contacts_record_get_str_p)
144 goto on_error;
145 contacts_record_get_int = dlsym(contacts_service_lib, "contacts_record_get_int");
146 if(!contacts_record_get_int)
147 goto on_error;
148 contacts_record_set_str = dlsym(contacts_service_lib, "contacts_record_set_str");
149 if(!contacts_record_set_str)
150 goto on_error;
151 contacts_record_set_int = dlsym(contacts_service_lib, "contacts_record_set_int");
152 if(!contacts_record_set_int)
153 goto on_error;
154 contacts_record_get_bool = dlsym(contacts_service_lib, "contacts_record_get_bool");
155 if(!contacts_record_get_bool)
156 goto on_error;
157 contacts_record_set_bool = dlsym(contacts_service_lib, "contacts_record_set_bool");
158 if(!contacts_record_set_bool)
159 goto on_error;
160 contacts_record_remove_child_record = dlsym(contacts_service_lib, "contacts_record_remove_child_record");
161 if(!contacts_record_remove_child_record)
162 goto on_error;
163 contacts_record_add_child_record = dlsym(contacts_service_lib, "contacts_record_add_child_record");
164 if(!contacts_record_add_child_record)
165 goto on_error;
166 contacts_db_delete_record = dlsym(contacts_service_lib, "contacts_db_delete_record");
167 if(!contacts_db_delete_record)
168 goto on_error;
169 contacts_db_update_record = dlsym(contacts_service_lib, "contacts_db_update_record");
170 if(!contacts_db_update_record)
171 goto on_error;
172 contacts_db_insert_record = dlsym(contacts_service_lib, "contacts_db_insert_record");
173 if(!contacts_db_insert_record)
174 goto on_error;
175 contacts_db_get_record = dlsym(contacts_service_lib, "contacts_db_get_record");
176 if(!contacts_db_get_record)
177 goto on_error;
178 contacts_db_get_all_records = dlsym(contacts_service_lib, "contacts_db_get_all_records");
179 if(!contacts_db_get_all_records)
180 goto on_error;
181 contacts_db_get_records_with_query = dlsym(contacts_service_lib, "contacts_db_get_records_with_query");
182 if(!contacts_db_get_records_with_query)
183 goto on_error;
184 contacts_list_get_current_record_p = dlsym(contacts_service_lib, "contacts_list_get_current_record_p");
185 if(!contacts_list_get_current_record_p)
186 goto on_error;
187 contacts_list_next = dlsym(contacts_service_lib, "contacts_list_next");
188 if(!contacts_list_next)
189 goto on_error;
190 contacts_list_destroy = dlsym(contacts_service_lib, "contacts_list_destroy");
191 if(!contacts_list_destroy)
192 goto on_error;
193 contacts_list_first = dlsym(contacts_service_lib, "contacts_list_first");
194 if(!contacts_list_first)
195 goto on_error;
196 contacts_list_create = dlsym(contacts_service_lib, "contacts_list_create");
197 if(!contacts_list_create)
198 goto on_error;
199 contacts_list_get_count = dlsym(contacts_service_lib, "contacts_list_get_count");
200 if(!contacts_list_get_count)
201 goto on_error;
202 contacts_list_add = dlsym(contacts_service_lib, "contacts_list_add");
203 if(!contacts_list_add)
204 goto on_error;
205 contacts_filter_create = dlsym(contacts_service_lib, "contacts_filter_create");
206 if(!contacts_filter_create)
207 goto on_error;
208 contacts_filter_add_operator = dlsym(contacts_service_lib, "contacts_filter_add_operator");
209 if(!contacts_filter_add_operator)
210 goto on_error;
211 contacts_filter_add_int = dlsym(contacts_service_lib, "contacts_filter_add_int");
212 if(!contacts_filter_add_int)
213 goto on_error;
214 contacts_filter_destroy = dlsym(contacts_service_lib, "contacts_filter_destroy");
215 if(!contacts_filter_destroy)
216 goto on_error;
217 contacts_filter_add_str = dlsym(contacts_service_lib, "contacts_filter_add_str");
218 if(!contacts_filter_add_str)
219 goto on_error;
220 contacts_query_create = dlsym(contacts_service_lib, "contacts_query_create");
221 if(!contacts_query_create)
222 goto on_error;
223 contacts_query_set_filter = dlsym(contacts_service_lib, "contacts_query_set_filter");
224 if(!contacts_query_set_filter)
225 goto on_error;
226 contacts_query_destroy = dlsym(contacts_service_lib, "contacts_query_destroy");
227 if(!contacts_query_destroy)
228 goto on_error;
229 _contacts_address = dlsym(contacts_service_lib, "_contacts_address");
230 if(!_contacts_address)
231 goto on_error;;
232 _contacts_contact = dlsym(contacts_service_lib, "_contacts_contact");
233 if(!_contacts_contact)
234 goto on_error;;
235 _contacts_nickname = dlsym(contacts_service_lib, "_contacts_nickname");
236 if(!_contacts_nickname)
237 goto on_error;;
238 _contacts_note = dlsym(contacts_service_lib, "_contacts_note");
239 if(!_contacts_note)
240 goto on_error;;
241 _contacts_name = dlsym(contacts_service_lib, "_contacts_name");
242 if(!_contacts_name)
243 goto on_error;;
244 _contacts_number = dlsym(contacts_service_lib, "_contacts_number");
245 if(!_contacts_number)
246 goto on_error;;
247 _contacts_company = dlsym(contacts_service_lib, "_contacts_company");
248 if(!_contacts_company)
249 goto on_error;;
250 _contacts_email = dlsym(contacts_service_lib, "_contacts_email");
251 if(!_contacts_email)
252 goto on_error;;
253 _contacts_messenger = dlsym(contacts_service_lib, "_contacts_messenger");
254 if(!_contacts_messenger)
255 goto on_error;;
256 _contacts_image = dlsym(contacts_service_lib, "_contacts_image");
257 if(!_contacts_image)
258 goto on_error;;
259 _contacts_url = dlsym(contacts_service_lib, "_contacts_url");
260 if(!_contacts_url)
261 goto on_error;;
262 _contacts_event = dlsym(contacts_service_lib, "_contacts_event");
263 if(!_contacts_event)
264 goto on_error;;
265 }
266
267 return;
268on_error:
269 ecordova_contacts_service_shutdown();
270}
271
diff --git a/src/modules/ecordova/tizen/ecordova_contacts_service.h b/src/modules/ecordova/tizen/ecordova_contacts_service.h
new file mode 100644
index 0000000000..bfb8ed2e24
--- /dev/null
+++ b/src/modules/ecordova/tizen/ecordova_contacts_service.h
@@ -0,0 +1,403 @@
1#ifndef _ECORDOVA_CONTACTS_SERVICE_H
2#define _ECORDOVA_CONTACTS_SERVICE_H
3
4#include <stdbool.h>
5#include <errno.h>
6#include <stdlib.h>
7
8#define CONTACTS_API
9
10struct __contacts_record_h;
11typedef struct __contacts_record_h* contacts_record_h;
12struct __contacts_filter_h;
13typedef struct __contacts_record_h* contacts_filter_h;
14struct __contacts_list_h;
15typedef struct __contacts_list_h* contacts_list_h;
16struct __contacts_query_h;
17typedef struct __contacts_query_h* contacts_query_h;
18
19#define _CONTACTS_BEGIN_VIEW() \
20 typedef struct{ \
21 const char* const _uri;
22#define _CONTACTS_BEGIN_READ_ONLY_VIEW() _CONTACTS_BEGIN_VIEW()
23#define _CONTACTS_PROPERTY_INT(property_id_name) unsigned int property_id_name;
24#define _CONTACTS_PROPERTY_STR(property_id_name) unsigned int property_id_name;
25#define _CONTACTS_PROPERTY_BOOL(property_id_name) unsigned int property_id_name;
26#define _CONTACTS_PROPERTY_DOUBLE(property_id_name) unsigned int property_id_name;
27#define _CONTACTS_PROPERTY_LLI(property_id_name) unsigned int property_id_name;
28
29#define _CONTACTS_PROPERTY_CHILD_SINGLE(property_id_name) unsigned int property_id_name;
30#define _CONTACTS_PROPERTY_CHILD_MULTIPLE(property_id_name) unsigned int property_id_name;
31
32#define _CONTACTS_PROPERTY_FILTER_INT(property_id_name) unsigned int property_id_name;
33#define _CONTACTS_PROPERTY_FILTER_STR(property_id_name) unsigned int property_id_name;
34#define _CONTACTS_PROPERTY_FILTER_BOOL(property_id_name) unsigned int property_id_name;
35#define _CONTACTS_PROPERTY_FILTER_DOUBLE(property_id_name) unsigned int property_id_name;
36#define _CONTACTS_PROPERTY_FILTER_LLI(property_id_name) unsigned int property_id_name;
37
38#define _CONTACTS_PROPERTY_PROJECTION_INT(property_id_name) unsigned int property_id_name;
39#define _CONTACTS_PROPERTY_PROJECTION_STR(property_id_name) unsigned int property_id_name;
40#define _CONTACTS_PROPERTY_PROJECTION_BOOL(property_id_name) unsigned int property_id_name;
41#define _CONTACTS_PROPERTY_PROJECTION_DOUBLE(property_id_name) unsigned int property_id_name;
42#define _CONTACTS_PROPERTY_PROJECTION_LLI(property_id_name) unsigned int property_id_name;
43#define _CONTACTS_END_VIEW(name) \
44 } name##_property_ids; \
45 extern CONTACTS_API const name##_property_ids* name;
46#define _CONTACTS_END_READ_ONLY_VIEW(name) _CONTACTS_END_VIEW(name)
47
48_CONTACTS_BEGIN_VIEW()
49 _CONTACTS_PROPERTY_INT(id) /* read only */
50 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
51 _CONTACTS_PROPERTY_INT(type) /* read, write */
52 _CONTACTS_PROPERTY_STR(label) /* read, write */
53 _CONTACTS_PROPERTY_STR(postbox) /* read, write */
54 _CONTACTS_PROPERTY_STR(extended) /* read, write */
55 _CONTACTS_PROPERTY_STR(street) /* read, write */
56 _CONTACTS_PROPERTY_STR(locality) /* read, write */
57 _CONTACTS_PROPERTY_STR(region) /* read, write */
58 _CONTACTS_PROPERTY_STR(postal_code) /* read, write */
59 _CONTACTS_PROPERTY_STR(country) /* read, write */
60 _CONTACTS_PROPERTY_BOOL(is_default) /* read, write */
61_CONTACTS_END_VIEW(_contacts_address)
62
63_CONTACTS_BEGIN_VIEW()
64 _CONTACTS_PROPERTY_INT(id) /* read only */
65 _CONTACTS_PROPERTY_STR(display_name) /* read only */
66 _CONTACTS_PROPERTY_INT(display_source_type) /* read only */
67 _CONTACTS_PROPERTY_INT(address_book_id) /* read, write once */
68 _CONTACTS_PROPERTY_STR(ringtone_path) /* read, write */
69 _CONTACTS_PROPERTY_STR(image_thumbnail_path) /* read only */
70 _CONTACTS_PROPERTY_BOOL(is_favorite) /* read, write */
71 _CONTACTS_PROPERTY_BOOL(has_phonenumber) /* read only */
72 _CONTACTS_PROPERTY_BOOL(has_email) /* read only */
73 _CONTACTS_PROPERTY_INT(person_id) /* read, write once */
74 _CONTACTS_PROPERTY_STR(uid) /* read, write */
75 _CONTACTS_PROPERTY_STR(vibration) /* read, write */
76 _CONTACTS_PROPERTY_INT(changed_time) /* read only */
77 _CONTACTS_PROPERTY_INT(link_mode) /* read, write */
78 _CONTACTS_PROPERTY_CHILD_SINGLE(name) /* read, write */
79 _CONTACTS_PROPERTY_CHILD_MULTIPLE(image) /* read, write */
80 _CONTACTS_PROPERTY_CHILD_MULTIPLE(company) /* read, write */
81 _CONTACTS_PROPERTY_CHILD_MULTIPLE(note) /* read, write */
82 _CONTACTS_PROPERTY_CHILD_MULTIPLE(number) /* read, write */
83 _CONTACTS_PROPERTY_CHILD_MULTIPLE(email) /* read, write */
84 _CONTACTS_PROPERTY_CHILD_MULTIPLE(event) /* read, write */
85 _CONTACTS_PROPERTY_CHILD_MULTIPLE(messenger) /* read, write */
86 _CONTACTS_PROPERTY_CHILD_MULTIPLE(address) /* read, write */
87 _CONTACTS_PROPERTY_CHILD_MULTIPLE(url) /* read, write */
88 _CONTACTS_PROPERTY_CHILD_MULTIPLE(nickname) /* read, write */
89 _CONTACTS_PROPERTY_CHILD_MULTIPLE(profile) /* read, write */
90 _CONTACTS_PROPERTY_CHILD_MULTIPLE(relationship) /* read, write */
91 _CONTACTS_PROPERTY_CHILD_MULTIPLE(group_relation) /* read, write */
92 _CONTACTS_PROPERTY_CHILD_MULTIPLE(extension) /* read, write */
93 _CONTACTS_PROPERTY_STR(message_alert) /* read, write */
94_CONTACTS_END_VIEW(_contacts_contact)
95
96_CONTACTS_BEGIN_VIEW()
97 _CONTACTS_PROPERTY_INT(id) /* read only */
98 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
99 _CONTACTS_PROPERTY_STR(name) /* read, write */
100_CONTACTS_END_VIEW(_contacts_nickname)
101
102_CONTACTS_BEGIN_VIEW()
103 _CONTACTS_PROPERTY_INT(id) /* read only */
104 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
105 _CONTACTS_PROPERTY_STR(note) /* read, write */
106_CONTACTS_END_VIEW(_contacts_note)
107
108_CONTACTS_BEGIN_VIEW()
109 _CONTACTS_PROPERTY_INT(id) /* read only */
110 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
111 _CONTACTS_PROPERTY_STR(first) /* read, write */
112 _CONTACTS_PROPERTY_STR(last) /* read, write */
113 _CONTACTS_PROPERTY_STR(addition) /* read, write */
114 _CONTACTS_PROPERTY_STR(suffix) /* read, write */
115 _CONTACTS_PROPERTY_STR(prefix) /* read, write */
116 _CONTACTS_PROPERTY_STR(phonetic_first) /* read, write */
117 _CONTACTS_PROPERTY_STR(phonetic_middle) /* read, write */
118 _CONTACTS_PROPERTY_STR(phonetic_last) /* read, write */
119_CONTACTS_END_VIEW(_contacts_name)
120
121_CONTACTS_BEGIN_VIEW()
122 _CONTACTS_PROPERTY_INT(id) /* read only */
123 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
124 _CONTACTS_PROPERTY_INT(type) /* read, write */
125 _CONTACTS_PROPERTY_STR(label) /* read, write */
126 _CONTACTS_PROPERTY_BOOL(is_default) /* read, write */
127 _CONTACTS_PROPERTY_STR(number) /* read, write */
128 _CONTACTS_PROPERTY_STR(normalized_number) /* filter only */
129 _CONTACTS_PROPERTY_STR(cleaned_number) /* filter only */
130 _CONTACTS_PROPERTY_STR(number_filter) /* filter only */
131_CONTACTS_END_VIEW(_contacts_number)
132
133_CONTACTS_BEGIN_VIEW()
134 _CONTACTS_PROPERTY_INT(id) /* read only */
135 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
136 _CONTACTS_PROPERTY_INT(type) /* read, write */
137 _CONTACTS_PROPERTY_STR(label) /* read, write */
138 _CONTACTS_PROPERTY_STR(name) /* read, write */
139 _CONTACTS_PROPERTY_STR(department) /* read, write */
140 _CONTACTS_PROPERTY_STR(job_title) /* read, write */
141 _CONTACTS_PROPERTY_STR(assistant_name) /* read, write */
142 _CONTACTS_PROPERTY_STR(role) /* read, write */
143 _CONTACTS_PROPERTY_STR(logo) /* read, write */
144 _CONTACTS_PROPERTY_STR(location) /* read, write */
145 _CONTACTS_PROPERTY_STR(description) /* read, write */
146 _CONTACTS_PROPERTY_STR(phonetic_name) /* read, write */
147_CONTACTS_END_VIEW(_contacts_company)
148
149_CONTACTS_BEGIN_VIEW()
150 _CONTACTS_PROPERTY_INT(id) /* read only */
151 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
152 _CONTACTS_PROPERTY_INT(type) /* read, write */
153 _CONTACTS_PROPERTY_STR(label) /* read, write */
154 _CONTACTS_PROPERTY_BOOL(is_default) /* read, write */
155 _CONTACTS_PROPERTY_STR(email) /* read, write */
156_CONTACTS_END_VIEW(_contacts_email)
157
158_CONTACTS_BEGIN_VIEW()
159 _CONTACTS_PROPERTY_INT(id) /* read only */
160 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
161 _CONTACTS_PROPERTY_INT(type) /* read, write */
162 _CONTACTS_PROPERTY_STR(label) /* read, write */
163 _CONTACTS_PROPERTY_STR(im_id) /* read, write */
164_CONTACTS_END_VIEW(_contacts_messenger)
165
166_CONTACTS_BEGIN_VIEW()
167 _CONTACTS_PROPERTY_INT(id) /* read only */
168 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
169 _CONTACTS_PROPERTY_INT(type) /* read, write */
170 _CONTACTS_PROPERTY_STR(label) /* read, write */
171 _CONTACTS_PROPERTY_STR(path) /* read, write */
172 _CONTACTS_PROPERTY_BOOL(is_default)
173_CONTACTS_END_VIEW(_contacts_image)
174
175_CONTACTS_BEGIN_VIEW()
176 _CONTACTS_PROPERTY_INT(id) /* read only */
177 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
178 _CONTACTS_PROPERTY_INT(type) /* read, write */
179 _CONTACTS_PROPERTY_STR(label) /* read, write */
180 _CONTACTS_PROPERTY_STR(url) /* read, write */
181_CONTACTS_END_VIEW(_contacts_url)
182
183_CONTACTS_BEGIN_VIEW()
184 _CONTACTS_PROPERTY_INT(id) /* read only */
185 _CONTACTS_PROPERTY_INT(contact_id) /* read, write once */
186 _CONTACTS_PROPERTY_INT(type) /* read, write */
187 _CONTACTS_PROPERTY_STR(label) /* read, write */
188 _CONTACTS_PROPERTY_INT(date) /* read, write */
189 _CONTACTS_PROPERTY_INT(calendar_type) /* read, write */
190 _CONTACTS_PROPERTY_BOOL(is_leap_month) /* read, write (Deprecated since 2.4) */
191_CONTACTS_END_VIEW(_contacts_event)
192
193typedef enum {
194 CONTACTS_FILTER_OPERATOR_AND, /**< AND */
195 CONTACTS_FILTER_OPERATOR_OR /**< OR */
196} contacts_filter_operator_e;
197
198typedef enum {
199 CONTACTS_ADDRESS_TYPE_OTHER, /**< Other address type */
200 CONTACTS_ADDRESS_TYPE_CUSTOM = 1<<0, /**< A delivery address for a residence */
201 CONTACTS_ADDRESS_TYPE_HOME = 1<<1, /**< A delivery address for a residence */
202 CONTACTS_ADDRESS_TYPE_WORK = 1<<2, /**< A delivery address for a place of work */
203 CONTACTS_ADDRESS_TYPE_DOM = 1<<3, /**< A domestic delivery address */
204 CONTACTS_ADDRESS_TYPE_INTL = 1<<4, /**< An international delivery address */
205 CONTACTS_ADDRESS_TYPE_POSTAL = 1<<5, /**< A postal delivery address */
206 CONTACTS_ADDRESS_TYPE_PARCEL = 1<<6, /**< A parcel delivery address */
207}contacts_address_type_e;
208
209typedef enum {
210 CONTACTS_NUMBER_TYPE_OTHER, /**< Other number type */
211 CONTACTS_NUMBER_TYPE_CUSTOM = 1<<0, /**< Custom number type */
212 CONTACTS_NUMBER_TYPE_HOME = 1<<1, /**< A telephone number associated with a residence */
213 CONTACTS_NUMBER_TYPE_WORK = 1<<2, /**< A telephone number associated with a place of work */
214 CONTACTS_NUMBER_TYPE_VOICE = 1<<3, /**< A voice telephone number */
215 CONTACTS_NUMBER_TYPE_FAX = 1<<4, /**< A facsimile telephone number */
216 CONTACTS_NUMBER_TYPE_MSG = 1<<5, /**< The telephone number has voice messaging support */
217 CONTACTS_NUMBER_TYPE_CELL = 1<<6, /**< A cellular telephone number */
218 CONTACTS_NUMBER_TYPE_PAGER = 1<<7, /**< A paging device telephone number */
219 CONTACTS_NUMBER_TYPE_BBS = 1<<8, /**< A bulletin board system telephone number */
220 CONTACTS_NUMBER_TYPE_MODEM = 1<<9, /**< A MODEM connected telephone number */
221 CONTACTS_NUMBER_TYPE_CAR = 1<<10, /**< A car-phone telephone number */
222 CONTACTS_NUMBER_TYPE_ISDN = 1<<11, /**< An ISDN service telephone number */
223 CONTACTS_NUMBER_TYPE_VIDEO = 1<<12, /**< A video conferencing telephone number */
224 CONTACTS_NUMBER_TYPE_PCS = 1<<13, /**< A personal communication services telephone number */
225 CONTACTS_NUMBER_TYPE_COMPANY_MAIN = 1<<14, /**< A company main number */
226 CONTACTS_NUMBER_TYPE_RADIO = 1<<15, /**< A radio phone number */
227 CONTACTS_NUMBER_TYPE_MAIN = 1<<29, /**< An additional type for main */
228 CONTACTS_NUMBER_TYPE_ASSISTANT = 1<<30, /**< An additional type for assistant */
229}contacts_number_type_e;
230
231typedef enum {
232 CONTACTS_EMAIL_TYPE_OTHER, /**< Other email type */
233 CONTACTS_EMAIL_TYPE_CUSTOM = 1<<0, /**< Custom email type */
234 CONTACTS_EMAIL_TYPE_HOME = 1<<1, /**< An email address associated with a residence */
235 CONTACTS_EMAIL_TYPE_WORK = 1<<2, /**< An email address associated with a place of work */
236 CONTACTS_EMAIL_TYPE_MOBILE = 1<<3, /**< A mobile email address */
237}contacts_email_type_e;
238
239typedef enum{
240 CONTACTS_MESSENGER_TYPE_OTHER, /**< Other messenger type */
241 CONTACTS_MESSENGER_TYPE_CUSTOM, /**< Custom messenger type */
242 CONTACTS_MESSENGER_TYPE_GOOGLE, /**< Google messenger type */
243 CONTACTS_MESSENGER_TYPE_WLM, /**< Windows live messenger type */
244 CONTACTS_MESSENGER_TYPE_YAHOO, /**< Yahoo messenger type */
245 CONTACTS_MESSENGER_TYPE_FACEBOOK, /**< Facebook messenger type */
246 CONTACTS_MESSENGER_TYPE_ICQ, /**< ICQ type */
247 CONTACTS_MESSENGER_TYPE_AIM, /**< AOL instance messenger type */
248 CONTACTS_MESSENGER_TYPE_QQ, /**< QQ type */
249 CONTACTS_MESSENGER_TYPE_JABBER, /**< Jabber type */
250 CONTACTS_MESSENGER_TYPE_SKYPE, /**< Skype type */
251 CONTACTS_MESSENGER_TYPE_IRC, /**< IRC type */
252}contacts_messenger_type_e;
253
254typedef enum {
255 CONTACTS_URL_TYPE_OTHER, /**< Other URL type*/
256 CONTACTS_URL_TYPE_CUSTOM, /**< Custom URL type */
257 CONTACTS_URL_TYPE_HOME, /**< Home URL type */
258 CONTACTS_URL_TYPE_WORK, /**< Work URL type */
259}contacts_url_type_e;
260
261typedef enum {
262 CONTACTS_COMPANY_TYPE_OTHER, /**< Other company type */
263 CONTACTS_COMPANY_TYPE_CUSTOM = 1<<0, /**< Custom company type */
264 CONTACTS_COMPANY_TYPE_WORK = 1<<1, /**< Work company type */
265}contacts_company_type_e;
266
267typedef enum
268{
269 CONTACTS_MATCH_EQUAL, /**< '=' */
270 CONTACTS_MATCH_GREATER_THAN, /**< '>' */
271 CONTACTS_MATCH_GREATER_THAN_OR_EQUAL, /**< '>=' */
272 CONTACTS_MATCH_LESS_THAN, /**< '<' */
273 CONTACTS_MATCH_LESS_THAN_OR_EQUAL, /**< '<=' */
274 CONTACTS_MATCH_NOT_EQUAL, /**< '<>', this flag can yield poor performance */
275 CONTACTS_MATCH_NONE, /**< IS NULL */
276} contacts_match_int_flag_e;
277
278typedef enum
279{
280 CONTACTS_MATCH_EXACTLY, /**< Full string, case-sensitive */
281 CONTACTS_MATCH_FULLSTRING, /**< Full string, case-insensitive */
282 CONTACTS_MATCH_CONTAINS, /**< Sub string, case-insensitive */
283 CONTACTS_MATCH_STARTSWITH, /**< Start with, case-insensitive */
284 CONTACTS_MATCH_ENDSWITH, /**< End with, case-insensitive */
285 CONTACTS_MATCH_EXISTS /**< IS NOT NULL */
286} contacts_match_str_flag_e;
287
288typedef enum {
289 CONTACTS_EVENT_TYPE_OTHER, /**< Other event type */
290 CONTACTS_EVENT_TYPE_CUSTOM, /**< Custom event type */
291 CONTACTS_EVENT_TYPE_BIRTH, /**< Birthday event type */
292 CONTACTS_EVENT_TYPE_ANNIVERSARY /**< Anniversary event type */
293}contacts_event_type_e;
294
295// Record
296extern int (*contacts_record_create)(const char *view_uri, contacts_record_h *record);
297extern int (*contacts_record_destroy )(contacts_record_h record, bool delete_child);
298extern int (*contacts_record_clone)(contacts_record_h record, contacts_record_h* cloned_record);
299extern int (*contacts_record_get_child_record_count)(contacts_record_h record, unsigned int property_id, int *count);
300extern int (*contacts_record_get_child_record_at_p)(contacts_record_h record, unsigned int property_id, int index, contacts_record_h* child_record);
301extern int (*contacts_record_get_str)(contacts_record_h record, unsigned int property_id, char** value);
302extern int (*contacts_record_get_str_p)(contacts_record_h record, unsigned int property_id, char** value);
303extern int (*contacts_record_get_int)(contacts_record_h record, unsigned int property_id, int* value);
304extern int (*contacts_record_set_str)(contacts_record_h record, unsigned int property_id, const char* value);
305extern int (*contacts_record_set_int)(contacts_record_h record, unsigned int property_id, int value);
306extern int (*contacts_record_get_bool)(contacts_record_h record, unsigned int property_id, bool *value);
307extern int (*contacts_record_set_bool)(contacts_record_h record, unsigned int property_id, bool value);
308extern int (*contacts_record_remove_child_record)(contacts_record_h record, unsigned int property_id, contacts_record_h child_record);
309extern int (*contacts_record_add_child_record)(contacts_record_h record, unsigned int property_id, contacts_record_h child_record);
310
311// DB
312extern int (*contacts_db_delete_record)(const char* view_uri, int record_id);
313extern int (*contacts_db_update_record)(contacts_record_h record);
314extern int (*contacts_db_insert_record)(contacts_record_h record, int *id);
315extern int (*contacts_db_get_record)(const char* view_uri, int record_id, contacts_record_h* record);
316extern int (*contacts_db_get_all_records)(const char* view_uri, int offset, int limit, contacts_list_h* record_list);
317extern int (*contacts_db_get_records_with_query)(contacts_query_h query, int offset, int limit, contacts_list_h* record_list);
318
319// List
320extern int (*contacts_list_get_current_record_p)(contacts_list_h contacts_list, contacts_record_h* record);
321extern int (*contacts_list_next)(contacts_list_h contacts_list);
322extern int (*contacts_list_destroy)(contacts_list_h contacts_list, bool delete_child);
323extern int (*contacts_list_first)(contacts_list_h contacts_list);
324extern int (*contacts_list_create)(contacts_list_h* contacts_list);
325extern int (*contacts_list_get_count)(contacts_list_h contacts_list, int *count);
326extern int (*contacts_list_add)(contacts_list_h contacts_list, contacts_record_h record);
327
328// Filter
329extern int (*contacts_filter_create)(const char* view_uri, contacts_filter_h* filter);
330extern int (*contacts_filter_add_operator)(contacts_filter_h filter, contacts_filter_operator_e operator_type);
331extern int (*contacts_filter_add_int)(contacts_filter_h filter, unsigned int property_id, contacts_match_int_flag_e match, int match_value);
332extern int (*contacts_filter_destroy)(contacts_filter_h filter);
333extern int (*contacts_filter_add_str)(contacts_filter_h filter, unsigned int property_id, contacts_match_str_flag_e match, const char* match_value);
334
335// Query
336extern int (*contacts_query_create)(const char* view_uri, contacts_query_h* query);
337extern int (*contacts_query_set_filter)(contacts_query_h query, contacts_filter_h filter);
338extern int (*contacts_query_destroy)(contacts_query_h query);
339
340typedef struct _Ecordova_Contact_Data Ecordova_Contact_Data;
341
342/* Check if slp error or not */
343#define TIZEN_ERROR_MIN_PLATFORM_ERROR (-1073741824LL) /* = -2147483648 / 2 */
344/* Tizen Contacts Error */
345#define TIZEN_ERROR_CONTACTS -0x02010000
346
347/**
348 * @brief Enumeration for tizen errors.
349 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
350 *
351*/
352typedef enum
353{
354 TIZEN_ERROR_NONE = 0, /**< Successful */
355 TIZEN_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of memory */
356 TIZEN_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid function parameter */
357 TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE = -ENOSPC, /**< No space left on device */
358 TIZEN_ERROR_PERMISSION_DENIED = -EACCES, /**< Permission denied */
359 TIZEN_ERROR_NO_DATA = -ENODATA, /**< No data available */
360
361 TIZEN_ERROR_UNKNOWN = TIZEN_ERROR_MIN_PLATFORM_ERROR, /**< Unknown error */
362
363 /* This is a place to add new errors here.
364 * Do not assign integer values explicitly. Values are auto-assigned.
365 */
366 TIZEN_ERROR_TIMED_OUT, /**< Time out */
367 TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
368 TIZEN_ERROR_USER_NOT_CONSENTED, /**< Not Consented */
369 TIZEN_ERROR_END_OF_COLLECTION,
370} tizen_error_e;
371
372typedef enum
373{
374 /* GENERAL */
375 CONTACTS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
376 CONTACTS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
377 CONTACTS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
378 CONTACTS_ERROR_FILE_NO_SPACE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< FS Full */
379 CONTACTS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
380 CONTACTS_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
381
382 /* LOGIC & DATA */
383 CONTACTS_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< Requested data does not exist */
384
385 /* DB */
386 CONTACTS_ERROR_DB_LOCKED = TIZEN_ERROR_CONTACTS | 0x81, /**< Database table locked or file locked */
387 CONTACTS_ERROR_DB = TIZEN_ERROR_CONTACTS | 0x9F, /**< Unknown DB error */
388
389 /* IPC */
390 CONTACTS_ERROR_IPC_NOT_AVALIABLE = TIZEN_ERROR_CONTACTS | 0xB1, /**< IPC server is not available */
391 CONTACTS_ERROR_IPC = TIZEN_ERROR_CONTACTS | 0xBF, /**< Unknown IPC error */
392
393 /* ENVIRONMENT & OTHER MODULE */
394 /* Socket, inotify, vconf, icu, tapi, security/smack, account and so on */
395 CONTACTS_ERROR_SYSTEM = TIZEN_ERROR_CONTACTS | 0xEF, /**< Internal system module error */
396
397 /* UNHANDLED EXCEPTION */
398 CONTACTS_ERROR_INTERNAL = TIZEN_ERROR_CONTACTS | 0xFF, /**< Implementation Error, Temporary Use */
399} contacts_error_e;
400
401
402#endif
403
diff --git a/src/modules/ecordova/tizen/ecordova_systeminfo.c b/src/modules/ecordova/tizen/ecordova_systeminfo.c
index 66336d89bb..d66680f7fb 100644
--- a/src/modules/ecordova/tizen/ecordova_systeminfo.c
+++ b/src/modules/ecordova/tizen/ecordova_systeminfo.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
5#include "ecordova_systeminfo_private.h" 6#include "ecordova_systeminfo_private.h"
6 7
7#include <vconf.h> 8#include <vconf.h>
@@ -129,3 +130,4 @@ _on_battery_changed(keynode_t *node EINA_UNUSED, void *data)
129} 130}
130 131
131#include "ecordova_systeminfo.eo.c" 132#include "ecordova_systeminfo.eo.c"
133#endif
diff --git a/src/modules/ecordova/tizen/ecordova_tizen.c b/src/modules/ecordova/tizen/ecordova_tizen.c
index 89ce9d3aa7..f496580119 100644
--- a/src/modules/ecordova/tizen/ecordova_tizen.c
+++ b/src/modules/ecordova/tizen/ecordova_tizen.c
@@ -12,6 +12,9 @@ int _ecordova_log_dom;
12#define INF(...) EINA_LOG_DOM_INFO(_ecordova_log_dom, __VA_ARGS__) 12#define INF(...) EINA_LOG_DOM_INFO(_ecordova_log_dom, __VA_ARGS__)
13#define DBG(...) EINA_LOG_DOM_DBG(_ecordova_log_dom, __VA_ARGS__) 13#define DBG(...) EINA_LOG_DOM_DBG(_ecordova_log_dom, __VA_ARGS__)
14 14
15void ecordova_contacts_service_init();
16void ecordova_contacts_service_shutdown();
17
15static Eina_Bool 18static Eina_Bool
16_ecordova_tizen_init(void) 19_ecordova_tizen_init(void)
17{ 20{
@@ -22,15 +25,19 @@ _ecordova_tizen_init(void)
22 return EINA_FALSE; 25 return EINA_FALSE;
23 } 26 }
24 27
28 ecordova_contacts_service_init();
29
25 return EINA_TRUE; 30 return EINA_TRUE;
26} 31}
27 32
28static void 33static void
29_ecordova_tizen_shutdown(void) 34_ecordova_tizen_shutdown(void)
30{ 35{
31 eina_log_domain_unregister(_ecordova_log_dom); 36 ecordova_contacts_service_shutdown();
37
38 eina_log_domain_unregister(_ecordova_log_dom);
32 _ecordova_log_dom = -1; 39 _ecordova_log_dom = -1;
33} 40}
34 41
35EINA_MODULE_INIT(_ecordova_system_tizen_init); 42EINA_MODULE_INIT(_ecordova_tizen_init);
36EINA_MODULE_SHUTDOWN(_ecordova_system_tizen_shutdown); 43EINA_MODULE_SHUTDOWN(_ecordova_tizen_shutdown);
diff --git a/src/modules/ecordova/tizen/ecordova_vibration.c b/src/modules/ecordova/tizen/ecordova_vibration.c
index e1c22f1859..6bb32f90ed 100644
--- a/src/modules/ecordova/tizen/ecordova_vibration.c
+++ b/src/modules/ecordova/tizen/ecordova_vibration.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_HAPTIC
5#include "ecordova_vibration_private.h" 6#include "ecordova_vibration_private.h"
6 7
7#include <haptic.h> 8#include <haptic.h>
@@ -57,3 +58,4 @@ _ecordova_vibration_vibrate(Eo *obj,
57} 58}
58 59
59#include "ecordova_vibration.eo.c" 60#include "ecordova_vibration.eo.c"
61#endif
diff --git a/src/tests/ecordova/ecordova_contacts_test.c b/src/tests/ecordova/ecordova_contacts_test.c
index 3b6a2213d6..af833ebc4e 100644
--- a/src/tests/ecordova/ecordova_contacts_test.c
+++ b/src/tests/ecordova/ecordova_contacts_test.c
@@ -9,9 +9,6 @@
9 9
10#include <check.h> 10#include <check.h>
11 11
12#if defined(HAVE_TIZEN_CONFIGURATION_MANAGER) && defined(HAVE_TIZEN_CONTACTS_SERVICE)
13#include <contact.h>
14
15#define CHECK(x) {int ret = x; ck_assert_int_eq(CONTACTS_ERROR_NONE, ret);} 12#define CHECK(x) {int ret = x; ck_assert_int_eq(CONTACTS_ERROR_NONE, ret);}
16 13
17static int _contact_id; 14static int _contact_id;
@@ -27,32 +24,32 @@ _setup(void)
27 24
28 DBG("%s", "_setup"); 25 DBG("%s", "_setup");
29 26
30 CHECK(contacts_connect()); 27 /* CHECK(contacts_connect()); */
31 28
32 // TODO: delete all record in the database to be back to square 1 and make tests deterministic 29 // TODO: delete all record in the database to be back to square 1 and make tests deterministic
33 DBG("%s", "_setup"); 30 DBG("%s", "_setup");
34 31
35 // create contact record 32 /* // create contact record */
36 contacts_record_h contact = NULL; 33 /* contacts_record_h contact = NULL; */
37 CHECK(contacts_record_create(_contacts_contact._uri, &contact)); 34 /* CHECK(contacts_record_create(_contacts_contact._uri, &contact)); */
38 35
39 // add name 36 /* // add name */
40 contacts_record_h name = NULL; 37 /* contacts_record_h name = NULL; */
41 CHECK(contacts_record_create(_contacts_name._uri, &name)); 38 /* CHECK(contacts_record_create(_contacts_name._uri, &name)); */
42 CHECK(contacts_record_set_str(name, _contacts_name.first, _contact_name)); 39 /* CHECK(contacts_record_set_str(name, _contacts_name.first, _contact_name)); */
43 CHECK(contacts_record_add_child_record(contact, _contacts_contact.name, name)); 40 /* CHECK(contacts_record_add_child_record(contact, _contacts_contact.name, name)); */
44 41
45 CHECK(contacts_db_insert_record(contact, &_contact_id)); 42 /* CHECK(contacts_db_insert_record(contact, &_contact_id)); */
46 43
47 CHECK(contacts_record_destroy(contact, true)); 44 /* CHECK(contacts_record_destroy(contact, true)); */
48} 45}
49 46
50static void 47static void
51_teardown(void) 48_teardown(void)
52{ 49{
53 CHECK(contacts_db_delete_record(_contacts_contact._uri, _contact_id)); 50 /* CHECK(contacts_db_delete_record(_contacts_contact._uri, _contact_id)); */
54 51
55 CHECK(contacts_disconnect()); 52 /* CHECK(contacts_disconnect()); */
56 53
57 int ret = ecordova_shutdown(); 54 int ret = ecordova_shutdown();
58 ck_assert_int_eq(ret, 0); 55 ck_assert_int_eq(ret, 0);
@@ -64,14 +61,14 @@ _find_all_success_cb(void *data,
64 const Eo_Event_Description *desc EINA_UNUSED, 61 const Eo_Event_Description *desc EINA_UNUSED,
65 void *event_info) 62 void *event_info)
66{ 63{
67 bool *success = data; 64 Eina_Bool *success = data;
68 Eina_Array *contacts = event_info; 65 Eina_Array *contacts = event_info;
69 fail_if(NULL == contacts); 66 fail_if(NULL == contacts);
70 67
71 size_t count = eina_array_count(contacts); 68 size_t count = eina_array_count(contacts);
72 DBG("# of contacts: %zu", count); 69 DBG("# of contacts: %zu", count);
73 70
74 *success = true; 71 *success = EINA_TRUE;
75 ecore_main_loop_quit(); 72 ecore_main_loop_quit();
76 return EO_CALLBACK_CONTINUE; 73 return EO_CALLBACK_CONTINUE;
77} 74}
@@ -103,11 +100,11 @@ _error_cb(void *data,
103 const Eo_Event_Description *desc EINA_UNUSED, 100 const Eo_Event_Description *desc EINA_UNUSED,
104 void *event_info) 101 void *event_info)
105{ 102{
106 bool *error = data; 103 Eina_Bool *error = data;
107 Ecordova_Contacts_Error *error_code = event_info; 104 Ecordova_Contacts_Error *error_code = event_info;
108 fail_if(NULL == error_code); 105 fail_if(NULL == error_code);
109 106
110 *error = true; 107 *error = EINA_TRUE;
111 ecore_main_loop_quit(); 108 ecore_main_loop_quit();
112 return EO_CALLBACK_CONTINUE; 109 return EO_CALLBACK_CONTINUE;
113} 110}
@@ -115,8 +112,8 @@ _error_cb(void *data,
115static Eina_Bool 112static Eina_Bool
116_timeout_cb(void *data) 113_timeout_cb(void *data)
117{ 114{
118 bool *timeout = data; 115 Eina_Bool *timeout = data;
119 *timeout = true; 116 *timeout = EINA_TRUE;
120 ecore_main_loop_quit(); 117 ecore_main_loop_quit();
121 return ECORE_CALLBACK_CANCEL; 118 return ECORE_CALLBACK_CANCEL;
122} 119}
@@ -126,9 +123,9 @@ START_TEST(find_all)
126 Ecordova_Contacts *contacts = eo_add(ECORDOVA_CONTACTS_CLASS, NULL); 123 Ecordova_Contacts *contacts = eo_add(ECORDOVA_CONTACTS_CLASS, NULL);
127 fail_if(NULL == contacts); 124 fail_if(NULL == contacts);
128 125
129 bool success = false; 126 Eina_Bool success = EINA_FALSE;
130 bool error = false; 127 Eina_Bool error = EINA_FALSE;
131 bool timeout = false; 128 Eina_Bool timeout = EINA_FALSE;
132 129
133 Ecore_Timer *timer = eo_add(ECORE_TIMER_CLASS, NULL, ecore_obj_timer_constructor(10, _timeout_cb, &timeout)); 130 Ecore_Timer *timer = eo_add(ECORE_TIMER_CLASS, NULL, ecore_obj_timer_constructor(10, _timeout_cb, &timeout));
134 eo_do(contacts, eo_event_callback_add(ECORDOVA_CONTACTS_EVENT_FIND_SUCCESS, _find_all_success_cb, &success)); 131 eo_do(contacts, eo_event_callback_add(ECORDOVA_CONTACTS_EVENT_FIND_SUCCESS, _find_all_success_cb, &success));
@@ -158,8 +155,8 @@ START_TEST(find_by_id)
158 fail_if(NULL == contacts); 155 fail_if(NULL == contacts);
159 156
160 Ecordova_Contact *contact = NULL; 157 Ecordova_Contact *contact = NULL;
161 bool error = false; 158 Eina_Bool error = EINA_FALSE;
162 bool timeout = false; 159 Eina_Bool timeout = EINA_FALSE;
163 160
164 Ecore_Timer *timer = eo_add(ECORE_TIMER_CLASS, NULL, ecore_obj_timer_constructor(10, _timeout_cb, &timeout)); 161 Ecore_Timer *timer = eo_add(ECORE_TIMER_CLASS, NULL, ecore_obj_timer_constructor(10, _timeout_cb, &timeout));
165 eo_do(contacts, eo_event_callback_add(ECORDOVA_CONTACTS_EVENT_FIND_SUCCESS, _find_one_contact_success_cb, &contact)); 162 eo_do(contacts, eo_event_callback_add(ECORDOVA_CONTACTS_EVENT_FIND_SUCCESS, _find_one_contact_success_cb, &contact));
@@ -208,8 +205,8 @@ START_TEST(find_by_name)
208 fail_if(NULL == contacts); 205 fail_if(NULL == contacts);
209 206
210 Ecordova_Contact *contact = NULL; 207 Ecordova_Contact *contact = NULL;
211 bool error = false; 208 Eina_Bool error = EINA_FALSE;
212 bool timeout = false; 209 Eina_Bool timeout = EINA_FALSE;
213 210
214 Ecore_Timer *timer = eo_add(ECORE_TIMER_CLASS, NULL, ecore_obj_timer_constructor(10, _timeout_cb, &timeout)); 211 Ecore_Timer *timer = eo_add(ECORE_TIMER_CLASS, NULL, ecore_obj_timer_constructor(10, _timeout_cb, &timeout));
215 eo_do(contacts, eo_event_callback_add(ECORDOVA_CONTACTS_EVENT_FIND_SUCCESS, _find_one_contact_success_cb, &contact)); 212 eo_do(contacts, eo_event_callback_add(ECORDOVA_CONTACTS_EVENT_FIND_SUCCESS, _find_one_contact_success_cb, &contact));
@@ -218,7 +215,7 @@ START_TEST(find_by_name)
218 Eina_List *fields = eina_list_append(NULL, "name"); 215 Eina_List *fields = eina_list_append(NULL, "name");
219 Ecordova_Contacts_FindOptions options = { 216 Ecordova_Contacts_FindOptions options = {
220 .filter = "test", 217 .filter = "test",
221 .multiple = false 218 .multiple = EINA_FALSE
222 }; 219 };
223 eo_do(contacts, ecordova_contacts_find(fields, &options)); 220 eo_do(contacts, ecordova_contacts_find(fields, &options));
224 221
@@ -257,42 +254,41 @@ ecordova_contacts_test(TCase *tc)
257 tcase_add_test(tc, find_by_id); 254 tcase_add_test(tc, find_by_id);
258 tcase_add_test(tc, find_by_name); 255 tcase_add_test(tc, find_by_name);
259} 256}
260#else 257/* #else */
261START_TEST(contacts_fail_load) 258/* START_TEST(contacts_fail_load) */
262{ 259/* { */
263 ecordova_init(); 260/* ecordova_init(); */
264 261
265 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 262/* fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); */
266 Ecordova_Contacts *contacts = eo_add(ECORDOVA_CONTACTS_CLASS, NULL); 263/* Ecordova_Contacts *contacts = eo_add(ECORDOVA_CONTACTS_CLASS, NULL); */
267 ck_assert_ptr_eq(contacts, NULL); 264/* ck_assert_ptr_eq(contacts, NULL); */
268 265
269 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 266/* fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); */
270 Ecordova_Contact *contact = eo_add(ECORDOVA_CONTACT_CLASS, NULL); 267/* Ecordova_Contact *contact = eo_add(ECORDOVA_CONTACT_CLASS, NULL); */
271 ck_assert_ptr_eq(contact, NULL); 268/* ck_assert_ptr_eq(contact, NULL); */
272 269
273 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 270/* fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); */
274 Ecordova_ContactAddress *contact_address = eo_add(ECORDOVA_CONTACTADDRESS_CLASS, NULL); 271/* Ecordova_ContactAddress *contact_address = eo_add(ECORDOVA_CONTACTADDRESS_CLASS, NULL); */
275 ck_assert_ptr_eq(contact_address, NULL); 272/* ck_assert_ptr_eq(contact_address, NULL); */
276 273
277 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 274/* fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); */
278 Ecordova_ContactField *contact_field = eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL); 275/* Ecordova_ContactField *contact_field = eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL); */
279 ck_assert_ptr_eq(contact_field, NULL); 276/* ck_assert_ptr_eq(contact_field, NULL); */
280 277
281 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 278/* fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); */
282 Ecordova_ContactName *contact_name = eo_add(ECORDOVA_CONTACTNAME_CLASS, NULL); 279/* Ecordova_ContactName *contact_name = eo_add(ECORDOVA_CONTACTNAME_CLASS, NULL); */
283 ck_assert_ptr_eq(contact_name, NULL); 280/* ck_assert_ptr_eq(contact_name, NULL); */
284 281
285 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 282/* fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); */
286 Ecordova_ContactOrganization *contact_organization = eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, NULL); 283/* Ecordova_ContactOrganization *contact_organization = eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, NULL); */
287 ck_assert_ptr_eq(contact_organization, NULL); 284/* ck_assert_ptr_eq(contact_organization, NULL); */
288 285
289 ecordova_shutdown(); 286/* ecordova_shutdown(); */
290} 287/* } */
291END_TEST 288/* END_TEST */
292 289
293void 290/* void */
294ecordova_contacts_test(TCase *tc) 291/* ecordova_contacts_test(TCase *tc) */
295{ 292/* { */
296 tcase_add_test(tc, contacts_fail_load); 293/* tcase_add_test(tc, contacts_fail_load); */
297} 294/* } */
298#endif