132 "proto": __device_contacts, |
132 "proto": __device_contacts, |
133 "descriptor": __device_contacts_descriptor, |
133 "descriptor": __device_contacts_descriptor, |
134 "providers": [{"descriptor": __sp_contacts_descriptor, "instance": __sp_contacts_instance}] |
134 "providers": [{"descriptor": __sp_contacts_descriptor, "instance": __sp_contacts_instance}] |
135 }; |
135 }; |
136 |
136 |
137 |
137 |
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 /* |
|
155 Copyright © 2009 Nokia. All rights reserved. |
|
156 Code licensed under the BSD License: |
|
157 Software License Agreement (BSD License) Copyright © 2009 Nokia. |
|
158 All rights reserved. |
|
159 Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
|
160 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
|
161 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
|
162 Neither the name of Nokia Corporation. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Nokia Corporation. |
|
163 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
164 version: 1.0 |
|
165 */ |
|
166 // Table of user callbacks. These are "indexed" by transaction IDs. |
|
167 // These need to be global since the actual sp callback does |
|
168 // not have the location instance object in its scope chain |
|
169 |
|
170 /* |
|
171 if((typeof (com.nokia.device.contacts) == 'undefined')) |
|
172 { |
|
173 com.nokia.device.contacts = {}; |
|
174 }*/ |
|
175 nokia.device.contacts.SORT_ASCENDING = 0; |
|
176 nokia.device.contacts.SORT_DESCENDING = 1; |
|
177 |
|
178 |
|
179 //nokia.devive. |
|
180 //SORT_ASCENDING = 0; |
|
181 //SORT_DESCENDING = 1; |
|
182 |
138 |
183 function __sp_contacts_descriptor(){ |
139 function __sp_contacts_descriptor(){ |
184 //Read-only properties |
140 //Read-only properties |
185 this.interfaceName = "contacts"; |
141 this.interfaceName = "contacts"; |
186 if(window.__Service_Interface_Ver){ |
142 if(window.__Service_Interface_Ver){ |
887 } |
843 } |
888 |
844 |
889 function __sp_device_groupinfo_build(sp_group, groupinfo){ |
845 function __sp_device_groupinfo_build(sp_group, groupinfo){ |
890 __s60_enumerate_group_object(sp_group, __sp_device_groupinfo_extract, groupinfo); |
846 __s60_enumerate_group_object(sp_group, __sp_device_groupinfo_extract, groupinfo); |
891 } |
847 } |
|
848 |
|
849 //Iterate the group data |
|
850 function __sp_groupinfo_iterator_get_next(){ |
|
851 var sp_group = this.iter.getNext(); |
|
852 if (typeof sp_group == "undefined") { |
|
853 return null; |
|
854 } |
|
855 var rval = {}; |
|
856 __sp_device_groupinfo_build(sp_group, rval); |
|
857 sp_group.close(); |
|
858 return rval; |
|
859 } |
|
860 |
|
861 function __sp_groupinfo_iterator(js_iterator){ |
|
862 this.iter = js_iterator; |
|
863 this.next = __sp_groupinfo_iterator_get_next; |
|
864 this.close = function(){ |
|
865 this.iter.close(); |
|
866 }; |
|
867 } |
|
868 |
|
869 |
|
870 |
892 |
871 |
893 |
872 |
894 |
873 |
895 //Build group data |
874 //Build group data |
896 function __sp_device_group_extract(name, value, group){ |
875 function __sp_device_group_extract(name, value, group){ |
1483 return; |
1462 return; |
1484 } |
1463 } |
1485 |
1464 |
1486 iter = arg3.ReturnValue; |
1465 iter = arg3.ReturnValue; |
1487 if (arg3.ReturnValue) { |
1466 if (arg3.ReturnValue) { |
1488 iter = new __sp_group_iterator(arg3.ReturnValue); |
1467 // iter = new __sp_group_iterator(arg3.ReturnValue); |
|
1468 iter = new __sp_groupinfo_iterator(arg3.ReturnValue); |
|
1469 |
1489 } |
1470 } |
1490 else |
1471 else |
1491 if (arg3.ErrorCode != 0) { |
1472 if (arg3.ErrorCode != 0) { |
1492 var err_msg; |
1473 var err_msg; |
1493 if (arg3.ErrorMessage) |
1474 if (arg3.ErrorMessage) |
2321 } |
2302 } |
2322 |
2303 |
2323 |
2304 |
2324 function mappingVerification(errorCode){ |
2305 function mappingVerification(errorCode){ |
2325 //alert ("In mappingVerification errorCode = "+errorCode); |
2306 //alert ("In mappingVerification errorCode = "+errorCode); |
2326 if (errorCode === 1016 || errorCode === 1012 || errorCode === 1010 || errorCode === 1009 || errorCode === 1005 || errorCode === 1000 || errorCode === 1011 || errorCode === 1007 || errorCode === 1003 || errorCode === 1002) { |
2307 if (errorCode === 1016 || errorCode === 1012 || errorCode === 1010 || errorCode === 1009 || errorCode === 1005 || errorCode === 1000 || errorCode === 1011 || errorCode === 1007 || errorCode === 1003 || errorCode === 1002 || errorCode === 1004 ) { |
2327 //alert("errorCode = "+errorCode); |
2308 //alert("errorCode = "+errorCode); |
2328 return true; |
2309 return true; |
2329 } |
2310 } |
2330 else { |
2311 else { |
2331 //alert("In mappingVerification errorCode **else part**"); |
2312 //alert("In mappingVerification errorCode **else part**"); |