summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-03 22:06:16 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-03 22:06:16 -0200
commit2ed2b84d6b5c6b9e43151b5fabf5e8f7eabc1b62 (patch)
tree76b1e1231c9183967f7e82346cedb6df20111be8
parent9f641d1b69c05656f5e8ca78be274a98cdf44407 (diff)
ecordova: Removed constructors
-rw-r--r--src/Makefile_Ecordova.am2
-rw-r--r--src/lib/ecordova/Ecordova_Eo.h2
-rw-r--r--src/lib/ecordova/ecordova_batterystatus.eo12
-rw-r--r--src/lib/ecordova/ecordova_console.eo10
-rw-r--r--src/lib/ecordova/ecordova_contactaddress.eo37
-rw-r--r--src/lib/ecordova/ecordova_contactfield.eo26
-rw-r--r--src/lib/ecordova/ecordova_contactname.eo18
-rw-r--r--src/lib/ecordova/ecordova_contactorganization.eo31
-rw-r--r--src/lib/ecordova/ecordova_contacts.eo10
-rw-r--r--src/lib/ecordova/ecordova_device.eo10
-rw-r--r--src/lib/ecordova/ecordova_devicemotion.eo12
-rw-r--r--src/lib/ecordova/ecordova_deviceorientation.eo10
-rw-r--r--src/lib/ecordova/ecordova_dialogs.eo87
-rw-r--r--src/lib/ecordova/ecordova_directoryentry.eo24
-rw-r--r--src/lib/ecordova/ecordova_directoryreader.eo11
-rw-r--r--src/lib/ecordova/ecordova_entry.eo33
-rw-r--r--src/lib/ecordova/ecordova_fileentry.eo24
-rw-r--r--src/lib/ecordova/ecordova_filereader.eo10
-rw-r--r--src/lib/ecordova/ecordova_filetransfer.eo10
-rw-r--r--src/lib/ecordova/ecordova_filewriter.eo8
-rw-r--r--src/lib/ecordova/ecordova_geolocation.eo10
-rw-r--r--src/lib/ecordova/ecordova_globalization.eo10
-rw-r--r--src/lib/ecordova/ecordova_media.eo10
-rw-r--r--src/lib/ecordova/ecordova_mediafile.eo17
-rw-r--r--src/lib/ecordova/ecordova_networkinformation.eo10
-rw-r--r--src/lib/ecordova/ecordova_splashscreen.eo29
-rw-r--r--src/lib/ecordova/ecordova_systeminfo.eo12
-rw-r--r--src/lib/ecordova/ecordova_vibration.eo10
-rw-r--r--src/modules/ecordova/linux/ecordova_console.c8
-rw-r--r--src/modules/ecordova/linux/ecordova_directoryentry.c41
-rw-r--r--src/modules/ecordova/linux/ecordova_directoryreader.c19
-rw-r--r--src/modules/ecordova/linux/ecordova_entry.c97
-rw-r--r--src/modules/ecordova/linux/ecordova_entry_private.h5
-rw-r--r--src/modules/ecordova/linux/ecordova_fileentry.c23
-rw-r--r--src/modules/ecordova/linux/ecordova_filereader.c15
-rw-r--r--src/modules/ecordova/linux/ecordova_filetransfer.c22
-rw-r--r--src/modules/ecordova/linux/ecordova_filewriter.c27
-rw-r--r--src/modules/ecordova/tizen/ecordova_batterystatus.c22
-rw-r--r--src/modules/ecordova/tizen/ecordova_contact.c165
-rw-r--r--src/modules/ecordova/tizen/ecordova_contact_private.h5
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactaddress.c57
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactaddress_private.h4
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactfield.c53
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactfield_private.h5
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactname.c62
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactname_private.h5
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactorganization.c50
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactorganization_private.h4
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts.c40
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_record_utils.c76
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_record_utils.h17
-rw-r--r--src/modules/ecordova/tizen/ecordova_device.c7
-rw-r--r--src/modules/ecordova/tizen/ecordova_devicemotion.c7
-rw-r--r--src/modules/ecordova/tizen/ecordova_deviceorientation.c7
-rw-r--r--src/modules/ecordova/tizen/ecordova_geolocation.c14
-rw-r--r--src/modules/ecordova/tizen/ecordova_globalization.c7
-rw-r--r--src/modules/ecordova/tizen/ecordova_media.c18
-rw-r--r--src/modules/ecordova/tizen/ecordova_media_private.h3
-rw-r--r--src/modules/ecordova/tizen/ecordova_mediafile.c30
-rw-r--r--src/modules/ecordova/tizen/ecordova_networkinformation.c7
-rw-r--r--src/modules/ecordova/tizen/ecordova_systeminfo.c12
-rw-r--r--src/modules/ecordova/tizen/ecordova_systeminfo_private.h2
-rw-r--r--src/modules/ecordova/tizen/ecordova_vibration.c7
-rw-r--r--src/tests/ecordova/ecordova_console_test.c4
-rw-r--r--src/tests/ecordova/ecordova_directoryentry_test.c10
-rw-r--r--src/tests/ecordova/ecordova_directoryreader_test.c2
-rw-r--r--src/tests/ecordova/ecordova_entry_test.c11
-rw-r--r--src/tests/ecordova/ecordova_file_tests.h2
-rw-r--r--src/tests/ecordova/ecordova_fileentry_test.c14
-rw-r--r--src/tests/ecordova/ecordova_filereader_test.c4
-rw-r--r--src/tests/ecordova/ecordova_filetransfer_test.c4
-rw-r--r--src/tests/ecordova/ecordova_filewriter_test.c4
72 files changed, 415 insertions, 1078 deletions
diff --git a/src/Makefile_Ecordova.am b/src/Makefile_Ecordova.am
index 1f82cd4d19..342b4c4105 100644
--- a/src/Makefile_Ecordova.am
+++ b/src/Makefile_Ecordova.am
@@ -14,12 +14,10 @@ lib/ecordova/ecordova_contactorganization.eo \
14lib/ecordova/ecordova_device.eo \ 14lib/ecordova/ecordova_device.eo \
15lib/ecordova/ecordova_devicemotion.eo \ 15lib/ecordova/ecordova_devicemotion.eo \
16lib/ecordova/ecordova_deviceorientation.eo \ 16lib/ecordova/ecordova_deviceorientation.eo \
17lib/ecordova/ecordova_dialogs.eo \
18lib/ecordova/ecordova_geolocation.eo \ 17lib/ecordova/ecordova_geolocation.eo \
19lib/ecordova/ecordova_globalization.eo \ 18lib/ecordova/ecordova_globalization.eo \
20lib/ecordova/ecordova_media.eo \ 19lib/ecordova/ecordova_media.eo \
21lib/ecordova/ecordova_networkinformation.eo \ 20lib/ecordova/ecordova_networkinformation.eo \
22lib/ecordova/ecordova_splashscreen.eo \
23lib/ecordova/ecordova_vibration.eo \ 21lib/ecordova/ecordova_vibration.eo \
24lib/ecordova/ecordova_file.eo \ 22lib/ecordova/ecordova_file.eo \
25lib/ecordova/ecordova_filewriter.eo \ 23lib/ecordova/ecordova_filewriter.eo \
diff --git a/src/lib/ecordova/Ecordova_Eo.h b/src/lib/ecordova/Ecordova_Eo.h
index 3cbd474f72..7a0dd2ee17 100644
--- a/src/lib/ecordova/Ecordova_Eo.h
+++ b/src/lib/ecordova/Ecordova_Eo.h
@@ -13,12 +13,10 @@ typedef Eo Ecordova_DirectoryReader;
13#include <ecordova_device.eo.h> 13#include <ecordova_device.eo.h>
14#include <ecordova_devicemotion.eo.h> 14#include <ecordova_devicemotion.eo.h>
15#include <ecordova_deviceorientation.eo.h> 15#include <ecordova_deviceorientation.eo.h>
16#include <ecordova_dialogs.eo.h>
17#include <ecordova_geolocation.eo.h> 16#include <ecordova_geolocation.eo.h>
18#include <ecordova_globalization.eo.h> 17#include <ecordova_globalization.eo.h>
19#include <ecordova_media.eo.h> 18#include <ecordova_media.eo.h>
20#include <ecordova_networkinformation.eo.h> 19#include <ecordova_networkinformation.eo.h>
21#include <ecordova_splashscreen.eo.h>
22#include <ecordova_vibration.eo.h> 20#include <ecordova_vibration.eo.h>
23#include <ecordova_file.eo.h> 21#include <ecordova_file.eo.h>
24#include <ecordova_filewriter.eo.h> 22#include <ecordova_filewriter.eo.h>
diff --git a/src/lib/ecordova/ecordova_batterystatus.eo b/src/lib/ecordova/ecordova_batterystatus.eo
index 2dcb511c73..b05843d74b 100644
--- a/src/lib/ecordova/ecordova_batterystatus.eo
+++ b/src/lib/ecordova/ecordova_batterystatus.eo
@@ -16,22 +16,10 @@ class Ecordova.BatteryStatus (Eo.Base) {
16 http://plugins.cordova.io/#/package/org.apache.cordova.battery-status 16 http://plugins.cordova.io/#/package/org.apache.cordova.battery-status
17 ]] 17 ]]
18 legacy_prefix: null; 18 legacy_prefix: null;
19 methods {
20 constructor {
21 [[Custom Ecordova_BatteryStatus constructor.
22 @.constructor
23
24 @since 2.3
25 ]]
26 }
27 }
28 implements { 19 implements {
29 Eo.Base.constructor; 20 Eo.Base.constructor;
30 Eo.Base.destructor; 21 Eo.Base.destructor;
31 } 22 }
32 constructors {
33 .constructor;
34 }
35 events { 23 events {
36 battery,status: const(Ecordova.BatteryStatus.EventInfo)*; 24 battery,status: const(Ecordova.BatteryStatus.EventInfo)*;
37 [[This event fires when the percentage of battery charge changes by at 25 [[This event fires when the percentage of battery charge changes by at
diff --git a/src/lib/ecordova/ecordova_console.eo b/src/lib/ecordova/ecordova_console.eo
index 208f3f961c..d8283caada 100644
--- a/src/lib/ecordova/ecordova_console.eo
+++ b/src/lib/ecordova/ecordova_console.eo
@@ -15,13 +15,6 @@ class Ecordova.Console (Eo.Base) {
15 ]] 15 ]]
16 legacy_prefix: null; 16 legacy_prefix: null;
17 methods { 17 methods {
18 constructor {
19 [[Custom Ecordova_Console constructor.
20 @.constructor
21
22 @since 2.3
23 ]]
24 }
25 log { 18 log {
26 [[Logs a message at the LOG level.]] 19 [[Logs a message at the LOG level.]]
27 params { 20 params {
@@ -100,7 +93,4 @@ class Ecordova.Console (Eo.Base) {
100 Eo.Base.constructor; 93 Eo.Base.constructor;
101 Eo.Base.destructor; 94 Eo.Base.destructor;
102 } 95 }
103 constructors {
104 .constructor;
105 }
106} 96}
diff --git a/src/lib/ecordova/ecordova_contactaddress.eo b/src/lib/ecordova/ecordova_contactaddress.eo
index ee5a9efef9..6c20c5f0c1 100644
--- a/src/lib/ecordova/ecordova_contactaddress.eo
+++ b/src/lib/ecordova/ecordova_contactaddress.eo
@@ -2,40 +2,6 @@ class Ecordova.ContactAddress (Eo.Base) {
2 [[Contains information about a single contact.]] 2 [[Contains information about a single contact.]]
3 legacy_prefix: null; 3 legacy_prefix: null;
4 methods { 4 methods {
5 constructor {
6 [[Custom Ecordova_ContactAddress constructor.
7 @.constructor
8
9 @since 2.3
10 ]]
11 params {
12 pref: bool;
13 [[user's preferred value.]]
14
15 type: const(char)*;
16 [[A string indicating what type of field this is, home for
17 example.
18 ]]
19
20 formatted: const(char)*;
21 [[The full address formatted for display.]]
22
23 street_address: const(char)*;
24 [[The full street address.]]
25
26 locality: const(char)*;
27 [[The city or locality.]]
28
29 region: const(char)*;
30 [[The state or region.]]
31
32 postal_code: const(char)*;
33 [[The zip code or postal code.]]
34
35 country: const(char)*;
36 [[The country name.]]
37 }
38 }
39 @property id { 5 @property id {
40 get {} 6 get {}
41 values { 7 values {
@@ -87,7 +53,4 @@ class Ecordova.ContactAddress (Eo.Base) {
87 Eo.Base.constructor; 53 Eo.Base.constructor;
88 Eo.Base.destructor; 54 Eo.Base.destructor;
89 } 55 }
90 constructors {
91 .constructor;
92 }
93} 56}
diff --git a/src/lib/ecordova/ecordova_contactfield.eo b/src/lib/ecordova/ecordova_contactfield.eo
index b61930547f..20c221839a 100644
--- a/src/lib/ecordova/ecordova_contactfield.eo
+++ b/src/lib/ecordova/ecordova_contactfield.eo
@@ -2,29 +2,6 @@ class Ecordova.ContactField (Eo.Base) {
2 [[Contains information about a single contact.]] 2 [[Contains information about a single contact.]]
3 legacy_prefix: null; 3 legacy_prefix: null;
4 methods { 4 methods {
5 constructor {
6 [[Custom Ecordova_ContactField constructor.
7 @.constructor
8
9 @since 2.3
10 ]]
11 params {
12 type: const(char)*;
13 [[A string that indicates what type of field this is, home for
14 example.
15 ]]
16
17 value: const(char)*;
18 [[The value of the field, such as a phone number or email
19 address.
20 ]]
21
22 pref: bool;
23 [[Set to true if this ContactField contains the user's preferred
24 value.
25 ]]
26 }
27 }
28 @property id { 5 @property id {
29 get {} 6 get {}
30 values { 7 values {
@@ -51,7 +28,4 @@ class Ecordova.ContactField (Eo.Base) {
51 Eo.Base.constructor; 28 Eo.Base.constructor;
52 Eo.Base.destructor; 29 Eo.Base.destructor;
53 } 30 }
54 constructors {
55 .constructor;
56 }
57} 31}
diff --git a/src/lib/ecordova/ecordova_contactname.eo b/src/lib/ecordova/ecordova_contactname.eo
index 435d714dbb..0472d7a549 100644
--- a/src/lib/ecordova/ecordova_contactname.eo
+++ b/src/lib/ecordova/ecordova_contactname.eo
@@ -2,21 +2,6 @@ class Ecordova.ContactName (Eo.Base) {
2 [[Contact name.]] 2 [[Contact name.]]
3 legacy_prefix: null; 3 legacy_prefix: null;
4 methods { 4 methods {
5 constructor {
6 [[Custom Ecordova_ContactName constructor.
7 @.constructor
8
9 @since 2.3
10 ]]
11 params {
12 formatted: const(char)*; [[The complete name of the contact.]]
13 family_name: const(char)*; [[The contact's family name.]]
14 given_name: const(char)*; [[The contact's given name.]]
15 middle: const(char)*; [[The contact's middle name.]]
16 prefix: const(char)*; [[The contact's prefix (example Mr. or Dr.)]]
17 suffix: const(char)*; [[The contact's suffix (example Esq.).]]
18 }
19 }
20 @property formatted { 5 @property formatted {
21 values { 6 values {
22 formatted: const(char)*; 7 formatted: const(char)*;
@@ -52,7 +37,4 @@ class Ecordova.ContactName (Eo.Base) {
52 Eo.Base.constructor; 37 Eo.Base.constructor;
53 Eo.Base.destructor; 38 Eo.Base.destructor;
54 } 39 }
55 constructors {
56 .constructor;
57 }
58} 40}
diff --git a/src/lib/ecordova/ecordova_contactorganization.eo b/src/lib/ecordova/ecordova_contactorganization.eo
index baf6b275cd..c0b18ac2bd 100644
--- a/src/lib/ecordova/ecordova_contactorganization.eo
+++ b/src/lib/ecordova/ecordova_contactorganization.eo
@@ -2,34 +2,6 @@ class Ecordova.ContactOrganization (Eo.Base) {
2 [[Contact name.]] 2 [[Contact name.]]
3 legacy_prefix: null; 3 legacy_prefix: null;
4 methods { 4 methods {
5 constructor {
6 [[Custom Ecordova_ContactOrganization constructor.
7 @.constructor
8
9 @since 2.3
10 ]]
11 params {
12 pref: bool;
13 [[Set to true if this ContactOrganization contains the user's
14 preferred value.
15 ]]
16
17 type: const(char)*;
18 [[A string that indicates what type of field this is, home for
19 example.
20 ]]
21
22 name: const(char)*;
23 [[The name of the organization.]]
24
25 dept: const(char)*;
26 [[The department the contract works for.]]
27
28 title: const(char)*;
29 [[The contact's title at the organization.]]
30
31 }
32 }
33 @property id { 5 @property id {
34 get {} 6 get {}
35 values { 7 values {
@@ -66,7 +38,4 @@ class Ecordova.ContactOrganization (Eo.Base) {
66 Eo.Base.constructor; 38 Eo.Base.constructor;
67 Eo.Base.destructor; 39 Eo.Base.destructor;
68 } 40 }
69 constructors {
70 .constructor;
71 }
72} 41}
diff --git a/src/lib/ecordova/ecordova_contacts.eo b/src/lib/ecordova/ecordova_contacts.eo
index 0c968006ab..1c266a513f 100644
--- a/src/lib/ecordova/ecordova_contacts.eo
+++ b/src/lib/ecordova/ecordova_contacts.eo
@@ -28,13 +28,6 @@ class Ecordova.Contacts (Eo.Base) {
28 ]] 28 ]]
29 legacy_prefix: null; 29 legacy_prefix: null;
30 methods { 30 methods {
31 constructor {
32 [[Custom Ecordova_Contacts constructor.
33 @.constructor
34
35 @since 2.3
36 ]]
37 }
38 find { 31 find {
39 [[Returns an array of Contacts matching the search criteria.]] 32 [[Returns an array of Contacts matching the search criteria.]]
40 params { 33 params {
@@ -65,9 +58,6 @@ class Ecordova.Contacts (Eo.Base) {
65 Eo.Base.constructor; 58 Eo.Base.constructor;
66 Eo.Base.destructor; 59 Eo.Base.destructor;
67 } 60 }
68 constructors {
69 .constructor;
70 }
71 events { 61 events {
72 find,success: const(array<Ecordova.Contact*>)*; 62 find,success: const(array<Ecordova.Contact*>)*;
73 pick,success: const(array<Ecordova.Contact*>)*; 63 pick,success: const(array<Ecordova.Contact*>)*;
diff --git a/src/lib/ecordova/ecordova_device.eo b/src/lib/ecordova/ecordova_device.eo
index 8221850c97..2d1d429f8b 100644
--- a/src/lib/ecordova/ecordova_device.eo
+++ b/src/lib/ecordova/ecordova_device.eo
@@ -5,13 +5,6 @@ class Ecordova.Device (Eo.Base) {
5 ]] 5 ]]
6 legacy_prefix: null; 6 legacy_prefix: null;
7 methods { 7 methods {
8 constructor {
9 [[Custom Ecordova_Device constructor.
10 @.constructor
11
12 @since 2.3
13 ]]
14 }
15 @property ecordova { 8 @property ecordova {
16 [[Get the version of Ecordova running on the device.]] 9 [[Get the version of Ecordova running on the device.]]
17 get {} 10 get {}
@@ -54,7 +47,4 @@ class Ecordova.Device (Eo.Base) {
54 Eo.Base.constructor; 47 Eo.Base.constructor;
55 Eo.Base.destructor; 48 Eo.Base.destructor;
56 } 49 }
57 constructors {
58 .constructor;
59 }
60} 50}
diff --git a/src/lib/ecordova/ecordova_devicemotion.eo b/src/lib/ecordova/ecordova_devicemotion.eo
index 20640d3351..c344815349 100644
--- a/src/lib/ecordova/ecordova_devicemotion.eo
+++ b/src/lib/ecordova/ecordova_devicemotion.eo
@@ -20,15 +20,6 @@ class Ecordova.DeviceMotion (Eo.Base) {
20 ]] 20 ]]
21 legacy_prefix: null; 21 legacy_prefix: null;
22 methods { 22 methods {
23 constructor {
24 [[Custom Ecordova_DeviceMotion constructor.
25 @.constructor
26
27 @since 2.3
28 ]]
29 params {
30 }
31 }
32 current_acceleration_get { 23 current_acceleration_get {
33 [[Get the current acceleration]] 24 [[Get the current acceleration]]
34 } 25 }
@@ -59,9 +50,6 @@ class Ecordova.DeviceMotion (Eo.Base) {
59 Eo.Base.constructor; 50 Eo.Base.constructor;
60 Eo.Base.destructor; 51 Eo.Base.destructor;
61 } 52 }
62 constructors {
63 .constructor;
64 }
65 events { 53 events {
66 current,success: Ecordova.DeviceMotion.Acceleration*; 54 current,success: Ecordova.DeviceMotion.Acceleration*;
67 watch,success: Ecordova.DeviceMotion.Acceleration*; 55 watch,success: Ecordova.DeviceMotion.Acceleration*;
diff --git a/src/lib/ecordova/ecordova_deviceorientation.eo b/src/lib/ecordova/ecordova_deviceorientation.eo
index edf3b4a6c2..dffcfeb76a 100644
--- a/src/lib/ecordova/ecordova_deviceorientation.eo
+++ b/src/lib/ecordova/ecordova_deviceorientation.eo
@@ -37,13 +37,6 @@ class Ecordova.DeviceOrientation (Eo.Base) {
37 ]] 37 ]]
38 legacy_prefix: null; 38 legacy_prefix: null;
39 methods { 39 methods {
40 constructor {
41 [[Custom Ecordova_DeviceOrientation constructor.
42 @.constructor
43
44 @since 2.3
45 ]]
46 }
47 current_heading_get { 40 current_heading_get {
48 [[Get the current compass heading. The compass heading is returned 41 [[Get the current compass heading. The compass heading is returned
49 via a CompassHeading object using the compassSuccess callback 42 via a CompassHeading object using the compassSuccess callback
@@ -76,9 +69,6 @@ class Ecordova.DeviceOrientation (Eo.Base) {
76 Eo.Base.constructor; 69 Eo.Base.constructor;
77 Eo.Base.destructor; 70 Eo.Base.destructor;
78 } 71 }
79 constructors {
80 .constructor;
81 }
82 events { 72 events {
83 current,success: Ecordova.DeviceOrientation.Heading*; 73 current,success: Ecordova.DeviceOrientation.Heading*;
84 watch,success: Ecordova.DeviceOrientation.Heading*; 74 watch,success: Ecordova.DeviceOrientation.Heading*;
diff --git a/src/lib/ecordova/ecordova_dialogs.eo b/src/lib/ecordova/ecordova_dialogs.eo
deleted file mode 100644
index 4f51b20b46..0000000000
--- a/src/lib/ecordova/ecordova_dialogs.eo
+++ /dev/null
@@ -1,87 +0,0 @@
1struct Ecordova_Dialogs_PromptCallback {
2 button_index: int;
3 [[The index of the pressed button. (Number) Note that the index uses
4 one-based indexing, so the value is 1, 2, 3, etc.]]
5
6 input1: const(char)*;
7 [[The text entered in the prompt dialog box.]]
8}
9
10class Ecordova.Dialogs (Eo.Base) {
11 [[Ecordova Dialogs Plugin
12 Plugin ID: org.apache.cordova.dialogs
13 http://plugins.cordova.io/#/package/org.apache.cordova.dialogs
14 ]]
15 legacy_prefix: null;
16 methods {
17 constructor {
18 [[Custom Ecordova_Dialogs constructor.
19 @.constructor
20
21 @since 2.3
22 ]]
23 }
24 alert {
25 params {
26 message: const(char)*;
27 [[Dialog message.]]
28
29 title: const(char)*;
30 [[Dialog title (Optional, defaults to 'Alert').]]
31
32 buttons: list<const(char)*>*;
33 [[Button names (Optional, defaults to OK)]]
34 }
35 }
36 confirm {
37 params {
38 message: const(char)*;
39 [[Dialog message.]]
40
41 title: const(char)*;
42 [[Dialog title (Optional, defaults to 'Confirm').]]
43
44 buttons: list<const(char)*>*;
45 [[Button names (Optional, defaults to [OK,Cancel])]]
46 }
47 }
48 prompt {
49 params {
50 message: const(char)*;
51 [[Dialog message.]]
52
53 title: const(char)*;
54 [[Dialog title (Optional, defaults to 'Prompt').]]
55
56 buttons: list<const(char)*>*;
57 [[Button names (Optional, defaults to [OK,Cancel])]]
58
59 default_text: const(char)*;
60 [[Default textbox input value (Optional, Default: empty string)]]
61 }
62 }
63 beep {
64 [[The device plays a beep sound.]]
65 params {
66 times: int; [[The number of times to repeat the beep.]]
67 }
68 }
69 }
70 implements {
71 Eo.Base.constructor;
72 Eo.Base.destructor;
73 }
74 constructors {
75 .constructor;
76 }
77 events {
78 alert;
79 [[Callback to invoke when alert dialog is dismissed.]]
80
81 confirm: int;
82 [[Callback to invoke with index of button pressed (1, 2, or 3) or when
83 the dialog is dismissed without a button press (0).]]
84
85 prompt: Ecordova_Dialogs_PromptCallback;
86 }
87}
diff --git a/src/lib/ecordova/ecordova_directoryentry.eo b/src/lib/ecordova/ecordova_directoryentry.eo
index d751d1d3a5..536d9715a3 100644
--- a/src/lib/ecordova/ecordova_directoryentry.eo
+++ b/src/lib/ecordova/ecordova_directoryentry.eo
@@ -7,27 +7,6 @@ class Ecordova.DirectoryEntry (Ecordova.Entry) {
7 [[An interface representing a directory on the file system.]] 7 [[An interface representing a directory on the file system.]]
8 legacy_prefix: null; 8 legacy_prefix: null;
9 methods { 9 methods {
10 constructor {
11 [[Custom Ecordova_DirectoryEntry constructor.
12 @.constructor
13
14 @since 2.3
15 ]]
16 params {
17 name: const(char)*;
18 [[name of the directory, excluding the path leading to it]]
19
20 path: const(char)*;
21 [[the absolute full path to the directory]]
22
23 file_system: Ecordova.FileSystem*;
24 [[filesystem on which the directory resides]]
25
26 url: const(char)*;
27 [[an alternate URL which can be used by native webview
28 controls, for example media players.]]
29 }
30 }
31 reader_create { 10 reader_create {
32 [[Creates a new DirectoryReader to read entries from this directory]] 11 [[Creates a new DirectoryReader to read entries from this directory]]
33 return: own(Ecordova.DirectoryReader*); 12 return: own(Ecordova.DirectoryReader*);
@@ -64,9 +43,6 @@ class Ecordova.DirectoryEntry (Ecordova.Entry) {
64 Eo.Base.constructor; 43 Eo.Base.constructor;
65 Eo.Base.destructor; 44 Eo.Base.destructor;
66 } 45 }
67 constructors {
68 .constructor;
69 }
70 events { 46 events {
71 directory,get: Ecordova.DirectoryEntry*; 47 directory,get: Ecordova.DirectoryEntry*;
72 remove,success; [[called with no parameters]] 48 remove,success; [[called with no parameters]]
diff --git a/src/lib/ecordova/ecordova_directoryreader.eo b/src/lib/ecordova/ecordova_directoryreader.eo
index e8c6428136..dd66e16aa6 100644
--- a/src/lib/ecordova/ecordova_directoryreader.eo
+++ b/src/lib/ecordova/ecordova_directoryreader.eo
@@ -4,14 +4,13 @@ class Ecordova.DirectoryReader (Eo.Base) {
4 [[An interface that lists the files and directories in a directory.]] 4 [[An interface that lists the files and directories in a directory.]]
5 legacy_prefix: null; 5 legacy_prefix: null;
6 methods { 6 methods {
7 constructor { 7 @property native {
8 [[Custom Ecordova_DirectoryReader constructor. 8 [[Custom Ecordova_DirectoryReader native property.
9 @.constructor
10 9
11 @since 2.3 10 @since 2.3
12 ]] 11 ]]
13 params { 12 values {
14 native: const(char)*; 13 native: const(char)* @optional;
15 } 14 }
16 } 15 }
17 entries_read { 16 entries_read {
@@ -23,7 +22,7 @@ class Ecordova.DirectoryReader (Eo.Base) {
23 Eo.Base.destructor; 22 Eo.Base.destructor;
24 } 23 }
25 constructors { 24 constructors {
26 .constructor; 25 .native;
27 } 26 }
28 events { 27 events {
29 success: const(list<Ecordova.Entry*>*); [[called with a list of entries]] 28 success: const(list<Ecordova.Entry*>*); [[called with a list of entries]]
diff --git a/src/lib/ecordova/ecordova_entry.eo b/src/lib/ecordova/ecordova_entry.eo
index 044c9231a5..72d49d3efc 100644
--- a/src/lib/ecordova/ecordova_entry.eo
+++ b/src/lib/ecordova/ecordova_entry.eo
@@ -7,33 +7,6 @@ class Ecordova.Entry (Eo.Base) {
7 [[Represents a file or directory on the local file system.]] 7 [[Represents a file or directory on the local file system.]]
8 legacy_prefix: null; 8 legacy_prefix: null;
9 methods { 9 methods {
10 constructor {
11 [[Custom Ecordova_Entry constructor.
12 @.constructor
13
14 @since 2.3
15 ]]
16 params {
17 file_is: bool;
18 [[true if Entry is a file]]
19
20 directory_is: bool;
21 [[true if Entry is a directory]]
22
23 name: const(char)*;
24 [[name of the file or directory, excluding the path leading to it]]
25
26 path: const(char)*;
27 [[the absolute full path to the file or directory]]
28
29 file_system: Ecordova.FileSystem*;
30 [[the filesystem on which this entry resides]]
31
32 url: const(char)*;
33 [[an alternate URL which can be used by native webview controls,
34 for example media players.]]
35 }
36 }
37 metadata_get { 10 metadata_get {
38 [[Look up the metadata of the entry.]] 11 [[Look up the metadata of the entry.]]
39 } 12 }
@@ -72,7 +45,6 @@ class Ecordova.Entry (Eo.Base) {
72 [[Look up the parent DirectoryEntry of this entry.]] 45 [[Look up the parent DirectoryEntry of this entry.]]
73 } 46 }
74 @property file_is { 47 @property file_is {
75 get {}
76 values { 48 values {
77 value: bool; 49 value: bool;
78 } 50 }
@@ -84,13 +56,11 @@ class Ecordova.Entry (Eo.Base) {
84 } 56 }
85 } 57 }
86 @property name { 58 @property name {
87 get {}
88 values { 59 values {
89 value: const(char)*; 60 value: const(char)*;
90 } 61 }
91 } 62 }
92 @property path { 63 @property path {
93 get {}
94 values { 64 values {
95 value: const(char)*; 65 value: const(char)*;
96 } 66 }
@@ -100,9 +70,6 @@ class Ecordova.Entry (Eo.Base) {
100 Eo.Base.constructor; 70 Eo.Base.constructor;
101 Eo.Base.destructor; 71 Eo.Base.destructor;
102 } 72 }
103 constructors {
104 .constructor;
105 }
106 events { 73 events {
107 metadata,get: const(Ecordova_Metadata)*; 74 metadata,get: const(Ecordova_Metadata)*;
108 error: Ecordova_FileError*; 75 error: Ecordova_FileError*;
diff --git a/src/lib/ecordova/ecordova_fileentry.eo b/src/lib/ecordova/ecordova_fileentry.eo
index c635c8e942..2df1d1d7b2 100644
--- a/src/lib/ecordova/ecordova_fileentry.eo
+++ b/src/lib/ecordova/ecordova_fileentry.eo
@@ -2,27 +2,6 @@ class Ecordova.FileEntry (Ecordova.Entry) {
2 [[An interface representing a file on the file system.]] 2 [[An interface representing a file on the file system.]]
3 legacy_prefix: null; 3 legacy_prefix: null;
4 methods { 4 methods {
5 constructor {
6 [[Custom Ecordova_FileEntry constructor.
7 @.constructor
8
9 @since 2.3
10 ]]
11 params {
12 name: const(char)*;
13 [[name of the file, excluding the path leading to it]]
14
15 path: const(char)*;
16 [[the absolute full path to the file]]
17
18 file_system: Ecordova.FileSystem*;
19 [[filesystem on which the file resides]]
20
21 url: const(char)*;
22 [[an alternate URL which can be used by native webview
23 controls, for example media players.]]
24 }
25 }
26 writer_create { 5 writer_create {
27 [[Creates a new FileWriter associated with the file that this 6 [[Creates a new FileWriter associated with the file that this
28 FileEntry represents.]] 7 FileEntry represents.]]
@@ -37,9 +16,6 @@ class Ecordova.FileEntry (Ecordova.Entry) {
37 Eo.Base.constructor; 16 Eo.Base.constructor;
38 Eo.Base.destructor; 17 Eo.Base.destructor;
39 } 18 }
40 constructors {
41 .constructor;
42 }
43 events { 19 events {
44 create,writer: Ecordova.FileWriter*; 20 create,writer: Ecordova.FileWriter*;
45 file: Ecordova.File*; 21 file: Ecordova.File*;
diff --git a/src/lib/ecordova/ecordova_filereader.eo b/src/lib/ecordova/ecordova_filereader.eo
index 4dcdd7a759..6d04593edd 100644
--- a/src/lib/ecordova/ecordova_filereader.eo
+++ b/src/lib/ecordova/ecordova_filereader.eo
@@ -19,13 +19,6 @@ class Ecordova.FileReader (Eo.Base) {
19 [[This class reads the device file system.]] 19 [[This class reads the device file system.]]
20 legacy_prefix: null; 20 legacy_prefix: null;
21 methods { 21 methods {
22 constructor {
23 [[Custom Ecordova_FileReader constructor.
24 @.constructor
25
26 @since 2.3
27 ]]
28 }
29 abort { 22 abort {
30 [[Abort reading file.]] 23 [[Abort reading file.]]
31 } 24 }
@@ -65,9 +58,6 @@ class Ecordova.FileReader (Eo.Base) {
65 Eo.Base.constructor; 58 Eo.Base.constructor;
66 Eo.Base.destructor; 59 Eo.Base.destructor;
67 } 60 }
68 constructors {
69 .constructor;
70 }
71 events { 61 events {
72 on,load,start: const(Ecordova_ProgressEvent)*; 62 on,load,start: const(Ecordova_ProgressEvent)*;
73 [[When read starts]] 63 [[When read starts]]
diff --git a/src/lib/ecordova/ecordova_filetransfer.eo b/src/lib/ecordova/ecordova_filetransfer.eo
index 19faa3d298..7bec2800eb 100644
--- a/src/lib/ecordova/ecordova_filetransfer.eo
+++ b/src/lib/ecordova/ecordova_filetransfer.eo
@@ -74,13 +74,6 @@ class Ecordova.FileTransfer (Eo.Base) {
74 ]] 74 ]]
75 legacy_prefix: null; 75 legacy_prefix: null;
76 methods { 76 methods {
77 constructor {
78 [[Custom Ecordova_FileTransfer constructor.
79 @.constructor
80
81 @since 2.3
82 ]]
83 }
84 upload { 77 upload {
85 [[sends a file to a server.]] 78 [[sends a file to a server.]]
86 params { 79 params {
@@ -134,9 +127,6 @@ class Ecordova.FileTransfer (Eo.Base) {
134 Eo.Base.constructor; 127 Eo.Base.constructor;
135 Eo.Base.destructor; 128 Eo.Base.destructor;
136 } 129 }
137 constructors {
138 .constructor;
139 }
140 events { 130 events {
141 upload,success: const(Ecordova_FileTransfer_UploadResult)*; 131 upload,success: const(Ecordova_FileTransfer_UploadResult)*;
142 [[A callback that is passed a FileUploadResult object.]] 132 [[A callback that is passed a FileUploadResult object.]]
diff --git a/src/lib/ecordova/ecordova_filewriter.eo b/src/lib/ecordova/ecordova_filewriter.eo
index 6a3f9a1a5c..c4dac2b578 100644
--- a/src/lib/ecordova/ecordova_filewriter.eo
+++ b/src/lib/ecordova/ecordova_filewriter.eo
@@ -23,9 +23,9 @@ class Ecordova.FileWriter (Eo.Base) {
23 [[This class writes to the device file system.]] 23 [[This class writes to the device file system.]]
24 legacy_prefix: null; 24 legacy_prefix: null;
25 methods { 25 methods {
26 constructor { 26 file_set {
27 [[Custom Ecordova_FileWriter constructor. 27 [[Custom Ecordova_FileWriter file_set.
28 @.constructor 28 @.file_set
29 29
30 @since 2.3 30 @since 2.3
31 ]] 31 ]]
@@ -87,7 +87,7 @@ class Ecordova.FileWriter (Eo.Base) {
87 Eo.Base.destructor; 87 Eo.Base.destructor;
88 } 88 }
89 constructors { 89 constructors {
90 .constructor; 90 .file_set;
91 } 91 }
92 events { 92 events {
93 on,write,start: const(ProgressEvent)*; 93 on,write,start: const(ProgressEvent)*;
diff --git a/src/lib/ecordova/ecordova_geolocation.eo b/src/lib/ecordova/ecordova_geolocation.eo
index 1339149d60..c50658f9bb 100644
--- a/src/lib/ecordova/ecordova_geolocation.eo
+++ b/src/lib/ecordova/ecordova_geolocation.eo
@@ -96,13 +96,6 @@ class Ecordova.Geolocation (Eo.Base) {
96 ]] 96 ]]
97 legacy_prefix: null; 97 legacy_prefix: null;
98 methods { 98 methods {
99 constructor {
100 [[Custom Ecordova_Geolocation constructor.
101 @.constructor
102
103 @since 2.3
104 ]]
105 }
106 current_position_get { 99 current_position_get {
107 [[Returns the device's current position to the geolocationSuccess 100 [[Returns the device's current position to the geolocationSuccess
108 callback with a Position object as the parameter. If there is an 101 callback with a Position object as the parameter. If there is an
@@ -141,9 +134,6 @@ class Ecordova.Geolocation (Eo.Base) {
141 Eo.Base.constructor; 134 Eo.Base.constructor;
142 Eo.Base.destructor; 135 Eo.Base.destructor;
143 } 136 }
144 constructors {
145 .constructor;
146 }
147 events { 137 events {
148 current,success: Ecordova_Geolocation_Position*; 138 current,success: Ecordova_Geolocation_Position*;
149 watch,success: Ecordova_Geolocation_Position*; 139 watch,success: Ecordova_Geolocation_Position*;
diff --git a/src/lib/ecordova/ecordova_globalization.eo b/src/lib/ecordova/ecordova_globalization.eo
index 6c3925ff78..128ccdf43d 100644
--- a/src/lib/ecordova/ecordova_globalization.eo
+++ b/src/lib/ecordova/ecordova_globalization.eo
@@ -190,13 +190,6 @@ class Ecordova.Globalization (Eo.Base) {
190 ]] 190 ]]
191 legacy_prefix: null; 191 legacy_prefix: null;
192 methods { 192 methods {
193 constructor {
194 [[Custom Ecordova_Globalization constructor.
195 @.constructor
196
197 @since 2.3
198 ]]
199 }
200 preferred_language_get { 193 preferred_language_get {
201 [[Get the BCP 47 language tag for the client's current language. 194 [[Get the BCP 47 language tag for the client's current language.
202 195
@@ -369,9 +362,6 @@ class Ecordova.Globalization (Eo.Base) {
369 Eo.Base.constructor; 362 Eo.Base.constructor;
370 Eo.Base.destructor; 363 Eo.Base.destructor;
371 } 364 }
372 constructors {
373 .constructor;
374 }
375 events { 365 events {
376 preferred,language,success: const(Ecordova_Globalization_Language)*; 366 preferred,language,success: const(Ecordova_Globalization_Language)*;
377 locale,name,success: const(Ecordova_Globalization_Locale)*; 367 locale,name,success: const(Ecordova_Globalization_Locale)*;
diff --git a/src/lib/ecordova/ecordova_media.eo b/src/lib/ecordova/ecordova_media.eo
index e64b2b3d8a..ee6a011d07 100644
--- a/src/lib/ecordova/ecordova_media.eo
+++ b/src/lib/ecordova/ecordova_media.eo
@@ -26,14 +26,14 @@ class Ecordova.Media (Eo.Base) {
26 ]] 26 ]]
27 legacy_prefix: null; 27 legacy_prefix: null;
28 methods { 28 methods {
29 constructor { 29 uri_set {
30 [[Custom Ecordova_Media constructor. 30 [[Custom Ecordova_Media constructor.
31 @.constructor 31 @.uri_set
32 32
33 @since 2.3 33 @since 1.17
34 ]] 34 ]]
35 params { 35 params {
36 src: const(char)*; [[A URI containing the audio content.]] 36 uri: const(char)*; [[A URI containing the audio content.]]
37 } 37 }
38 } 38 }
39 current_position_get { 39 current_position_get {
@@ -89,7 +89,7 @@ class Ecordova.Media (Eo.Base) {
89 Eo.Base.destructor; 89 Eo.Base.destructor;
90 } 90 }
91 constructors { 91 constructors {
92 .constructor; 92 .uri_set;
93 } 93 }
94 events { 94 events {
95 media,position: int; 95 media,position: int;
diff --git a/src/lib/ecordova/ecordova_mediafile.eo b/src/lib/ecordova/ecordova_mediafile.eo
index b1ebd52eb5..e74dcf930b 100644
--- a/src/lib/ecordova/ecordova_mediafile.eo
+++ b/src/lib/ecordova/ecordova_mediafile.eo
@@ -24,20 +24,6 @@ class Ecordova.MediaFile (Ecordova.File) {
24 [[Represents a single media file.]] 24 [[Represents a single media file.]]
25 legacy_prefix: null; 25 legacy_prefix: null;
26 methods { 26 methods {
27 constructor {
28 [[Custom Ecordova_MediaFile constructor.
29 @.constructor
30
31 @since 2.3
32 ]]
33 params {
34 name: const(char)*; [[name of the file, without path information]]
35 url: const(char)*; [[the full path of the file, including the name]]
36 type: const(char)*; [[mime type]]
37 last_modified_date: time; [[last modified date]]
38 size: long; [[size of the file in bytes]]
39 }
40 }
41 format_data_get { 27 format_data_get {
42 [[Retrieves format information about the media capture file. 28 [[Retrieves format information about the media capture file.
43 29
@@ -52,9 +38,6 @@ class Ecordova.MediaFile (Ecordova.File) {
52 Eo.Base.constructor; 38 Eo.Base.constructor;
53 Eo.Base.destructor; 39 Eo.Base.destructor;
54 } 40 }
55 constructors {
56 .constructor;
57 }
58 events { 41 events {
59 success: const(Ecordova_MediaFileData)*; 42 success: const(Ecordova_MediaFileData)*;
60 error: const(Ecordova.Capture.Error)*; 43 error: const(Ecordova.Capture.Error)*;
diff --git a/src/lib/ecordova/ecordova_networkinformation.eo b/src/lib/ecordova/ecordova_networkinformation.eo
index bff5810354..5700244be5 100644
--- a/src/lib/ecordova/ecordova_networkinformation.eo
+++ b/src/lib/ecordova/ecordova_networkinformation.eo
@@ -16,13 +16,6 @@ class Ecordova.NetworkInformation (Eo.Base) {
16 ]] 16 ]]
17 legacy_prefix: null; 17 legacy_prefix: null;
18 methods { 18 methods {
19 constructor {
20 [[Custom Ecordova_NetworkInformation constructor.
21 @.constructor
22
23 @since 2.3
24 ]]
25 }
26 @property type { 19 @property type {
27 [[This property offers a fast way to determine the device's 20 [[This property offers a fast way to determine the device's
28 network connection state, and type of connection.]] 21 network connection state, and type of connection.]]
@@ -36,9 +29,6 @@ class Ecordova.NetworkInformation (Eo.Base) {
36 Eo.Base.constructor; 29 Eo.Base.constructor;
37 Eo.Base.destructor; 30 Eo.Base.destructor;
38 } 31 }
39 constructors {
40 .constructor;
41 }
42 events { 32 events {
43 offline; 33 offline;
44 [[The event fires when an application goes offline, and the device is 34 [[The event fires when an application goes offline, and the device is
diff --git a/src/lib/ecordova/ecordova_splashscreen.eo b/src/lib/ecordova/ecordova_splashscreen.eo
deleted file mode 100644
index 88346ad04c..0000000000
--- a/src/lib/ecordova/ecordova_splashscreen.eo
+++ /dev/null
@@ -1,29 +0,0 @@
1class Ecordova.Splashscreen (Eo.Base) {
2 [[Ecordova Splashscreen Plugin
3 Plugin ID: org.apache.cordova.splashscreen
4 http://plugins.cordova.io/#/package/org.apache.cordova.splashscreen
5 ]]
6 legacy_prefix: null;
7 methods {
8 constructor {
9 [[Custom Ecordova_Splashscreen constructor.
10 @.constructor
11
12 @since 2.3
13 ]]
14 }
15 show {
16 [[Displays the splash screen.]]
17 }
18 hide {
19 [[Dismiss the splash screen.]]
20 }
21 }
22 implements {
23 Eo.Base.constructor;
24 Eo.Base.destructor;
25 }
26 constructors {
27 .constructor;
28 }
29}
diff --git a/src/lib/ecordova/ecordova_systeminfo.eo b/src/lib/ecordova/ecordova_systeminfo.eo
index 2405400396..58d3e52716 100644
--- a/src/lib/ecordova/ecordova_systeminfo.eo
+++ b/src/lib/ecordova/ecordova_systeminfo.eo
@@ -3,22 +3,10 @@ class Ecordova.SystemInfo (Eo.Base) {
3 wrt-plugins-tizen SystemInfo.h 3 wrt-plugins-tizen SystemInfo.h
4 ]] 4 ]]
5 legacy_prefix: null; 5 legacy_prefix: null;
6 methods {
7 constructor {
8 [[Custom Ecordova_SystemInfo constructor.
9 @.constructor
10
11 @since 2.3
12 ]]
13 }
14 }
15 implements { 6 implements {
16 Eo.Base.constructor; 7 Eo.Base.constructor;
17 Eo.Base.destructor; 8 Eo.Base.destructor;
18 } 9 }
19 constructors {
20 .constructor;
21 }
22 events { 10 events {
23 battery,changed; 11 battery,changed;
24 [[This event fires when the percentage of battery charge changes by at 12 [[This event fires when the percentage of battery charge changes by at
diff --git a/src/lib/ecordova/ecordova_vibration.eo b/src/lib/ecordova/ecordova_vibration.eo
index 498791024f..5e2f43761a 100644
--- a/src/lib/ecordova/ecordova_vibration.eo
+++ b/src/lib/ecordova/ecordova_vibration.eo
@@ -5,13 +5,6 @@ class Ecordova.Vibration (Eo.Base) {
5 ]] 5 ]]
6 legacy_prefix: null; 6 legacy_prefix: null;
7 methods { 7 methods {
8 constructor {
9 [[Custom Ecordova_Vibration constructor.
10 @.constructor
11
12 @since 2.3
13 ]]
14 }
15 vibrate { 8 vibrate {
16 [[This function has three different functionalities based on 9 [[This function has three different functionalities based on
17 parameters passed to it.]] 10 parameters passed to it.]]
@@ -24,7 +17,4 @@ class Ecordova.Vibration (Eo.Base) {
24 Eo.Base.constructor; 17 Eo.Base.constructor;
25 Eo.Base.destructor; 18 Eo.Base.destructor;
26 } 19 }
27 constructors {
28 .constructor;
29 }
30} 20}
diff --git a/src/modules/ecordova/linux/ecordova_console.c b/src/modules/ecordova/linux/ecordova_console.c
index 53ffed0d75..1baa282302 100644
--- a/src/modules/ecordova/linux/ecordova_console.c
+++ b/src/modules/ecordova/linux/ecordova_console.c
@@ -7,7 +7,6 @@
7 7
8#include "ecordova_console_private.h" 8#include "ecordova_console_private.h"
9 9
10#include <stdbool.h>
11#include <stdint.h> 10#include <stdint.h>
12#include <stdlib.h> 11#include <stdlib.h>
13 12
@@ -59,13 +58,6 @@ _ecordova_console_eo_base_constructor(Eo *obj, Ecordova_Console_Data *pd)
59} 58}
60 59
61static void 60static void
62_ecordova_console_constructor(Eo *obj EINA_UNUSED,
63 Ecordova_Console_Data *pd EINA_UNUSED)
64{
65 DBG("(%p)", obj);
66}
67
68static void
69_ecordova_console_eo_base_destructor(Eo *obj, 61_ecordova_console_eo_base_destructor(Eo *obj,
70 Ecordova_Console_Data *pd EINA_UNUSED) 62 Ecordova_Console_Data *pd EINA_UNUSED)
71{ 63{
diff --git a/src/modules/ecordova/linux/ecordova_directoryentry.c b/src/modules/ecordova/linux/ecordova_directoryentry.c
index e1bd724e59..dfa4e0d876 100644
--- a/src/modules/ecordova/linux/ecordova_directoryentry.c
+++ b/src/modules/ecordova/linux/ecordova_directoryentry.c
@@ -46,7 +46,7 @@ extern int _ecordova_log_dom;
46#define MY_CLASS_NAME "Ecordova_DirectoryEntry" 46#define MY_CLASS_NAME "Ecordova_DirectoryEntry"
47 47
48static void _remove_notify(Eo *, void *); 48static void _remove_notify(Eo *, void *);
49static bool _is_absolute(const char *); 49static Eina_Bool _is_absolute(const char *);
50static void _directory_get(Eo *, void *); 50static void _directory_get(Eo *, void *);
51static void _file_get(Eo *, void *); 51static void _file_get(Eo *, void *);
52static void _eio_directory_get_cb(void *, Eio_File *, const Eina_Stat *); 52static void _eio_directory_get_cb(void *, Eio_File *, const Eina_Stat *);
@@ -65,24 +65,9 @@ _ecordova_directoryentry_eo_base_constructor(Eo *obj,
65 65
66 pd->obj = obj; 66 pd->obj = obj;
67 67
68 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 68 eo_do_super(obj, MY_CLASS, obj = eo_constructor());
69} 69 ecordova_entry_file_is_set(EINA_FALSE);
70 70 return obj;
71static void
72_ecordova_directoryentry_constructor(Eo *obj,
73 Ecordova_DirectoryEntry_Data *pd EINA_UNUSED,
74 const char *name,
75 const char *path,
76 Ecordova_FileSystem *file_system,
77 const char *url)
78{
79 DBG("(%p)", obj);
80 eo_do_super(obj, MY_CLASS, ecordova_entry_constructor(EINA_FALSE,
81 EINA_TRUE,
82 name,
83 path,
84 file_system,
85 url));
86} 71}
87 72
88static void 73static void
@@ -102,7 +87,7 @@ _ecordova_directoryentry_reader_create(Eo *obj,
102 EINA_SAFETY_ON_NULL_RETURN_VAL(super, NULL); 87 EINA_SAFETY_ON_NULL_RETURN_VAL(super, NULL);
103 88
104 return eo_add(ECORDOVA_DIRECTORYREADER_CLASS, NULL, 89 return eo_add(ECORDOVA_DIRECTORYREADER_CLASS, NULL,
105 ecordova_directoryreader_constructor(super->native)); 90 ecordova_directoryreader_native_set(super->native));
106} 91}
107 92
108static void 93static void
@@ -147,7 +132,8 @@ _eio_directory_get_cb(void *user_data,
147 Eio_Operation_Data *data = user_data; 132 Eio_Operation_Data *data = user_data;
148 DBG("(%p)", data->pd->obj); 133 DBG("(%p)", data->pd->obj);
149 Ecordova_DirectoryEntry *directory = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, NULL, 134 Ecordova_DirectoryEntry *directory = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, NULL,
150 ecordova_directoryentry_constructor(data->name, data->path, NULL, data->native)); // TODO: filesystem? 135 ecordova_entry_name_set(data->name),
136 ecordova_entry_path_set(data->path));
151 137
152 data->success_cb(data->pd->obj, directory); 138 data->success_cb(data->pd->obj, directory);
153 _data_free(data); 139 _data_free(data);
@@ -160,7 +146,8 @@ _eio_file_get_cb(void *user_data,
160{ 146{
161 Eio_Operation_Data *data = user_data; 147 Eio_Operation_Data *data = user_data;
162 Ecordova_FileEntry *file = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL, 148 Ecordova_FileEntry *file = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL,
163 ecordova_fileentry_constructor(data->name, data->path, NULL, data->native)); // TODO: filesystem? 149 ecordova_entry_name_set(data->name),
150 ecordova_entry_path_set(data->path));
164 151
165 data->success_cb(data->pd->obj, file); 152 data->success_cb(data->pd->obj, file);
166 _data_free(data); 153 _data_free(data);
@@ -225,7 +212,8 @@ _eio_create_file_cb(void *user_data,
225 fclose(fd); 212 fclose(fd);
226 213
227 Ecordova_FileEntry *file = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL, 214 Ecordova_FileEntry *file = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL,
228 ecordova_fileentry_constructor(data->name, data->path, NULL, data->native)); // TODO: filesystem? 215 ecordova_entry_name_set(data->name),
216 ecordova_entry_path_set(data->path));
229 data->success_cb(data->pd->obj, file); 217 data->success_cb(data->pd->obj, file);
230 _data_free(data); 218 _data_free(data);
231} 219}
@@ -236,7 +224,8 @@ _eio_mkdir_cb(void *user_data, Eio_File *handler EINA_UNUSED)
236 Eio_Operation_Data *data = user_data; 224 Eio_Operation_Data *data = user_data;
237 DBG("(%p)", data->pd->obj); 225 DBG("(%p)", data->pd->obj);
238 Ecordova_DirectoryEntry *directory = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, NULL, 226 Ecordova_DirectoryEntry *directory = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, NULL,
239 ecordova_directoryentry_constructor(data->name, data->path, NULL, data->native)); // TODO: filesystem? 227 ecordova_entry_name_set(data->name),
228 ecordova_entry_path_set(data->path));
240 data->success_cb(data->pd->obj, directory); 229 data->success_cb(data->pd->obj, directory);
241 _data_free(data); 230 _data_free(data);
242} 231}
@@ -267,7 +256,7 @@ _ecordova_directoryentry_recursively_remove(Eo *obj,
267 Ecordova_Entry_Data *super = eo_data_scope_get(obj, ECORDOVA_ENTRY_CLASS); 256 Ecordova_Entry_Data *super = eo_data_scope_get(obj, ECORDOVA_ENTRY_CLASS);
268 EINA_SAFETY_ON_NULL_RETURN(super); 257 EINA_SAFETY_ON_NULL_RETURN(super);
269 258
270 _entry_remove(super, _remove_notify, _error_notify, true); 259 _entry_remove(super, _remove_notify, _error_notify, EINA_TRUE);
271} 260}
272 261
273static void 262static void
@@ -310,7 +299,7 @@ _remove_notify(Eo *obj, void *data EINA_UNUSED)
310 eo_event_callback_call(ECORDOVA_DIRECTORYENTRY_EVENT_REMOVE_SUCCESS, NULL)); 299 eo_event_callback_call(ECORDOVA_DIRECTORYENTRY_EVENT_REMOVE_SUCCESS, NULL));
311} 300}
312 301
313static bool 302static Eina_Bool
314_is_absolute(const char *path) 303_is_absolute(const char *path)
315{ 304{
316 // TODO: not multiplatform 305 // TODO: not multiplatform
diff --git a/src/modules/ecordova/linux/ecordova_directoryreader.c b/src/modules/ecordova/linux/ecordova_directoryreader.c
index 7164887751..cc781a3364 100644
--- a/src/modules/ecordova/linux/ecordova_directoryreader.c
+++ b/src/modules/ecordova/linux/ecordova_directoryreader.c
@@ -70,15 +70,20 @@ _ecordova_directoryreader_eo_base_constructor(Eo *obj,
70} 70}
71 71
72static void 72static void
73_ecordova_directoryreader_constructor(Eo *obj, 73_ecordova_directoryreader_native_set(Eo *obj,
74 Ecordova_DirectoryReader_Data *pd, 74 Ecordova_DirectoryReader_Data *pd,
75 const char *native) 75 const char *native)
76{ 76{
77 DBG("(%p) url=%s", obj, native); 77 DBG("(%p) url=%s", obj, native);
78 fprintf(stderr, "%s:%s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
79 pd->native = strdup(native); 78 pd->native = strdup(native);
80} 79}
81 80
81static const char*
82_ecordova_directoryreader_native_get(Eo *obj EINA_UNUSED, Ecordova_DirectoryReader_Data *pd)
83{
84 return pd->native;
85}
86
82static void 87static void
83_ecordova_directoryreader_eo_base_destructor(Eo *obj, 88_ecordova_directoryreader_eo_base_destructor(Eo *obj,
84 Ecordova_DirectoryReader_Data *pd) 89 Ecordova_DirectoryReader_Data *pd)
@@ -149,13 +154,15 @@ _main_cb(void *user_data,
149 case EINA_FILE_DIR: 154 case EINA_FILE_DIR:
150 { 155 {
151 entry = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, NULL, 156 entry = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, NULL,
152 ecordova_directoryentry_constructor(name, path, NULL, info->path)); // TODO: filesystem? 157 ecordova_entry_name_set(name),
158 ecordova_entry_path_set(path));
153 break; 159 break;
154 } 160 }
155 case EINA_FILE_REG: 161 case EINA_FILE_REG:
156 { 162 {
157 entry = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL, 163 entry = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL,
158 ecordova_fileentry_constructor(name, path, NULL, info->path)); // TODO: filesystem? 164 ecordova_entry_name_set(name),
165 ecordova_entry_path_set(path));
159 break; 166 break;
160 } 167 }
161 // TODO: case EINA_FILE_LNK ? 168 // TODO: case EINA_FILE_LNK ?
diff --git a/src/modules/ecordova/linux/ecordova_entry.c b/src/modules/ecordova/linux/ecordova_entry.c
index 0d2e31c7ee..b405efc235 100644
--- a/src/modules/ecordova/linux/ecordova_entry.c
+++ b/src/modules/ecordova/linux/ecordova_entry.c
@@ -52,12 +52,14 @@ static void _remove_notify(Eo *, void *);
52static Eina_Bool _eio_remove_non_recursively_filter_cb(void *, Eio_File *, const Eina_File_Direct_Info *); 52static Eina_Bool _eio_remove_non_recursively_filter_cb(void *, Eio_File *, const Eina_File_Direct_Info *);
53static void _parent_get_cb(void *, Eio_File *, const Eina_Stat *); 53static void _parent_get_cb(void *, Eio_File *, const Eina_Stat *);
54static void _parent_get_notify(Eo *, void *); 54static void _parent_get_notify(Eo *, void *);
55static void _sync_native(Ecordova_Entry_Data* pd);
55 56
56static Eo_Base * 57static Eo_Base *
57_ecordova_entry_eo_base_constructor(Eo *obj, Ecordova_Entry_Data *pd) 58_ecordova_entry_eo_base_constructor(Eo *obj, Ecordova_Entry_Data *pd)
58{ 59{
59 DBG("(%p)", obj); 60 DBG("(%p)", obj);
60 61
62 pd->is_file = EINA_TRUE;
61 pd->obj = obj; 63 pd->obj = obj;
62 pd->name = NULL; 64 pd->name = NULL;
63 pd->path = NULL; 65 pd->path = NULL;
@@ -69,30 +71,6 @@ _ecordova_entry_eo_base_constructor(Eo *obj, Ecordova_Entry_Data *pd)
69} 71}
70 72
71static void 73static void
72_ecordova_entry_constructor(Eo *obj,
73 Ecordova_Entry_Data *pd,
74 Eina_Bool file_is,
75 Eina_Bool directory_is,
76 const char *name,
77 const char *path,
78 Ecordova_FileSystem *file_system,
79 const char *url)
80{
81 EINA_SAFETY_ON_NULL_RETURN(name);
82 EINA_SAFETY_ON_NULL_RETURN(path);
83 //EINA_SAFETY_ON_NULL_RETURN(file_system);
84 EINA_SAFETY_ON_NULL_RETURN(url);
85 DBG("(%p) name=%s, path=%s, url=%s", obj, name, path, url);
86
87 pd->is_file = file_is;
88 pd->is_directory = directory_is;
89 pd->name = strdup(name);
90 pd->path = strdup(path);
91 pd->file_system = eo_ref(file_system);
92 pd->native = strdup(url);
93}
94
95static void
96_ecordova_entry_eo_base_destructor(Eo *obj, Ecordova_Entry_Data *pd) 74_ecordova_entry_eo_base_destructor(Eo *obj, Ecordova_Entry_Data *pd)
97{ 75{
98 DBG("(%p)", obj); 76 DBG("(%p)", obj);
@@ -145,7 +123,6 @@ _ecordova_entry_move(Eo *obj EINA_UNUSED,
145 data->path = strdup(dest_dir->native); 123 data->path = strdup(dest_dir->native);
146 124
147 // TODO: file_system? 125 // TODO: file_system?
148
149 size_t len = strlen(data->path) + 1 + strlen(data->name) + 1; 126 size_t len = strlen(data->path) + 1 + strlen(data->name) + 1;
150 data->native = malloc(len); 127 data->native = malloc(len);
151 EINA_SAFETY_ON_NULL_GOTO(data->native, on_error); 128 EINA_SAFETY_ON_NULL_GOTO(data->native, on_error);
@@ -231,14 +208,14 @@ static void
231_ecordova_entry_remove(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd) 208_ecordova_entry_remove(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd)
232{ 209{
233 DBG("(%p)", obj); 210 DBG("(%p)", obj);
234 _entry_remove(pd, _remove_notify, _error_notify, false); 211 _entry_remove(pd, _remove_notify, _error_notify, EINA_FALSE);
235} 212}
236 213
237void 214void
238_entry_remove(Ecordova_Entry_Data *pd, 215_entry_remove(Ecordova_Entry_Data *pd,
239 Ecordova_Entry_Success_Callback success_cb, 216 Ecordova_Entry_Success_Callback success_cb,
240 Ecordova_Entry_Error_Callback error_cb, 217 Ecordova_Entry_Error_Callback error_cb,
241 bool recursively) 218 Eina_Bool recursively)
242{ 219{
243 DBG("(%p)", pd->obj); 220 DBG("(%p)", pd->obj);
244 221
@@ -304,10 +281,8 @@ _parent_get_notify(Eo *obj, void *data)
304 Ecordova_DirectoryEntry *parent = 281 Ecordova_DirectoryEntry *parent =
305 eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, 282 eo_add(ECORDOVA_DIRECTORYENTRY_CLASS,
306 NULL, 283 NULL,
307 ecordova_directoryentry_constructor(name, 284 ecordova_entry_name_set(name),
308 path, 285 ecordova_entry_path_set(path));
309 NULL, // TODO: filesystem ?
310 url));
311 free(name); 286 free(name);
312 free(path); 287 free(path);
313 free(url); 288 free(url);
@@ -325,7 +300,31 @@ _ecordova_entry_file_is_get(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd)
325static Eina_Bool 300static Eina_Bool
326_ecordova_entry_directory_is_get(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd) 301_ecordova_entry_directory_is_get(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd)
327{ 302{
328 return pd->is_directory; 303 return !pd->is_file;
304}
305
306static void
307_ecordova_entry_file_is_set(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd, Eina_Bool is_file)
308{
309 pd->is_file = is_file;
310}
311
312static void
313_ecordova_entry_directory_is_set(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd, Eina_Bool is_dir)
314{
315 pd->is_file = !is_dir;
316}
317
318static void
319_ecordova_entry_name_set(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd, const char* name)
320{
321 if(pd->name)
322 free(pd->name);
323 pd->name = strdup(name);
324 if(pd->path)
325 {
326 _sync_native(pd);
327 }
329} 328}
330 329
331static const char * 330static const char *
@@ -340,6 +339,18 @@ _ecordova_entry_path_get(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd)
340 return pd->path; 339 return pd->path;
341} 340}
342 341
342static void
343_ecordova_entry_path_set(Eo *obj EINA_UNUSED, Ecordova_Entry_Data *pd, const char* path)
344{
345 if(pd->path)
346 free(pd->path);
347 pd->path = strdup(path);
348 if(pd->name)
349 {
350 _sync_native(pd);
351 }
352}
353
343void 354void
344_metadata_get(Ecordova_Entry_Data *pd, 355_metadata_get(Ecordova_Entry_Data *pd,
345 Ecordova_Entry_Success_Callback success_cb, 356 Ecordova_Entry_Success_Callback success_cb,
@@ -428,17 +439,13 @@ _eio_copied_cb(void *user_data, Eio_File *handler EINA_UNUSED)
428 if (data->pd->is_file) 439 if (data->pd->is_file)
429 entry = eo_add(ECORDOVA_FILEENTRY_CLASS, 440 entry = eo_add(ECORDOVA_FILEENTRY_CLASS,
430 NULL, 441 NULL,
431 ecordova_fileentry_constructor(data->name, 442 ecordova_entry_name_set(data->name),
432 data->path, 443 ecordova_entry_path_set(data->path));
433 data->pd->file_system,
434 data->native));
435 else 444 else
436 entry = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS, 445 entry = eo_add(ECORDOVA_DIRECTORYENTRY_CLASS,
437 NULL, 446 NULL,
438 ecordova_directoryentry_constructor(data->name, 447 ecordova_entry_name_set(data->name),
439 data->path, 448 ecordova_entry_path_set(data->path));
440 data->pd->file_system,
441 data->native));
442 449
443 data->success_cb(data->pd->obj, entry); 450 data->success_cb(data->pd->obj, entry);
444 451
@@ -537,6 +544,16 @@ _translate_errno(int error)
537 return -1; 544 return -1;
538} 545}
539 546
547void _sync_native(Ecordova_Entry_Data* pd)
548{
549 if(pd->native)
550 free(pd->native);
551 size_t len = strlen(pd->path) + 1 + strlen(pd->name) + 1;
552 pd->native = malloc(len);
553 if(pd->native)
554 snprintf(pd->native, len, "%s/%s", pd->path, pd->name);
555}
556
540#include "undefs.h" 557#include "undefs.h"
541 558
542#define ecordova_entry_class_get ecordova_entry_impl_class_get 559#define ecordova_entry_class_get ecordova_entry_impl_class_get
diff --git a/src/modules/ecordova/linux/ecordova_entry_private.h b/src/modules/ecordova/linux/ecordova_entry_private.h
index a50f250f81..c9a7117cac 100644
--- a/src/modules/ecordova/linux/ecordova_entry_private.h
+++ b/src/modules/ecordova/linux/ecordova_entry_private.h
@@ -5,8 +5,6 @@
5 5
6#include <Eio.h> 6#include <Eio.h>
7 7
8#include <stdbool.h>
9
10typedef struct _Ecordova_Entry_Data Ecordova_Entry_Data; 8typedef struct _Ecordova_Entry_Data Ecordova_Entry_Data;
11 9
12/** 10/**
@@ -16,7 +14,6 @@ struct _Ecordova_Entry_Data
16{ 14{
17 Eo *obj; 15 Eo *obj;
18 Eina_Bool is_file; 16 Eina_Bool is_file;
19 Eina_Bool is_directory;
20 char *name; 17 char *name;
21 char *path; 18 char *path;
22 Ecordova_FileSystem *file_system; 19 Ecordova_FileSystem *file_system;
@@ -42,7 +39,7 @@ typedef struct
42Eio_Operation_Data *_data_new(Ecordova_Entry_Data *, Ecordova_Entry_Success_Callback, Ecordova_Entry_Error_Callback); 39Eio_Operation_Data *_data_new(Ecordova_Entry_Data *, Ecordova_Entry_Success_Callback, Ecordova_Entry_Error_Callback);
43void _data_free(Eio_Operation_Data *); 40void _data_free(Eio_Operation_Data *);
44void _metadata_get(Ecordova_Entry_Data *, Ecordova_Entry_Success_Callback, Ecordova_Entry_Error_Callback); 41void _metadata_get(Ecordova_Entry_Data *, Ecordova_Entry_Success_Callback, Ecordova_Entry_Error_Callback);
45void _entry_remove(Ecordova_Entry_Data *, Ecordova_Entry_Success_Callback, Ecordova_Entry_Error_Callback, bool); 42void _entry_remove(Ecordova_Entry_Data *, Ecordova_Entry_Success_Callback, Ecordova_Entry_Error_Callback, Eina_Bool);
46void _error_notify(Eo *, int); 43void _error_notify(Eo *, int);
47void _eio_error_cb(void *, Eio_File *, int); 44void _eio_error_cb(void *, Eio_File *, int);
48void _eio_removed_cb(void *, Eio_File *); 45void _eio_removed_cb(void *, Eio_File *);
diff --git a/src/modules/ecordova/linux/ecordova_fileentry.c b/src/modules/ecordova/linux/ecordova_fileentry.c
index 273c28dac3..7ab349ee40 100644
--- a/src/modules/ecordova/linux/ecordova_fileentry.c
+++ b/src/modules/ecordova/linux/ecordova_fileentry.c
@@ -49,24 +49,9 @@ _ecordova_fileentry_eo_base_constructor(Eo *obj, Ecordova_FileEntry_Data *pd)
49 49
50 pd->obj = obj; 50 pd->obj = obj;
51 51
52 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 52 eo_do_super(obj, MY_CLASS, obj = eo_constructor());
53} 53 ecordova_entry_file_is_set(EINA_TRUE);
54 54 return obj;
55static void
56_ecordova_fileentry_constructor(Eo *obj,
57 Ecordova_FileEntry_Data *pd EINA_UNUSED,
58 const char *name,
59 const char *path,
60 Ecordova_FileSystem *file_system,
61 const char *url)
62{
63 DBG("(%p)", obj);
64 eo_do_super(obj, MY_CLASS, ecordova_entry_constructor(EINA_TRUE,
65 EINA_FALSE,
66 name,
67 path,
68 file_system,
69 url));
70} 55}
71 56
72static void 57static void
@@ -128,7 +113,7 @@ _writer_create(Eo *obj, void *data)
128 const Ecordova_Metadata *metadata = data; 113 const Ecordova_Metadata *metadata = data;
129 Ecordova_File *file = _create_file(obj, metadata); 114 Ecordova_File *file = _create_file(obj, metadata);
130 Ecordova_FileWriter *writer = eo_add(ECORDOVA_FILEWRITER_CLASS, NULL, 115 Ecordova_FileWriter *writer = eo_add(ECORDOVA_FILEWRITER_CLASS, NULL,
131 ecordova_filewriter_constructor(file)); 116 ecordova_filewriter_file_set(file));
132 117
133 eo_do(obj, 118 eo_do(obj,
134 eo_event_callback_call(ECORDOVA_FILEENTRY_EVENT_CREATE_WRITER, writer)); 119 eo_event_callback_call(ECORDOVA_FILEENTRY_EVENT_CREATE_WRITER, writer));
diff --git a/src/modules/ecordova/linux/ecordova_filereader.c b/src/modules/ecordova/linux/ecordova_filereader.c
index 70f26af4ff..5407ef6bf4 100644
--- a/src/modules/ecordova/linux/ecordova_filereader.c
+++ b/src/modules/ecordova/linux/ecordova_filereader.c
@@ -7,6 +7,10 @@
7 7
8#include <Eio.h> 8#include <Eio.h>
9 9
10#ifdef EAPI
11#undef EAPI
12#endif
13
10#ifdef _WIN32 14#ifdef _WIN32
11# ifdef DLL_EXPORT 15# ifdef DLL_EXPORT
12# define EAPI __declspec(dllexport) 16# define EAPI __declspec(dllexport)
@@ -58,14 +62,9 @@ _ecordova_filereader_eo_base_constructor(Eo *obj, Ecordova_FileReader_Data *pd)
58 pd->offset = 0; 62 pd->offset = 0;
59 pd->length = 0; 63 pd->length = 0;
60 64
61 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 65 eo_do_super(obj, MY_CLASS, obj = eo_constructor());
62} 66 ecordova_entry_file_is_set(EINA_TRUE);
63 67 return obj;
64static void
65_ecordova_filereader_constructor(Eo *obj EINA_UNUSED,
66 Ecordova_FileReader_Data *pd EINA_UNUSED)
67{
68 DBG("(%p)", obj);
69} 68}
70 69
71static void 70static void
diff --git a/src/modules/ecordova/linux/ecordova_filetransfer.c b/src/modules/ecordova/linux/ecordova_filetransfer.c
index 72bb4f040b..9eaaa681e1 100644
--- a/src/modules/ecordova/linux/ecordova_filetransfer.c
+++ b/src/modules/ecordova/linux/ecordova_filetransfer.c
@@ -80,14 +80,9 @@ _ecordova_filetransfer_eo_base_constructor(Eo *obj,
80 pd->obj = obj; 80 pd->obj = obj;
81 pd->job = NULL; 81 pd->job = NULL;
82 82
83 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 83 eo_do_super(obj, MY_CLASS, obj = eo_constructor());
84} 84 eo_do(obj, ecordova_entry_file_is_set(EINA_TRUE));
85 85 return obj;
86static void
87_ecordova_filetransfer_constructor(Eo *obj EINA_UNUSED,
88 Ecordova_FileTransfer_Data *pd EINA_UNUSED)
89{
90 DBG("(%p)", obj);
91} 86}
92 87
93static void 88static void
@@ -228,8 +223,8 @@ _download_progress_cb(void *data,
228 DBG("(%p)", pd->obj); 223 DBG("(%p)", pd->obj);
229 Ecordova_ProgressEvent event = { 224 Ecordova_ProgressEvent event = {
230 .type = "download", 225 .type = "download",
231 .cancelable = true, 226 .cancelable = EINA_TRUE,
232 .length_computable = true, 227 .length_computable = EINA_TRUE,
233 .loaded = dlnow, 228 .loaded = dlnow,
234 .total = dltotal, 229 .total = dltotal,
235 .target = pd->obj 230 .target = pd->obj
@@ -253,7 +248,8 @@ _download_completion_cb(void *data, const char *file, int status)
253 split_path(NULL, file, &path, &name, &native); 248 split_path(NULL, file, &path, &name, &native);
254 249
255 Ecordova_FileEntry *file_entry = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL, 250 Ecordova_FileEntry *file_entry = eo_add(ECORDOVA_FILEENTRY_CLASS, NULL,
256 ecordova_fileentry_constructor(name, path, NULL, native)); // TODO: filesystem? 251 ecordova_entry_name_set(name),
252 ecordova_entry_path_set(path));
257 eo_do(pd->obj, 253 eo_do(pd->obj,
258 eo_event_callback_call(ECORDOVA_FILETRANSFER_EVENT_DOWNLOAD_SUCCESS, file_entry)); 254 eo_event_callback_call(ECORDOVA_FILETRANSFER_EVENT_DOWNLOAD_SUCCESS, file_entry));
259 eo_unref(file_entry); 255 eo_unref(file_entry);
@@ -491,8 +487,8 @@ _url_progress_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
491 487
492 Ecordova_ProgressEvent event = { 488 Ecordova_ProgressEvent event = {
493 .type = "upload", 489 .type = "upload",
494 .cancelable = false, 490 .cancelable = EINA_FALSE,
495 .length_computable = true, 491 .length_computable = EINA_TRUE,
496 .loaded = url_progress->up.now, 492 .loaded = url_progress->up.now,
497 .total = url_progress->up.total, 493 .total = url_progress->up.total,
498 .target = pd->obj 494 .target = pd->obj
diff --git a/src/modules/ecordova/linux/ecordova_filewriter.c b/src/modules/ecordova/linux/ecordova_filewriter.c
index fd048d1f06..735b317419 100644
--- a/src/modules/ecordova/linux/ecordova_filewriter.c
+++ b/src/modules/ecordova/linux/ecordova_filewriter.c
@@ -5,7 +5,6 @@
5#include "ecordova_filewriter_private.h" 5#include "ecordova_filewriter_private.h"
6#include "ecordova_entry_private.h" 6#include "ecordova_entry_private.h"
7 7
8#include <stdbool.h>
9#include <unistd.h> 8#include <unistd.h>
10 9
11#ifdef EAPI 10#ifdef EAPI
@@ -44,8 +43,8 @@ extern int _ecordova_log_dom;
44 43
45static void _write_cb(void *, Ecore_Thread *); 44static void _write_cb(void *, Ecore_Thread *);
46static void _truncate_cb(void *, Ecore_Thread *); 45static void _truncate_cb(void *, Ecore_Thread *);
47static bool _stream_init(Ecordova_FileWriter_Data *); 46static Eina_Bool _stream_init(Ecordova_FileWriter_Data *);
48static bool _offset_set(Ecordova_FileWriter_Data *); 47static Eina_Bool _offset_set(Ecordova_FileWriter_Data *);
49static void _write_end_cb(void *, Ecore_Thread *); 48static void _write_end_cb(void *, Ecore_Thread *);
50static void _write_abort_cb(void *, Ecore_Thread *); 49static void _write_abort_cb(void *, Ecore_Thread *);
51static void _write_progress_cb(void *, Ecore_Thread *, void *); 50static void _write_progress_cb(void *, Ecore_Thread *, void *);
@@ -68,13 +67,15 @@ _ecordova_filewriter_eo_base_constructor(Eo *obj,
68 pd->data_size = 0; 67 pd->data_size = 0;
69 pd->truncate_size = 0; 68 pd->truncate_size = 0;
70 69
71 return eo_do_super_ret(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;
72} 73}
73 74
74static void 75static void
75_ecordova_filewriter_constructor(Eo *obj, 76_ecordova_filewriter_file_set(Eo *obj,
76 Ecordova_FileWriter_Data *pd, 77 Ecordova_FileWriter_Data *pd,
77 Ecordova_File *file) 78 Ecordova_File *file)
78{ 79{
79 DBG("(%p)", obj); 80 DBG("(%p)", obj);
80 EINA_SAFETY_ON_NULL_RETURN(file); 81 EINA_SAFETY_ON_NULL_RETURN(file);
@@ -278,30 +279,30 @@ _truncate_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
278 pd->offset = MIN(pd->offset, pd->truncate_size); 279 pd->offset = MIN(pd->offset, pd->truncate_size);
279} 280}
280 281
281static bool 282static Eina_Bool
282_stream_init(Ecordova_FileWriter_Data *pd) 283_stream_init(Ecordova_FileWriter_Data *pd)
283{ 284{
284 pd->stream = fopen(pd->url, "rb+"); 285 pd->stream = fopen(pd->url, "rb+");
285 if (!pd->stream) 286 if (!pd->stream)
286 { 287 {
287 pd->error = _translate_errno(errno); 288 pd->error = _translate_errno(errno);
288 return false; 289 return EINA_FALSE;
289 } 290 }
290 291
291 return true; 292 return EINA_TRUE;
292} 293}
293 294
294static bool 295static Eina_Bool
295_offset_set(Ecordova_FileWriter_Data *pd) 296_offset_set(Ecordova_FileWriter_Data *pd)
296{ 297{
297 int error = fseek(pd->stream, pd->offset, SEEK_SET); 298 int error = fseek(pd->stream, pd->offset, SEEK_SET);
298 if (error) 299 if (error)
299 { 300 {
300 pd->error = _translate_errno(errno); 301 pd->error = _translate_errno(errno);
301 return false; 302 return EINA_FALSE;
302 } 303 }
303 304
304 return true; 305 return EINA_TRUE;
305} 306}
306 307
307static void 308static void
diff --git a/src/modules/ecordova/tizen/ecordova_batterystatus.c b/src/modules/ecordova/tizen/ecordova_batterystatus.c
index a864e733df..246c3ba970 100644
--- a/src/modules/ecordova/tizen/ecordova_batterystatus.c
+++ b/src/modules/ecordova/tizen/ecordova_batterystatus.c
@@ -7,7 +7,6 @@
7 7
8#include <vconf.h> 8#include <vconf.h>
9 9
10#include <stdbool.h>
11#include <stdint.h> 10#include <stdint.h>
12#include <stdlib.h> 11#include <stdlib.h>
13 12
@@ -22,8 +21,8 @@ static Eina_Bool _del_cb(void *, Eo *, const Eo_Event_Description *, void *);
22static void _start(Ecordova_BatteryStatus_Data *); 21static void _start(Ecordova_BatteryStatus_Data *);
23static void _stop(Ecordova_BatteryStatus_Data *); 22static void _stop(Ecordova_BatteryStatus_Data *);
24static Eina_Bool _on_battery_changed(void *, Eo *, const Eo_Event_Description *, void *); 23static Eina_Bool _on_battery_changed(void *, Eo *, const Eo_Event_Description *, void *);
25static bool _fetch_level(int *); 24static Eina_Bool _fetch_level(int *);
26static bool _fetch_charging_is(Eina_Bool *); 25static Eina_Bool _fetch_charging_is(Eina_Bool *);
27 26
28static Eo_Base * 27static Eo_Base *
29_ecordova_batterystatus_eo_base_constructor(Eo *obj, 28_ecordova_batterystatus_eo_base_constructor(Eo *obj,
@@ -33,17 +32,10 @@ _ecordova_batterystatus_eo_base_constructor(Eo *obj,
33 32
34 pd->obj = obj; 33 pd->obj = obj;
35 34
36 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
37}
38
39static void
40_ecordova_batterystatus_constructor(Eo *obj,
41 Ecordova_BatteryStatus_Data *pd)
42{
43 DBG("(%p)", obj);
44
45 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _add_cb, pd)); 35 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _add_cb, pd));
46 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_DEL, _del_cb, pd)); 36 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_DEL, _del_cb, pd));
37
38 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
47} 39}
48 40
49static void 41static void
@@ -129,11 +121,11 @@ _stop(Ecordova_BatteryStatus_Data *pd)
129 pd)); 121 pd));
130} 122}
131 123
132static bool 124static Eina_Bool
133_fetch_level(int *level) 125_fetch_level(int *level)
134{ 126{
135 int value = 0; 127 int value = 0;
136 bool ret = vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CAPACITY, &value) == 0; 128 Eina_Bool ret = vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CAPACITY, &value) == 0;
137 if (ret) 129 if (ret)
138 ERR("%s", "Failed to get battery capacity"); 130 ERR("%s", "Failed to get battery capacity");
139 131
@@ -141,7 +133,7 @@ _fetch_level(int *level)
141 return ret; 133 return ret;
142} 134}
143 135
144static bool 136static Eina_Bool
145_fetch_charging_is(Eina_Bool *charging_is) 137_fetch_charging_is(Eina_Bool *charging_is)
146{ 138{
147 int value = 0; 139 int value = 0;
diff --git a/src/modules/ecordova/tizen/ecordova_contact.c b/src/modules/ecordova/tizen/ecordova_contact.c
index fbb88b4e77..2a26ecd494 100644
--- a/src/modules/ecordova/tizen/ecordova_contact.c
+++ b/src/modules/ecordova/tizen/ecordova_contact.c
@@ -14,7 +14,6 @@
14#include <contacts.h> 14#include <contacts.h>
15 15
16#include <assert.h> 16#include <assert.h>
17#include <stdbool.h>
18#include <stdint.h> 17#include <stdint.h>
19#include <stdlib.h> 18#include <stdlib.h>
20 19
@@ -28,12 +27,12 @@ static Eina_Array *_contactorganization_array_copy(Eina_Array *);
28static void _contactfield_array_free(Eina_Array *); 27static void _contactfield_array_free(Eina_Array *);
29static void _contactaddress_array_free(Eina_Array *); 28static void _contactaddress_array_free(Eina_Array *);
30static void _contactorganization_array_free(Eina_Array *); 29static void _contactorganization_array_free(Eina_Array *);
31static bool _ecordova_contactfields_import(Eina_Array *, contacts_record_h, const Ecordova_ContactField_Metadata); 30static Eina_Bool _ecordova_contactfields_import(Eina_Array *, contacts_record_h, const Ecordova_ContactField_Metadata);
32static bool _ecordova_contactfields_export(Eina_Array *, contacts_record_h, const Ecordova_ContactField_Metadata); 31static Eina_Bool _ecordova_contactfields_export(Eina_Array *, contacts_record_h, const Ecordova_ContactField_Metadata);
33static bool _ecordova_contactaddresses_import(Eina_Array *, contacts_record_h); 32static Eina_Bool _ecordova_contactaddresses_import(Eina_Array *, contacts_record_h);
34static bool _ecordova_contactaddresses_export(Eina_Array *, contacts_record_h); 33static Eina_Bool _ecordova_contactaddresses_export(Eina_Array *, contacts_record_h);
35static bool _ecordova_contactorganizations_import(Eina_Array *, contacts_record_h); 34static Eina_Bool _ecordova_contactorganizations_import(Eina_Array *, contacts_record_h);
36static bool _ecordova_contactorganizations_export(Eina_Array *, contacts_record_h); 35static Eina_Bool _ecordova_contactorganizations_export(Eina_Array *, contacts_record_h);
37static void _contactfield_array_clear_id(Eina_Array *); 36static void _contactfield_array_clear_id(Eina_Array *);
38static void _contactaddress_array_clear_id(Eina_Array *); 37static void _contactaddress_array_clear_id(Eina_Array *);
39static void _contactorganization_array_clear_id(Eina_Array *); 38static void _contactorganization_array_clear_id(Eina_Array *);
@@ -75,7 +74,7 @@ _ecordova_contact_eo_base_destructor(Eo *obj, Ecordova_Contact_Data *pd)
75 _contactfield_array_free(pd->categories); 74 _contactfield_array_free(pd->categories);
76 _contactfield_array_free(pd->urls); 75 _contactfield_array_free(pd->urls);
77 76
78 int ret = contacts_record_destroy(pd->record, true); 77 int ret = contacts_record_destroy(pd->record, EINA_TRUE);
79 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 78 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
80 79
81 eo_do_super(obj, MY_CLASS, eo_destructor()); 80 eo_do_super(obj, MY_CLASS, eo_destructor());
@@ -176,7 +175,7 @@ _ecordova_contact_save(Eo *obj, Ecordova_Contact_Data *pd)
176 goto on_error; 175 goto on_error;
177 } 176 }
178 177
179 ret = contacts_record_destroy(pd->record, true); 178 ret = contacts_record_destroy(pd->record, EINA_TRUE);
180 if (CONTACTS_ERROR_NONE != ret) 179 if (CONTACTS_ERROR_NONE != ret)
181 { 180 {
182 ERR("Error destroying record: %d", ret); 181 ERR("Error destroying record: %d", ret);
@@ -280,7 +279,7 @@ _ecordova_contact_nickname_set(Eo *obj EINA_UNUSED,
280 return; 279 return;
281 280
282on_error: 281on_error:
283 ret = contacts_record_destroy(child_record, true); 282 ret = contacts_record_destroy(child_record, EINA_TRUE);
284 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 283 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
285} 284}
286 285
@@ -425,7 +424,7 @@ _ecordova_contact_note_set(Eo *obj EINA_UNUSED,
425 return; 424 return;
426 425
427on_error: 426on_error:
428 ret = contacts_record_destroy(child_record, true); 427 ret = contacts_record_destroy(child_record, EINA_TRUE);
429 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 428 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
430} 429}
431 430
@@ -778,68 +777,68 @@ _contact_url_metadata = {
778 .label2type = ecordova_contacturl_label2type 777 .label2type = ecordova_contacturl_label2type
779}; 778};
780 779
781bool 780Eina_Bool
782ecordova_contact_import(Ecordova_Contact *obj, 781ecordova_contact_import(Ecordova_Contact *obj,
783 contacts_record_h contacts_record) 782 contacts_record_h contacts_record)
784{ 783{
785 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 784 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
786 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, false); 785 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, EINA_FALSE);
787 786
788 Ecordova_Contact_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACT_CLASS); 787 Ecordova_Contact_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACT_CLASS);
789 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 788 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
790 789
791 int ret; 790 int ret;
792 791
793 ret = contacts_record_destroy(pd->record, true); 792 ret = contacts_record_destroy(pd->record, EINA_TRUE);
794 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 793 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
795 ret = contacts_record_clone(contacts_record, &pd->record); 794 ret = contacts_record_clone(contacts_record, &pd->record);
796 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 795 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
797 796
798 ret = contacts_record_get_int(pd->record, _contacts_contact.id, &pd->id); 797 ret = contacts_record_get_int(pd->record, _contacts_contact.id, &pd->id);
799 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 798 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
800 799
801 // name 800 // name
802 DBG("%s", "Importing name"); 801 DBG("%s", "Importing name");
803 if (!ecordova_contactname_import(pd->name, pd->record)) 802 if (!ecordova_contactname_import(pd->name, pd->record))
804 return false; 803 return EINA_FALSE;
805 804
806 // phone_numbers 805 // phone_numbers
807 DBG("%s", "Importing phone_numbers"); 806 DBG("%s", "Importing phone_numbers");
808 if (!_ecordova_contactfields_import(pd->phone_numbers, 807 if (!_ecordova_contactfields_import(pd->phone_numbers,
809 pd->record, 808 pd->record,
810 _contact_number_metadata)) 809 _contact_number_metadata))
811 return false; 810 return EINA_FALSE;
812 811
813 // emails 812 // emails
814 DBG("%s", "Importing emails"); 813 DBG("%s", "Importing emails");
815 if (!_ecordova_contactfields_import(pd->emails, 814 if (!_ecordova_contactfields_import(pd->emails,
816 pd->record, 815 pd->record,
817 _contact_email_metadata)) 816 _contact_email_metadata))
818 return false; 817 return EINA_FALSE;
819 818
820 // addresses 819 // addresses
821 DBG("%s", "Importing addresses"); 820 DBG("%s", "Importing addresses");
822 if (!_ecordova_contactaddresses_import(pd->addresses, pd->record)) 821 if (!_ecordova_contactaddresses_import(pd->addresses, pd->record))
823 return false; 822 return EINA_FALSE;
824 823
825 // ims 824 // ims
826 DBG("%s", "Importing ims"); 825 DBG("%s", "Importing ims");
827 if (!_ecordova_contactfields_import(pd->ims, 826 if (!_ecordova_contactfields_import(pd->ims,
828 pd->record, 827 pd->record,
829 _contact_messenger_metadata)) 828 _contact_messenger_metadata))
830 return false; 829 return EINA_FALSE;
831 830
832 // organizations 831 // organizations
833 DBG("%s", "Importing organizations"); 832 DBG("%s", "Importing organizations");
834 if (!_ecordova_contactorganizations_import(pd->organizations, pd->record)) 833 if (!_ecordova_contactorganizations_import(pd->organizations, pd->record))
835 return false; 834 return EINA_FALSE;
836 835
837 // photos 836 // photos
838 DBG("%s", "Importing photos"); 837 DBG("%s", "Importing photos");
839 if (!_ecordova_contactfields_import(pd->photos, 838 if (!_ecordova_contactfields_import(pd->photos,
840 pd->record, 839 pd->record,
841 _contact_image_metadata)) 840 _contact_image_metadata))
842 return false; 841 return EINA_FALSE;
843 842
844 // TODO: categories 843 // TODO: categories
845 844
@@ -848,57 +847,57 @@ ecordova_contact_import(Ecordova_Contact *obj,
848 if (!_ecordova_contactfields_import(pd->urls, 847 if (!_ecordova_contactfields_import(pd->urls,
849 pd->record, 848 pd->record,
850 _contact_url_metadata)) 849 _contact_url_metadata))
851 return false; 850 return EINA_FALSE;
852 851
853 return true; 852 return EINA_TRUE;
854} 853}
855 854
856bool 855Eina_Bool
857ecordova_contact_export(Ecordova_Contact *obj, 856ecordova_contact_export(Ecordova_Contact *obj,
858 contacts_record_h contacts_record) 857 contacts_record_h contacts_record)
859{ 858{
860 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 859 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
861 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, false); 860 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, EINA_FALSE);
862 861
863 Ecordova_Contact_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACT_CLASS); 862 Ecordova_Contact_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACT_CLASS);
864 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 863 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
865 864
866 // name 865 // name
867 if (!clear_all_contact_record(contacts_record, _contacts_contact.name) || 866 if (!clear_all_contact_record(contacts_record, _contacts_contact.name) ||
868 !ecordova_contactname_export(pd->name, contacts_record)) 867 !ecordova_contactname_export(pd->name, contacts_record))
869 return false; 868 return EINA_FALSE;
870 869
871 // phone_numbers 870 // phone_numbers
872 if (!_ecordova_contactfields_export(pd->phone_numbers, 871 if (!_ecordova_contactfields_export(pd->phone_numbers,
873 contacts_record, 872 contacts_record,
874 _contact_number_metadata)) 873 _contact_number_metadata))
875 return false; 874 return EINA_FALSE;
876 875
877 // emails 876 // emails
878 if (!_ecordova_contactfields_export(pd->emails, 877 if (!_ecordova_contactfields_export(pd->emails,
879 contacts_record, 878 contacts_record,
880 _contact_email_metadata)) 879 _contact_email_metadata))
881 return false; 880 return EINA_FALSE;
882 881
883 // addresses 882 // addresses
884 if (!_ecordova_contactaddresses_export(pd->addresses, contacts_record)) 883 if (!_ecordova_contactaddresses_export(pd->addresses, contacts_record))
885 return false; 884 return EINA_FALSE;
886 885
887 // ims 886 // ims
888 if (!_ecordova_contactfields_export(pd->ims, 887 if (!_ecordova_contactfields_export(pd->ims,
889 contacts_record, 888 contacts_record,
890 _contact_messenger_metadata)) 889 _contact_messenger_metadata))
891 return false; 890 return EINA_FALSE;
892 891
893 // organizations 892 // organizations
894 if (!_ecordova_contactorganizations_export(pd->organizations, contacts_record)) 893 if (!_ecordova_contactorganizations_export(pd->organizations, contacts_record))
895 return false; 894 return EINA_FALSE;
896 895
897 // photos 896 // photos
898 if (!_ecordova_contactfields_export(pd->photos, 897 if (!_ecordova_contactfields_export(pd->photos,
899 contacts_record, 898 contacts_record,
900 _contact_image_metadata)) 899 _contact_image_metadata))
901 return false; 900 return EINA_FALSE;
902 901
903 // TODO: categories 902 // TODO: categories
904 903
@@ -906,12 +905,12 @@ ecordova_contact_export(Ecordova_Contact *obj,
906 if (!_ecordova_contactfields_export(pd->urls, 905 if (!_ecordova_contactfields_export(pd->urls,
907 contacts_record, 906 contacts_record,
908 _contact_url_metadata)) 907 _contact_url_metadata))
909 return false; 908 return EINA_FALSE;
910 909
911 return true; 910 return EINA_TRUE;
912} 911}
913 912
914static bool 913static Eina_Bool
915_ecordova_contactfields_import(Eina_Array *fields, 914_ecordova_contactfields_import(Eina_Array *fields,
916 contacts_record_h contacts_record, 915 contacts_record_h contacts_record,
917 const Ecordova_ContactField_Metadata metadata) 916 const Ecordova_ContactField_Metadata metadata)
@@ -921,7 +920,7 @@ _ecordova_contactfields_import(Eina_Array *fields,
921 ret = contacts_record_get_child_record_count(contacts_record, 920 ret = contacts_record_get_child_record_count(contacts_record,
922 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID], 921 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID],
923 &count); 922 &count);
924 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 923 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
925 924
926 DBG("Importing %d children", count); 925 DBG("Importing %d children", count);
927 for (int index = 0; index < count; ++index) 926 for (int index = 0; index < count; ++index)
@@ -931,30 +930,30 @@ _ecordova_contactfields_import(Eina_Array *fields,
931 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID], 930 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID],
932 index, 931 index,
933 &child_record); 932 &child_record);
934 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 933 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
935 934
936 Ecordova_ContactField *field = eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL); 935 Ecordova_ContactField *field = eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL);
937 if (!ecordova_contactfield_import(field, child_record, metadata)) 936 if (!ecordova_contactfield_import(field, child_record, metadata))
938 { 937 {
939 eo_unref(field); 938 eo_unref(field);
940 return false; 939 return EINA_FALSE;
941 } 940 }
942 941
943 Eina_Bool ret = eina_array_push(fields, field); 942 Eina_Bool ret = eina_array_push(fields, field);
944 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, false); 943 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EINA_FALSE);
945 } 944 }
946 945
947 return true; 946 return EINA_TRUE;
948} 947}
949 948
950static bool 949static Eina_Bool
951_ecordova_contactfields_export(Eina_Array *fields, 950_ecordova_contactfields_export(Eina_Array *fields,
952 contacts_record_h contacts_record, 951 contacts_record_h contacts_record,
953 const Ecordova_ContactField_Metadata metadata) 952 const Ecordova_ContactField_Metadata metadata)
954{ 953{
955 if (!clear_all_contact_record(contacts_record, 954 if (!clear_all_contact_record(contacts_record,
956 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID])) 955 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID]))
957 return false; 956 return EINA_FALSE;
958 957
959 Ecordova_ContactField *field; 958 Ecordova_ContactField *field;
960 Eina_Array_Iterator iterator; 959 Eina_Array_Iterator iterator;
@@ -963,25 +962,25 @@ _ecordova_contactfields_export(Eina_Array *fields,
963 { 962 {
964 contacts_record_h record = NULL; 963 contacts_record_h record = NULL;
965 int ret = contacts_record_create(*metadata.uri, &record); 964 int ret = contacts_record_create(*metadata.uri, &record);
966 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 965 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
967 966
968 if (!ecordova_contactfield_export(field, record, metadata)) 967 if (!ecordova_contactfield_export(field, record, metadata))
969 { 968 {
970 ret = contacts_record_destroy(record, true); 969 ret = contacts_record_destroy(record, EINA_TRUE);
971 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 970 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
972 return false; 971 return EINA_FALSE;
973 } 972 }
974 973
975 ret = contacts_record_add_child_record(contacts_record, 974 ret = contacts_record_add_child_record(contacts_record,
976 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID], 975 *metadata.ids[ECORDOVA_CONTACTFIELD_PARENT_PROPERTY_ID],
977 record); 976 record);
978 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 977 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
979 } 978 }
980 979
981 return true; 980 return EINA_TRUE;
982} 981}
983 982
984static bool 983static Eina_Bool
985_ecordova_contactaddresses_import(Eina_Array *fields, 984_ecordova_contactaddresses_import(Eina_Array *fields,
986 contacts_record_h contacts_record) 985 contacts_record_h contacts_record)
987{ 986{
@@ -990,7 +989,7 @@ _ecordova_contactaddresses_import(Eina_Array *fields,
990 ret = contacts_record_get_child_record_count(contacts_record, 989 ret = contacts_record_get_child_record_count(contacts_record,
991 _contacts_contact.address, 990 _contacts_contact.address,
992 &count); 991 &count);
993 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 992 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
994 993
995 DBG("Importing %d addresses", count); 994 DBG("Importing %d addresses", count);
996 for (int index = 0; index < count; ++index) 995 for (int index = 0; index < count; ++index)
@@ -1000,28 +999,28 @@ _ecordova_contactaddresses_import(Eina_Array *fields,
1000 _contacts_contact.address, 999 _contacts_contact.address,
1001 index, 1000 index,
1002 &child_record); 1001 &child_record);
1003 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1002 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1004 1003
1005 Ecordova_ContactAddress *address = eo_add(ECORDOVA_CONTACTADDRESS_CLASS, NULL); 1004 Ecordova_ContactAddress *address = eo_add(ECORDOVA_CONTACTADDRESS_CLASS, NULL);
1006 if (!ecordova_contactaddress_import(address, child_record)) 1005 if (!ecordova_contactaddress_import(address, child_record))
1007 { 1006 {
1008 eo_unref(address); 1007 eo_unref(address);
1009 return false; 1008 return EINA_FALSE;
1010 } 1009 }
1011 1010
1012 Eina_Bool ret = eina_array_push(fields, address); 1011 Eina_Bool ret = eina_array_push(fields, address);
1013 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, false); 1012 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EINA_FALSE);
1014 } 1013 }
1015 1014
1016 return true; 1015 return EINA_TRUE;
1017} 1016}
1018 1017
1019static bool 1018static Eina_Bool
1020_ecordova_contactaddresses_export(Eina_Array *addresses, 1019_ecordova_contactaddresses_export(Eina_Array *addresses,
1021 contacts_record_h contacts_record) 1020 contacts_record_h contacts_record)
1022{ 1021{
1023 if (!clear_all_contact_record(contacts_record, _contacts_contact.address)) 1022 if (!clear_all_contact_record(contacts_record, _contacts_contact.address))
1024 return false; 1023 return EINA_FALSE;
1025 1024
1026 Ecordova_ContactAddress *address; 1025 Ecordova_ContactAddress *address;
1027 Eina_Array_Iterator iterator; 1026 Eina_Array_Iterator iterator;
@@ -1030,25 +1029,25 @@ _ecordova_contactaddresses_export(Eina_Array *addresses,
1030 { 1029 {
1031 contacts_record_h record = NULL; 1030 contacts_record_h record = NULL;
1032 int ret = contacts_record_create(_contacts_address._uri, &record); 1031 int ret = contacts_record_create(_contacts_address._uri, &record);
1033 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1032 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1034 1033
1035 if (!ecordova_contactaddress_export(address, record)) 1034 if (!ecordova_contactaddress_export(address, record))
1036 { 1035 {
1037 ret = contacts_record_destroy(record, true); 1036 ret = contacts_record_destroy(record, EINA_TRUE);
1038 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1037 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1039 return false; 1038 return EINA_FALSE;
1040 } 1039 }
1041 1040
1042 ret = contacts_record_add_child_record(contacts_record, 1041 ret = contacts_record_add_child_record(contacts_record,
1043 _contacts_contact.address, 1042 _contacts_contact.address,
1044 record); 1043 record);
1045 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1044 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1046 } 1045 }
1047 1046
1048 return true; 1047 return EINA_TRUE;
1049} 1048}
1050 1049
1051static bool 1050static Eina_Bool
1052_ecordova_contactorganizations_import(Eina_Array *organizations, 1051_ecordova_contactorganizations_import(Eina_Array *organizations,
1053 contacts_record_h contacts_record) 1052 contacts_record_h contacts_record)
1054{ 1053{
@@ -1057,7 +1056,7 @@ _ecordova_contactorganizations_import(Eina_Array *organizations,
1057 ret = contacts_record_get_child_record_count(contacts_record, 1056 ret = contacts_record_get_child_record_count(contacts_record,
1058 _contacts_contact.company, 1057 _contacts_contact.company,
1059 &count); 1058 &count);
1060 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1059 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1061 1060
1062 DBG("Importing %d organizations", count); 1061 DBG("Importing %d organizations", count);
1063 for (int index = 0; index < count; ++index) 1062 for (int index = 0; index < count; ++index)
@@ -1067,28 +1066,28 @@ _ecordova_contactorganizations_import(Eina_Array *organizations,
1067 _contacts_contact.company, 1066 _contacts_contact.company,
1068 index, 1067 index,
1069 &child_record); 1068 &child_record);
1070 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1069 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1071 1070
1072 Ecordova_ContactOrganization *organization = eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, NULL); 1071 Ecordova_ContactOrganization *organization = eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, NULL);
1073 if (!ecordova_contactorganization_import(organization, child_record)) 1072 if (!ecordova_contactorganization_import(organization, child_record))
1074 { 1073 {
1075 eo_unref(organization); 1074 eo_unref(organization);
1076 return false; 1075 return EINA_FALSE;
1077 } 1076 }
1078 1077
1079 Eina_Bool ret = eina_array_push(organizations, organization); 1078 Eina_Bool ret = eina_array_push(organizations, organization);
1080 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, false); 1079 EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EINA_FALSE);
1081 } 1080 }
1082 1081
1083 return true; 1082 return EINA_TRUE;
1084} 1083}
1085 1084
1086static bool 1085static Eina_Bool
1087_ecordova_contactorganizations_export(Eina_Array *organizations, 1086_ecordova_contactorganizations_export(Eina_Array *organizations,
1088 contacts_record_h contacts_record) 1087 contacts_record_h contacts_record)
1089{ 1088{
1090 if (!clear_all_contact_record(contacts_record, _contacts_contact.company)) 1089 if (!clear_all_contact_record(contacts_record, _contacts_contact.company))
1091 return false; 1090 return EINA_FALSE;
1092 1091
1093 Ecordova_ContactOrganization *organization; 1092 Ecordova_ContactOrganization *organization;
1094 Eina_Array_Iterator iterator; 1093 Eina_Array_Iterator iterator;
@@ -1097,22 +1096,22 @@ _ecordova_contactorganizations_export(Eina_Array *organizations,
1097 { 1096 {
1098 contacts_record_h record = NULL; 1097 contacts_record_h record = NULL;
1099 int ret = contacts_record_create(_contacts_company._uri, &record); 1098 int ret = contacts_record_create(_contacts_company._uri, &record);
1100 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1099 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1101 1100
1102 if (!ecordova_contactaddress_export(organization, record)) 1101 if (!ecordova_contactaddress_export(organization, record))
1103 { 1102 {
1104 ret = contacts_record_destroy(record, true); 1103 ret = contacts_record_destroy(record, EINA_TRUE);
1105 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1104 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1106 return false; 1105 return EINA_FALSE;
1107 } 1106 }
1108 1107
1109 ret = contacts_record_add_child_record(contacts_record, 1108 ret = contacts_record_add_child_record(contacts_record,
1110 _contacts_contact.company, 1109 _contacts_contact.company,
1111 record); 1110 record);
1112 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 1111 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
1113 } 1112 }
1114 1113
1115 return true; 1114 return EINA_TRUE;
1116} 1115}
1117 1116
1118#include "ecordova_contact.eo.c" 1117#include "ecordova_contact.eo.c"
diff --git a/src/modules/ecordova/tizen/ecordova_contact_private.h b/src/modules/ecordova/tizen/ecordova_contact_private.h
index 4a1ddc8deb..5b0f9b5ce5 100644
--- a/src/modules/ecordova/tizen/ecordova_contact_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contact_private.h
@@ -9,7 +9,6 @@
9#include "ecordova_contact.eo.h" 9#include "ecordova_contact.eo.h"
10 10
11#include <contacts.h> 11#include <contacts.h>
12#include <stdbool.h>
13 12
14typedef struct _Ecordova_Contact_Data Ecordova_Contact_Data; 13typedef struct _Ecordova_Contact_Data Ecordova_Contact_Data;
15 14
@@ -32,7 +31,7 @@ struct _Ecordova_Contact_Data
32 Eina_Array *urls; 31 Eina_Array *urls;
33}; 32};
34 33
35bool ecordova_contact_import(Ecordova_Contact *, contacts_record_h); 34Eina_Bool ecordova_contact_import(Ecordova_Contact *, contacts_record_h);
36bool ecordova_contact_export(Ecordova_Contact *, contacts_record_h); 35Eina_Bool ecordova_contact_export(Ecordova_Contact *, contacts_record_h);
37 36
38#endif 37#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactaddress.c b/src/modules/ecordova/tizen/ecordova_contactaddress.c
index 2aa209f24f..704bcab514 100644
--- a/src/modules/ecordova/tizen/ecordova_contactaddress.c
+++ b/src/modules/ecordova/tizen/ecordova_contactaddress.c
@@ -7,7 +7,6 @@
7#include "ecordova_contactaddress_private.h" 7#include "ecordova_contactaddress_private.h"
8#include "ecordova_contacts_record_utils.h" 8#include "ecordova_contacts_record_utils.h"
9 9
10#include <stdbool.h>
11#include <stdint.h> 10#include <stdint.h>
12#include <stdlib.h> 11#include <stdlib.h>
13 12
@@ -30,36 +29,12 @@ _ecordova_contactaddress_eo_base_constructor(Eo *obj,
30} 29}
31 30
32static void 31static void
33_ecordova_contactaddress_constructor(Eo *obj,
34 Ecordova_ContactAddress_Data *pd EINA_UNUSED,
35 Eina_Bool pref,
36 const char *type,
37 const char *formatted,
38 const char *street_address,
39 const char *locality,
40 const char *region,
41 const char *postal_code,
42 const char *country)
43{
44 DBG("(%p)", obj);
45 eo_do(obj,
46 ecordova_contactaddress_pref_set(pref),
47 ecordova_contactaddress_type_set(type),
48 ecordova_contactaddress_formatted_set(formatted),
49 ecordova_contactaddress_street_address_set(street_address),
50 ecordova_contactaddress_locality_set(locality),
51 ecordova_contactaddress_region_set(region),
52 ecordova_contactaddress_postal_code_set(postal_code),
53 ecordova_contactaddress_country_set(country));
54}
55
56static void
57_ecordova_contactaddress_eo_base_destructor(Eo *obj, 32_ecordova_contactaddress_eo_base_destructor(Eo *obj,
58 Ecordova_ContactAddress_Data *pd) 33 Ecordova_ContactAddress_Data *pd)
59{ 34{
60 DBG("(%p)", obj); 35 DBG("(%p)", obj);
61 36
62 int ret = contacts_record_destroy(pd->record, true); 37 int ret = contacts_record_destroy(pd->record, EINA_TRUE);
63 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 38 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
64 39
65 eo_do_super(obj, MY_CLASS, eo_destructor()); 40 eo_do_super(obj, MY_CLASS, eo_destructor());
@@ -253,44 +228,44 @@ _ecordova_contactaddress_country_set(Eo *obj EINA_UNUSED,
253 set_str(pd->record, _contacts_address.country, value); 228 set_str(pd->record, _contacts_address.country, value);
254} 229}
255 230
256bool 231Eina_Bool
257ecordova_contactaddress_import(Ecordova_ContactAddress *obj, 232ecordova_contactaddress_import(Ecordova_ContactAddress *obj,
258 contacts_record_h child_record) 233 contacts_record_h child_record)
259{ 234{
260 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 235 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
261 EINA_SAFETY_ON_NULL_RETURN_VAL(child_record, false); 236 EINA_SAFETY_ON_NULL_RETURN_VAL(child_record, EINA_FALSE);
262 237
263 Ecordova_ContactAddress_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTADDRESS_CLASS); 238 Ecordova_ContactAddress_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTADDRESS_CLASS);
264 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 239 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
265 240
266 int ret = contacts_record_destroy(pd->record, true); 241 int ret = contacts_record_destroy(pd->record, EINA_TRUE);
267 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 242 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
268 ret = contacts_record_clone(child_record, &pd->record); 243 ret = contacts_record_clone(child_record, &pd->record);
269 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 244 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
270 245
271 return get_int(child_record, _contacts_address.id, &pd->id); 246 return get_int(child_record, _contacts_address.id, &pd->id);
272} 247}
273 248
274bool 249Eina_Bool
275ecordova_contactaddress_export(Ecordova_ContactAddress *obj, 250ecordova_contactaddress_export(Ecordova_ContactAddress *obj,
276 contacts_record_h contacts_record) 251 contacts_record_h contacts_record)
277{ 252{
278 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 253 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
279 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, false); 254 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, EINA_FALSE);
280 255
281 Ecordova_ContactAddress_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTADDRESS_CLASS); 256 Ecordova_ContactAddress_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTADDRESS_CLASS);
282 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 257 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
283 258
284 contacts_record_h child_record = NULL; 259 contacts_record_h child_record = NULL;
285 int ret = contacts_record_clone(pd->record, &child_record); 260 int ret = contacts_record_clone(pd->record, &child_record);
286 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 261 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
287 262
288 ret = contacts_record_add_child_record(contacts_record, 263 ret = contacts_record_add_child_record(contacts_record,
289 _contacts_contact.address, 264 _contacts_contact.address,
290 child_record); 265 child_record);
291 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 266 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
292 267
293 return true; 268 return EINA_TRUE;
294} 269}
295 270
296Ecordova_ContactAddress * 271Ecordova_ContactAddress *
@@ -303,7 +278,7 @@ ecordova_contactaddress_clone(Ecordova_ContactAddress *other)
303 Ecordova_ContactAddress_Data *other_pd = eo_data_scope_get(other, ECORDOVA_CONTACTADDRESS_CLASS); 278 Ecordova_ContactAddress_Data *other_pd = eo_data_scope_get(other, ECORDOVA_CONTACTADDRESS_CLASS);
304 EINA_SAFETY_ON_NULL_RETURN_VAL(other_pd, NULL); 279 EINA_SAFETY_ON_NULL_RETURN_VAL(other_pd, NULL);
305 280
306 int ret = contacts_record_destroy(cloned_pd->record, true); 281 int ret = contacts_record_destroy(cloned_pd->record, EINA_TRUE);
307 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 282 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
308 ret = contacts_record_clone(other_pd->record, &cloned_pd->record); 283 ret = contacts_record_clone(other_pd->record, &cloned_pd->record);
309 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 284 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
diff --git a/src/modules/ecordova/tizen/ecordova_contactaddress_private.h b/src/modules/ecordova/tizen/ecordova_contactaddress_private.h
index 56715d34f1..87b0449568 100644
--- a/src/modules/ecordova/tizen/ecordova_contactaddress_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactaddress_private.h
@@ -18,8 +18,8 @@ struct _Ecordova_ContactAddress_Data
18 contacts_record_h record; 18 contacts_record_h record;
19}; 19};
20 20
21bool ecordova_contactaddress_import(Ecordova_ContactAddress *, contacts_record_h); 21Eina_Bool ecordova_contactaddress_import(Ecordova_ContactAddress *, contacts_record_h);
22bool ecordova_contactaddress_export(Ecordova_ContactAddress *, contacts_record_h); 22Eina_Bool ecordova_contactaddress_export(Ecordova_ContactAddress *, contacts_record_h);
23Ecordova_ContactAddress *ecordova_contactaddress_clone(Ecordova_ContactAddress *); 23Ecordova_ContactAddress *ecordova_contactaddress_clone(Ecordova_ContactAddress *);
24 24
25#endif 25#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactfield.c b/src/modules/ecordova/tizen/ecordova_contactfield.c
index f69978cc13..4d49fae416 100644
--- a/src/modules/ecordova/tizen/ecordova_contactfield.c
+++ b/src/modules/ecordova/tizen/ecordova_contactfield.c
@@ -6,7 +6,6 @@
6#include "ecordova_contactfield_private.h" 6#include "ecordova_contactfield_private.h"
7#include "ecordova_contacts_record_utils.h" 7#include "ecordova_contacts_record_utils.h"
8 8
9#include <stdbool.h>
10#include <stdint.h> 9#include <stdint.h>
11#include <stdlib.h> 10#include <stdlib.h>
12 11
@@ -20,25 +19,15 @@ _ecordova_contactfield_eo_base_constructor(Eo *obj,
20 DBG("(%p)", obj); 19 DBG("(%p)", obj);
21 20
22 pd->obj = obj; 21 pd->obj = obj;
22 pd->id = 0;
23 pd->type = NULL;
24 pd->value = NULL;
25 pd->pref = EINA_FALSE;
23 26
24 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 27 return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
25} 28}
26 29
27static void 30static void
28_ecordova_contactfield_constructor(Eo *obj,
29 Ecordova_ContactField_Data *pd,
30 const char *type,
31 const char *value,
32 Eina_Bool pref)
33{
34 DBG("(%p)", obj);
35 pd->id = 0;
36 pd->type = type ? strdup(type) : NULL;
37 pd->value = value ? strdup(value) : NULL;
38 pd->pref = pref;
39}
40
41static void
42_ecordova_contactfield_eo_base_destructor(Eo *obj, 31_ecordova_contactfield_eo_base_destructor(Eo *obj,
43 Ecordova_ContactField_Data *pd) 32 Ecordova_ContactField_Data *pd)
44{ 33{
@@ -104,17 +93,17 @@ _ecordova_contactfield_pref_set(Eo *obj EINA_UNUSED,
104 pd->pref = pref; 93 pd->pref = pref;
105} 94}
106 95
107bool 96Eina_Bool
108ecordova_contactfield_import(Ecordova_ContactField *obj, 97ecordova_contactfield_import(Ecordova_ContactField *obj,
109 contacts_record_h record, 98 contacts_record_h record,
110 const Ecordova_ContactField_Metadata metadata) 99 const Ecordova_ContactField_Metadata metadata)
111{ 100{
112 DBG("%p", obj); 101 DBG("%p", obj);
113 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 102 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
114 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 103 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
115 104
116 Ecordova_ContactField_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTFIELD_CLASS); 105 Ecordova_ContactField_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTFIELD_CLASS);
117 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 106 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
118 107
119 int type = 0; 108 int type = 0;
120 const char* label = NULL; 109 const char* label = NULL;
@@ -124,7 +113,7 @@ ecordova_contactfield_import(Ecordova_ContactField *obj,
124 !get_str_p(record, 113 !get_str_p(record,
125 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_LABEL], 114 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_LABEL],
126 &label)) 115 &label))
127 return false; 116 return EINA_FALSE;
128 117
129 pd->type = metadata.type2label(type, label); 118 pd->type = metadata.type2label(type, label);
130 119
@@ -134,52 +123,52 @@ ecordova_contactfield_import(Ecordova_ContactField *obj,
134 !get_str(record, 123 !get_str(record,
135 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_VALUE], 124 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_VALUE],
136 &pd->value)) 125 &pd->value))
137 return false; 126 return EINA_FALSE;
138 127
139 if (metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF] && 128 if (metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF] &&
140 !get_bool(record, 129 !get_bool(record,
141 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF], 130 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF],
142 &pd->pref)) 131 &pd->pref))
143 return false; 132 return EINA_FALSE;
144 133
145 return true; 134 return EINA_TRUE;
146} 135}
147 136
148bool 137Eina_Bool
149ecordova_contactfield_export(Ecordova_ContactField *obj, 138ecordova_contactfield_export(Ecordova_ContactField *obj,
150 contacts_record_h record, 139 contacts_record_h record,
151 const Ecordova_ContactField_Metadata metadata) 140 const Ecordova_ContactField_Metadata metadata)
152{ 141{
153 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 142 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
154 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 143 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
155 144
156 Ecordova_ContactField_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTFIELD_CLASS); 145 Ecordova_ContactField_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTFIELD_CLASS);
157 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 146 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
158 147
159 int type = metadata.label2type(pd->type); 148 int type = metadata.label2type(pd->type);
160 if (!set_int(record, 149 if (!set_int(record,
161 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_TYPE], 150 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_TYPE],
162 type)) 151 type))
163 return false; 152 return EINA_FALSE;
164 153
165 if (pd->type && 154 if (pd->type &&
166 !set_str(record, 155 !set_str(record,
167 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_LABEL], 156 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_LABEL],
168 pd->type)) 157 pd->type))
169 return false; 158 return EINA_FALSE;
170 159
171 if (!set_str(record, 160 if (!set_str(record,
172 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_VALUE], 161 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_VALUE],
173 pd->value)) 162 pd->value))
174 return false; 163 return EINA_FALSE;
175 164
176 if (metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF] && 165 if (metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF] &&
177 !set_bool(record, 166 !set_bool(record,
178 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF], 167 *metadata.ids[ECORDOVA_CONTACTFIELD_PROPERTY_PREF],
179 pd->pref)) 168 pd->pref))
180 return false; 169 return EINA_FALSE;
181 170
182 return true; 171 return EINA_TRUE;
183} 172}
184 173
185char * 174char *
diff --git a/src/modules/ecordova/tizen/ecordova_contactfield_private.h b/src/modules/ecordova/tizen/ecordova_contactfield_private.h
index 408a40addc..b69b2cf6f2 100644
--- a/src/modules/ecordova/tizen/ecordova_contactfield_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactfield_private.h
@@ -5,7 +5,6 @@
5#include "ecordova_contactfield.eo.h" 5#include "ecordova_contactfield.eo.h"
6 6
7#include <contacts.h> 7#include <contacts.h>
8#include <stdbool.h>
9 8
10typedef enum _Ecordova_ContactField_Property 9typedef enum _Ecordova_ContactField_Property
11{ 10{
@@ -41,8 +40,8 @@ struct _Ecordova_ContactField_Data
41 Ecordova_ContactField_Metadata metadata; 40 Ecordova_ContactField_Metadata metadata;
42}; 41};
43 42
44bool ecordova_contactfield_import(Ecordova_ContactField *, contacts_record_h, const Ecordova_ContactField_Metadata); 43Eina_Bool ecordova_contactfield_import(Ecordova_ContactField *, contacts_record_h, const Ecordova_ContactField_Metadata);
45bool ecordova_contactfield_export(Ecordova_ContactField *, contacts_record_h, const Ecordova_ContactField_Metadata); 44Eina_Bool ecordova_contactfield_export(Ecordova_ContactField *, contacts_record_h, const Ecordova_ContactField_Metadata);
46 45
47char *ecordova_contactnumber_type2label(int, const char *); 46char *ecordova_contactnumber_type2label(int, const char *);
48int ecordova_contactnumber_label2type(const char *); 47int ecordova_contactnumber_label2type(const char *);
diff --git a/src/modules/ecordova/tizen/ecordova_contactname.c b/src/modules/ecordova/tizen/ecordova_contactname.c
index 655cee87a0..d44d0d0bb5 100644
--- a/src/modules/ecordova/tizen/ecordova_contactname.c
+++ b/src/modules/ecordova/tizen/ecordova_contactname.c
@@ -8,7 +8,6 @@
8#include "ecordova_contacts_record_utils.h" 8#include "ecordova_contacts_record_utils.h"
9#include "ecordova_contactname.eo.h" 9#include "ecordova_contactname.eo.h"
10 10
11#include <stdbool.h>
12#include <stdint.h> 11#include <stdint.h>
13#include <stdlib.h> 12#include <stdlib.h>
14 13
@@ -23,6 +22,7 @@ _ecordova_contactname_eo_base_constructor(Eo *obj,
23 22
24 pd->obj = obj; 23 pd->obj = obj;
25 pd->record = NULL; 24 pd->record = NULL;
25
26 int ret = contacts_record_create(_contacts_name._uri, &pd->record); 26 int ret = contacts_record_create(_contacts_name._uri, &pd->record);
27 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 27 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
28 28
@@ -30,31 +30,11 @@ _ecordova_contactname_eo_base_constructor(Eo *obj,
30} 30}
31 31
32static void 32static void
33_ecordova_contactname_constructor(Eo *obj,
34 Ecordova_ContactName_Data *pd EINA_UNUSED,
35 const char *formatted,
36 const char *family_name,
37 const char *given_name,
38 const char *middle,
39 const char *prefix,
40 const char *suffix)
41{
42 DBG("(%p)", obj);
43 eo_do(obj,
44 ecordova_contactname_formatted_set(formatted),
45 ecordova_contactname_family_name_set(family_name),
46 ecordova_contactname_given_name_set(given_name),
47 ecordova_contactname_middle_set(middle),
48 ecordova_contactname_prefix_set(prefix),
49 ecordova_contactname_suffix_set(suffix));
50}
51
52static void
53_ecordova_contactname_eo_base_destructor(Eo *obj, Ecordova_ContactName_Data *pd) 33_ecordova_contactname_eo_base_destructor(Eo *obj, Ecordova_ContactName_Data *pd)
54{ 34{
55 DBG("(%p)", obj); 35 DBG("(%p)", obj);
56 36
57 int ret = contacts_record_destroy(pd->record, true); 37 int ret = contacts_record_destroy(pd->record, EINA_TRUE);
58 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 38 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
59 39
60 eo_do_super(obj, MY_CLASS, eo_destructor()); 40 eo_do_super(obj, MY_CLASS, eo_destructor());
@@ -176,15 +156,15 @@ _ecordova_contactname_suffix_set(Eo *obj EINA_UNUSED,
176 set_str(pd->record, _contacts_name.suffix, value); 156 set_str(pd->record, _contacts_name.suffix, value);
177} 157}
178 158
179bool 159Eina_Bool
180ecordova_contactname_import(Ecordova_ContactName *obj, 160ecordova_contactname_import(Ecordova_ContactName *obj,
181 contacts_record_h contacts_record) 161 contacts_record_h contacts_record)
182{ 162{
183 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 163 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
184 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, false); 164 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, EINA_FALSE);
185 165
186 Ecordova_ContactName_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTNAME_CLASS); 166 Ecordova_ContactName_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTNAME_CLASS);
187 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 167 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
188 168
189 int ret; 169 int ret;
190 170
@@ -192,48 +172,48 @@ ecordova_contactname_import(Ecordova_ContactName *obj,
192 ret = contacts_record_get_child_record_count(contacts_record, 172 ret = contacts_record_get_child_record_count(contacts_record,
193 _contacts_contact.name, 173 _contacts_contact.name,
194 &count); 174 &count);
195 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 175 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
196 EINA_SAFETY_ON_FALSE_RETURN_VAL(count == 1, false); 176 EINA_SAFETY_ON_FALSE_RETURN_VAL(count == 1, EINA_FALSE);
197 177
198 contacts_record_h contactname_record = NULL; 178 contacts_record_h contactname_record = NULL;
199 ret = contacts_record_get_child_record_at_p(contacts_record, 179 ret = contacts_record_get_child_record_at_p(contacts_record,
200 _contacts_contact.name, 180 _contacts_contact.name,
201 0, 181 0,
202 &contactname_record); 182 &contactname_record);
203 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 183 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
204 184
205 ret = contacts_record_destroy(pd->record, true); 185 ret = contacts_record_destroy(pd->record, EINA_TRUE);
206 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 186 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
207 ret = contacts_record_clone(contactname_record, &pd->record); 187 ret = contacts_record_clone(contactname_record, &pd->record);
208 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 188 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
209 189
210 // TODO: check display name 190 // TODO: check display name
211 191
212 return true; 192 return EINA_TRUE;
213} 193}
214 194
215bool 195Eina_Bool
216ecordova_contactname_export(Ecordova_ContactName *obj, 196ecordova_contactname_export(Ecordova_ContactName *obj,
217 contacts_record_h contacts_record) 197 contacts_record_h contacts_record)
218{ 198{
219 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 199 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
220 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, false); 200 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, EINA_FALSE);
221 201
222 Ecordova_ContactName_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTNAME_CLASS); 202 Ecordova_ContactName_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTNAME_CLASS);
223 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 203 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
224 204
225 contacts_record_h contactname_record = NULL; 205 contacts_record_h contactname_record = NULL;
226 int ret = contacts_record_clone(pd->record, &contactname_record); 206 int ret = contacts_record_clone(pd->record, &contactname_record);
227 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 207 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
228 208
229 ret = contacts_record_add_child_record(contacts_record, 209 ret = contacts_record_add_child_record(contacts_record,
230 _contacts_contact.name, 210 _contacts_contact.name,
231 contactname_record); 211 contactname_record);
232 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 212 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
233 213
234 // TODO: check display name 214 // TODO: check display name
235 215
236 return true; 216 return EINA_TRUE;
237} 217}
238 218
239Ecordova_ContactName * 219Ecordova_ContactName *
@@ -246,7 +226,7 @@ ecordova_contactname_clone(Ecordova_ContactName *other)
246 Ecordova_ContactName_Data *other_pd = eo_data_scope_get(other, ECORDOVA_CONTACTNAME_CLASS); 226 Ecordova_ContactName_Data *other_pd = eo_data_scope_get(other, ECORDOVA_CONTACTNAME_CLASS);
247 EINA_SAFETY_ON_NULL_RETURN_VAL(other_pd, NULL); 227 EINA_SAFETY_ON_NULL_RETURN_VAL(other_pd, NULL);
248 228
249 int ret = contacts_record_destroy(cloned_pd->record, true); 229 int ret = contacts_record_destroy(cloned_pd->record, EINA_TRUE);
250 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 230 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
251 ret = contacts_record_clone(other_pd->record, &cloned_pd->record); 231 ret = contacts_record_clone(other_pd->record, &cloned_pd->record);
252 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 232 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
diff --git a/src/modules/ecordova/tizen/ecordova_contactname_private.h b/src/modules/ecordova/tizen/ecordova_contactname_private.h
index ccdcd61cb8..6c11f9a223 100644
--- a/src/modules/ecordova/tizen/ecordova_contactname_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactname_private.h
@@ -5,7 +5,6 @@
5#include "ecordova_contactname.eo.h" 5#include "ecordova_contactname.eo.h"
6 6
7#include <contacts.h> 7#include <contacts.h>
8#include <stdbool.h>
9 8
10typedef struct _Ecordova_ContactName_Data Ecordova_ContactName_Data; 9typedef struct _Ecordova_ContactName_Data Ecordova_ContactName_Data;
11 10
@@ -18,8 +17,8 @@ struct _Ecordova_ContactName_Data
18 contacts_record_h record; 17 contacts_record_h record;
19}; 18};
20 19
21bool ecordova_contactname_import(Ecordova_ContactName *, contacts_record_h); 20Eina_Bool ecordova_contactname_import(Ecordova_ContactName *, contacts_record_h);
22bool ecordova_contactname_export(Ecordova_ContactName *, contacts_record_h); 21Eina_Bool ecordova_contactname_export(Ecordova_ContactName *, contacts_record_h);
23Ecordova_ContactName *ecordova_contactname_clone(Ecordova_ContactName *); 22Ecordova_ContactName *ecordova_contactname_clone(Ecordova_ContactName *);
24 23
25#endif 24#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactorganization.c b/src/modules/ecordova/tizen/ecordova_contactorganization.c
index b6df0db035..e981cb920f 100644
--- a/src/modules/ecordova/tizen/ecordova_contactorganization.c
+++ b/src/modules/ecordova/tizen/ecordova_contactorganization.c
@@ -6,7 +6,6 @@
6#include "ecordova_contactorganization_private.h" 6#include "ecordova_contactorganization_private.h"
7#include "ecordova_contacts_record_utils.h" 7#include "ecordova_contacts_record_utils.h"
8 8
9#include <stdbool.h>
10#include <stdint.h> 9#include <stdint.h>
11#include <stdlib.h> 10#include <stdlib.h>
12 11
@@ -29,29 +28,12 @@ _ecordova_contactorganization_eo_base_constructor(Eo *obj,
29} 28}
30 29
31static void 30static void
32_ecordova_contactorganization_constructor(Eo *obj,
33 Ecordova_ContactOrganization_Data *pd EINA_UNUSED,
34 Eina_Bool pref EINA_UNUSED,
35 const char *type,
36 const char *name,
37 const char *dept,
38 const char *title)
39{
40 DBG("(%p)", obj);
41 eo_do(obj,
42 ecordova_contactorganization_type_set(type),
43 ecordova_contactorganization_name_set(name),
44 ecordova_contactorganization_dept_set(dept),
45 ecordova_contactorganization_title_set(title));
46}
47
48static void
49_ecordova_contactorganization_eo_base_destructor(Eo *obj, 31_ecordova_contactorganization_eo_base_destructor(Eo *obj,
50 Ecordova_ContactOrganization_Data *pd) 32 Ecordova_ContactOrganization_Data *pd)
51{ 33{
52 DBG("(%p)", obj); 34 DBG("(%p)", obj);
53 35
54 int ret = contacts_record_destroy(pd->record, true); 36 int ret = contacts_record_destroy(pd->record, EINA_TRUE);
55 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 37 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
56 38
57 eo_do_super(obj, MY_CLASS, eo_destructor()); 39 eo_do_super(obj, MY_CLASS, eo_destructor());
@@ -172,44 +154,44 @@ _ecordova_contactorganization_title_set(Eo *obj EINA_UNUSED,
172 set_str(pd->record, _contacts_company.job_title, value); 154 set_str(pd->record, _contacts_company.job_title, value);
173} 155}
174 156
175bool 157Eina_Bool
176ecordova_contactorganization_import(Ecordova_ContactOrganization *obj, 158ecordova_contactorganization_import(Ecordova_ContactOrganization *obj,
177 contacts_record_h child_record) 159 contacts_record_h child_record)
178{ 160{
179 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 161 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
180 EINA_SAFETY_ON_NULL_RETURN_VAL(child_record, false); 162 EINA_SAFETY_ON_NULL_RETURN_VAL(child_record, EINA_FALSE);
181 163
182 Ecordova_ContactOrganization_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTORGANIZATION_CLASS); 164 Ecordova_ContactOrganization_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTORGANIZATION_CLASS);
183 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 165 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
184 166
185 int ret = contacts_record_destroy(pd->record, true); 167 int ret = contacts_record_destroy(pd->record, EINA_TRUE);
186 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 168 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
187 ret = contacts_record_clone(child_record, &pd->record); 169 ret = contacts_record_clone(child_record, &pd->record);
188 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 170 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
189 171
190 return get_int(child_record, _contacts_company.id, &pd->id); 172 return get_int(child_record, _contacts_company.id, &pd->id);
191} 173}
192 174
193bool 175Eina_Bool
194ecordova_contactorganization_export(Ecordova_ContactOrganization *obj, 176ecordova_contactorganization_export(Ecordova_ContactOrganization *obj,
195 contacts_record_h contacts_record) 177 contacts_record_h contacts_record)
196{ 178{
197 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, false); 179 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
198 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, false); 180 EINA_SAFETY_ON_NULL_RETURN_VAL(contacts_record, EINA_FALSE);
199 181
200 Ecordova_ContactOrganization_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTORGANIZATION_CLASS); 182 Ecordova_ContactOrganization_Data *pd = eo_data_scope_get(obj, ECORDOVA_CONTACTORGANIZATION_CLASS);
201 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, false); 183 EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_FALSE);
202 184
203 contacts_record_h child_record = NULL; 185 contacts_record_h child_record = NULL;
204 int ret = contacts_record_clone(pd->record, &child_record); 186 int ret = contacts_record_clone(pd->record, &child_record);
205 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 187 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
206 188
207 ret = contacts_record_add_child_record(contacts_record, 189 ret = contacts_record_add_child_record(contacts_record,
208 _contacts_contact.company, 190 _contacts_contact.company,
209 child_record); 191 child_record);
210 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 192 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
211 193
212 return true; 194 return EINA_TRUE;
213} 195}
214 196
215Ecordova_ContactOrganization * 197Ecordova_ContactOrganization *
@@ -222,7 +204,7 @@ ecordova_contactorganization_clone(Ecordova_ContactOrganization *other)
222 Ecordova_ContactOrganization_Data *other_pd = eo_data_scope_get(other, ECORDOVA_CONTACTORGANIZATION_CLASS); 204 Ecordova_ContactOrganization_Data *other_pd = eo_data_scope_get(other, ECORDOVA_CONTACTORGANIZATION_CLASS);
223 EINA_SAFETY_ON_NULL_RETURN_VAL(other_pd, NULL); 205 EINA_SAFETY_ON_NULL_RETURN_VAL(other_pd, NULL);
224 206
225 int ret = contacts_record_destroy(cloned_pd->record, true); 207 int ret = contacts_record_destroy(cloned_pd->record, EINA_TRUE);
226 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 208 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
227 ret = contacts_record_clone(other_pd->record, &cloned_pd->record); 209 ret = contacts_record_clone(other_pd->record, &cloned_pd->record);
228 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL); 210 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, NULL);
diff --git a/src/modules/ecordova/tizen/ecordova_contactorganization_private.h b/src/modules/ecordova/tizen/ecordova_contactorganization_private.h
index 643b11792d..ac9381b58b 100644
--- a/src/modules/ecordova/tizen/ecordova_contactorganization_private.h
+++ b/src/modules/ecordova/tizen/ecordova_contactorganization_private.h
@@ -18,8 +18,8 @@ struct _Ecordova_ContactOrganization_Data
18 contacts_record_h record; 18 contacts_record_h record;
19}; 19};
20 20
21bool ecordova_contactorganization_import(Ecordova_ContactOrganization *, contacts_record_h); 21Eina_Bool ecordova_contactorganization_import(Ecordova_ContactOrganization *, contacts_record_h);
22bool ecordova_contactorganization_export(Ecordova_ContactOrganization *, contacts_record_h); 22Eina_Bool ecordova_contactorganization_export(Ecordova_ContactOrganization *, contacts_record_h);
23Ecordova_ContactOrganization *ecordova_contactorganization_clone(Ecordova_ContactOrganization *); 23Ecordova_ContactOrganization *ecordova_contactorganization_clone(Ecordova_ContactOrganization *);
24 24
25#endif 25#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contacts.c b/src/modules/ecordova/tizen/ecordova_contacts.c
index 845907b880..0d1d24510b 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts.c
+++ b/src/modules/ecordova/tizen/ecordova_contacts.c
@@ -9,7 +9,6 @@
9 9
10#include <contacts.h> 10#include <contacts.h>
11 11
12#include <stdbool.h>
13#include <stdint.h> 12#include <stdint.h>
14#include <stdlib.h> 13#include <stdlib.h>
15 14
@@ -34,8 +33,8 @@ typedef enum Contacts_Search_Id {
34 33
35static contacts_filter_h _filter_get(contacts_filter_h *, const char *); 34static contacts_filter_h _filter_get(contacts_filter_h *, const char *);
36static contacts_list_h _get_records(const Eina_List *, const Ecordova_Contacts_FindOptions *); 35static contacts_list_h _get_records(const Eina_List *, const Ecordova_Contacts_FindOptions *);
37static bool _search_records(contacts_filter_h, const char *, contacts_list_h *, Eina_Bool); 36static Eina_Bool _search_records(contacts_filter_h, const char *, contacts_list_h *, Eina_Bool);
38static bool _populate_list(contacts_list_h, Eina_Hash *, contacts_filter_h, const char *, int, Eina_Bool); 37static Eina_Bool _populate_list(contacts_list_h, Eina_Hash *, contacts_filter_h, const char *, int, Eina_Bool);
39 38
40static Eo_Base * 39static Eo_Base *
41_ecordova_contacts_eo_base_constructor(Eo *obj, Ecordova_Contacts_Data *pd) 40_ecordova_contacts_eo_base_constructor(Eo *obj, Ecordova_Contacts_Data *pd)
@@ -48,13 +47,6 @@ _ecordova_contacts_eo_base_constructor(Eo *obj, Ecordova_Contacts_Data *pd)
48} 47}
49 48
50static void 49static void
51_ecordova_contacts_constructor(Eo *obj EINA_UNUSED,
52 Ecordova_Contacts_Data *pd EINA_UNUSED)
53{
54 DBG("(%p)", obj);
55}
56
57static void
58_ecordova_contacts_eo_base_destructor(Eo *obj, 50_ecordova_contacts_eo_base_destructor(Eo *obj,
59 Ecordova_Contacts_Data *pd EINA_UNUSED) 51 Ecordova_Contacts_Data *pd EINA_UNUSED)
60{ 52{
@@ -154,7 +146,7 @@ _ecordova_contacts_find(Eo *obj,
154 eo_unref(contact); 146 eo_unref(contact);
155 eina_array_free(contacts); 147 eina_array_free(contacts);
156 148
157 ret = contacts_list_destroy(list, true); 149 ret = contacts_list_destroy(list, EINA_TRUE);
158 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret); 150 EINA_SAFETY_ON_FALSE_RETURN(CONTACTS_ERROR_NONE == ret);
159} 151}
160 152
@@ -371,7 +363,7 @@ _get_records(const Eina_List *fields,
371 } 363 }
372 364
373 int id; 365 int id;
374 bool ok = get_int(record, _contacts_contact.id, &id); 366 Eina_Bool ok = get_int(record, _contacts_contact.id, &id);
375 EINA_SAFETY_ON_FALSE_GOTO(ok, on_error_2); 367 EINA_SAFETY_ON_FALSE_GOTO(ok, on_error_2);
376 368
377 ok = eina_hash_add(contact_ids, &id, &id) == EINA_TRUE; 369 ok = eina_hash_add(contact_ids, &id, &id) == EINA_TRUE;
@@ -418,7 +410,7 @@ on_error_1:
418 return list; 410 return list;
419} 411}
420 412
421static bool 413static Eina_Bool
422_search_records(contacts_filter_h filter, 414_search_records(contacts_filter_h filter,
423 const char *uri, 415 const char *uri,
424 contacts_list_h *list, 416 contacts_list_h *list,
@@ -428,7 +420,7 @@ _search_records(contacts_filter_h filter,
428 contacts_query_h query = NULL; 420 contacts_query_h query = NULL;
429 421
430 ret = contacts_query_create(uri, &query); 422 ret = contacts_query_create(uri, &query);
431 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 423 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
432 424
433 ret = contacts_query_set_filter(query, filter); 425 ret = contacts_query_set_filter(query, filter);
434 EINA_SAFETY_ON_FALSE_GOTO(CONTACTS_ERROR_NONE == ret, on_error_1); 426 EINA_SAFETY_ON_FALSE_GOTO(CONTACTS_ERROR_NONE == ret, on_error_1);
@@ -438,20 +430,20 @@ _search_records(contacts_filter_h filter,
438 430
439 ret = contacts_query_destroy(query); 431 ret = contacts_query_destroy(query);
440 EINA_SAFETY_ON_FALSE_GOTO(CONTACTS_ERROR_NONE == ret, on_error_2); 432 EINA_SAFETY_ON_FALSE_GOTO(CONTACTS_ERROR_NONE == ret, on_error_2);
441 return true; 433 return EINA_TRUE;
442 434
443on_error_2: 435on_error_2:
444 ret = contacts_list_destroy(*list, true); 436 ret = contacts_list_destroy(*list, EINA_TRUE);
445 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 437 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
446 *list = NULL; 438 *list = NULL;
447 439
448on_error_1: 440on_error_1:
449 ret = contacts_query_destroy(query); 441 ret = contacts_query_destroy(query);
450 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 442 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
451 return false; 443 return EINA_FALSE;
452} 444}
453 445
454static bool 446static Eina_Bool
455_populate_list(contacts_list_h list, 447_populate_list(contacts_list_h list,
456 Eina_Hash *contact_ids, 448 Eina_Hash *contact_ids,
457 contacts_filter_h filter, 449 contacts_filter_h filter,
@@ -461,7 +453,7 @@ _populate_list(contacts_list_h list,
461{ 453{
462 contacts_list_h sub_list = NULL; 454 contacts_list_h sub_list = NULL;
463 if (!_search_records(filter, uri, &sub_list, multiple)) 455 if (!_search_records(filter, uri, &sub_list, multiple))
464 return false; 456 return EINA_FALSE;
465 457
466 unsigned int contact_id[SEARCH_ID_COUNT] = { 458 unsigned int contact_id[SEARCH_ID_COUNT] = {
467 [SEARCH_CONTACT] = _contacts_contact.id, 459 [SEARCH_CONTACT] = _contacts_contact.id,
@@ -479,7 +471,7 @@ _populate_list(contacts_list_h list,
479 }; 471 };
480 472
481 int ret; 473 int ret;
482 bool result = true; 474 Eina_Bool result = EINA_TRUE;
483 do 475 do
484 { 476 {
485 contacts_record_h record = NULL; 477 contacts_record_h record = NULL;
@@ -512,8 +504,8 @@ _populate_list(contacts_list_h list,
512 } while (multiple && contacts_list_next(sub_list) == CONTACTS_ERROR_NONE); 504 } while (multiple && contacts_list_next(sub_list) == CONTACTS_ERROR_NONE);
513 505
514on_error: 506on_error:
515 ret = contacts_list_destroy(sub_list, true); 507 ret = contacts_list_destroy(sub_list, EINA_TRUE);
516 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 508 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
517 return result; 509 return result;
518} 510}
519 511
diff --git a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
index b813779840..98fb688221 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
+++ b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
@@ -7,90 +7,90 @@
7 7
8#include <Eina.h> 8#include <Eina.h>
9 9
10bool 10Eina_Bool
11get_str(contacts_record_h record, unsigned int property_id, char **value) 11get_str(contacts_record_h record, unsigned int property_id, char **value)
12{ 12{
13 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 13 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
14 14
15 int ret = contacts_record_get_str(record, property_id, value); 15 int ret = contacts_record_get_str(record, property_id, value);
16 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 16 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
17 17
18 return true; 18 return EINA_TRUE;
19} 19}
20 20
21bool 21Eina_Bool
22get_str_p(contacts_record_h record, unsigned int property_id, const char **value) 22get_str_p(contacts_record_h record, unsigned int property_id, const char **value)
23{ 23{
24 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 24 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
25 25
26 int ret = contacts_record_get_str_p(record, property_id, (char**)value); 26 int ret = contacts_record_get_str_p(record, property_id, (char**)value);
27 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 27 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
28 28
29 return true; 29 return EINA_TRUE;
30} 30}
31 31
32bool 32Eina_Bool
33set_str(contacts_record_h record, unsigned int property_id, const char *value) 33set_str(contacts_record_h record, unsigned int property_id, const char *value)
34{ 34{
35 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 35 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
36 36
37 int ret = contacts_record_set_str(record, property_id, value); 37 int ret = contacts_record_set_str(record, property_id, value);
38 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 38 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
39 39
40 return true; 40 return EINA_TRUE;
41} 41}
42 42
43bool 43Eina_Bool
44get_int(contacts_record_h record, unsigned int property_id, int *value) 44get_int(contacts_record_h record, unsigned int property_id, int *value)
45{ 45{
46 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 46 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
47 47
48 int ret = contacts_record_get_int(record, property_id, value); 48 int ret = contacts_record_get_int(record, property_id, value);
49 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 49 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
50 50
51 return true; 51 return EINA_TRUE;
52} 52}
53 53
54bool 54Eina_Bool
55set_int(contacts_record_h record, unsigned int property_id, int value) 55set_int(contacts_record_h record, unsigned int property_id, int value)
56{ 56{
57 EINA_SAFETY_ON_NULL_RETURN_VAL(record, false); 57 EINA_SAFETY_ON_NULL_RETURN_VAL(record, EINA_FALSE);
58 58
59 int ret = contacts_record_set_int(record, property_id, value); 59 int ret = contacts_record_set_int(record, property_id, value);
60 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, false); 60 EINA_SAFETY_ON_FALSE_RETURN_VAL(CONTACTS_ERROR_NONE == ret, EINA_FALSE);
61 61
62 return true; 62 return EINA_TRUE;
63} 63}
64 64
65bool 65Eina_Bool
66get_bool(contacts_record_h record, unsigned int property_id, Eina_Bool *value) 66get_bool(contacts_record_h record, unsigned int property_id, Eina_Bool *value)
67{ 67{