serviceproviders/jsapi/platformservices/src/landmarks.js
changeset 55 eaf3908907b6
parent 38 02682e02e51f
equal deleted inserted replaced
54:e7cb6cffd49a 55:eaf3908907b6
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Defination of class CCalendarInterface
    14 * Description:  Defination of class CCalendarInterface
    15 *
    15 *
    16 */
    16 */
    17 
       
    18 // Namepace: com.nokia.device.service
       
    19 
    17 
    20 var __device_landmarks_service_entry = {
    18 var __device_landmarks_service_entry = {
    21     "name": null,
    19     "name": null,
    22     "version": null,
    20     "version": null,
    23     "proto": __device_landmarks,
    21     "proto": __device_landmarks,
   111 function __device_landmarks_cancel(transactionId){
   109 function __device_landmarks_cancel(transactionId){
   112     return this.provider.cancel(transactionId);
   110     return this.provider.cancel(transactionId);
   113 }
   111 }
   114 
   112 
   115 
   113 
   116 
       
   117 
       
   118 /*
       
   119  Copyright � 2009 Nokia. All rights reserved.
       
   120  Code licensed under the BSD License:
       
   121  Software License Agreement (BSD License) Copyright � 2009 Nokia.
       
   122  All rights reserved.
       
   123  Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
       
   124  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
       
   125  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.
       
   126  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.
       
   127  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.
       
   128  version: 1.0
       
   129  */
       
   130 //utillity function for converting error code from PS to CJSE codes
   114 //utillity function for converting error code from PS to CJSE codes
   131 //this gets used in communicating errors via error callback
   115 //this gets used in communicating errors via error callback
   132 var err_missing_argument = 1003;
   116 var err_missing_argument = 1003;
   133 var err_bad_argument = 1002;
   117 var err_bad_argument = 1002;
   134 var err_ServiceNotSupported = 1004;
   118 var err_ServiceNotSupported = 1004;
   318         
   302         
   319     }
   303     }
   320     else {
   304     else {
   321         this.catItem = this.iter.getNext();
   305         this.catItem = this.iter.getNext();
   322         this.hasElement = true;
   306         this.hasElement = true;
   323         if (typeof this.catItem == "undefined") {
   307         if (typeof this.catItem == "undefined" || this.catItem == null) {
   324             this.catItem = null;
   308             this.catItem = null;
   325             return false;
   309             return false;
   326         }
   310         }
   327         else {
   311         else {
   328             return true;
   312             return true;
   337         //update
   321         //update
   338         this.catItem = this.iter.getNext();
   322         this.catItem = this.iter.getNext();
   339         if (typeof(this.catItem) == "undefined") {
   323         if (typeof(this.catItem) == "undefined") {
   340             this.catItem = null;
   324             this.catItem = null;
   341         }
   325         }
   342         return new __sp_device_category_obj(tempitem);
   326         
       
   327         if(tempitem){
       
   328             return new __sp_device_category_obj(tempitem);
       
   329         }
       
   330         else {
       
   331             return null;
       
   332         }
   343     }
   333     }
   344     else {
   334     else {
   345         this.catItem = this.iter.getNext();
   335         this.catItem = this.iter.getNext();
   346         if (typeof this.catItem == "undefined") {
   336         if (typeof this.catItem == "undefined" || this.catItem == null) {
   347             this.hasElement = true;
   337             this.hasElement = true;
   348             this.catItem = null;
   338             this.catItem = null;
   349             return null;
   339             return null;
   350             
       
   351         }
   340         }
   352         else {
   341         else {
   353             this.hasElement = true;
   342             this.hasElement = true;
   354             var tempObject = new Object();
   343             var tempObject = new Object();
   355             tempObject = this.lmItem;
   344             tempObject = this.lmItem;
   405     (location.latitude !== null) &&
   394     (location.latitude !== null) &&
   406     (location.latitude !== "")) {
   395     (location.latitude !== "")) {
   407         this.Latitude = location.latitude;
   396         this.Latitude = location.latitude;
   408     }
   397     }
   409     
   398     
   410     
       
   411     /*if(location.altitude) 
       
   412     
       
   413      this.Altitude = location.altitude;
       
   414     
       
   415      if(location.hAccuracy)
       
   416     
       
   417      this.HAccuracy = location.hAccuracy;
       
   418     
       
   419      if(location.vAccuracy)
       
   420     
       
   421      this.VAccuracy = location.vAccuracy;*/
       
   422     
   399     
   423 }
   400 }
   424 
   401 
   425 //use this to convert from positon filed of landmarkitem to convert it to position field 
   402 //use this to convert from positon filed of landmarkitem to convert it to position field 
   426 //in LIW of landmark item
   403 //in LIW of landmark item
   936         //update
   913         //update
   937         this.lmItem = this.iter.getNext();
   914         this.lmItem = this.iter.getNext();
   938         if (typeof(this.lmItem) == "undefined") {
   915         if (typeof(this.lmItem) == "undefined") {
   939             this.lmItem = null;
   916             this.lmItem = null;
   940         }
   917         }
   941         return new __sp_device_landmark_obj(tempitem);
   918         if(tempitem){
       
   919             return new __sp_device_landmark_obj(tempitem);
       
   920         }
       
   921         else{
       
   922             return null;
       
   923         } 
   942     }
   924     }
   943     else {
   925     else {
   944         this.lmItem = this.iter.getNext();
   926         this.lmItem = this.iter.getNext();
   945         if (typeof this.lmItem == "undefined") {
   927         if (typeof this.lmItem == "undefined" || this.lmItem == null) {
   946             this.hasElement = true;
   928             this.hasElement = true;
   947             this.lmItem = null;
   929             this.lmItem = null;
   948             return null;
   930             return null;
   949             
   931             
   950         }
   932         }
   953             var tempObject = new Object();
   935             var tempObject = new Object();
   954             tempObject = this.lmItem;
   936             tempObject = this.lmItem;
   955             //update 
   937             //update 
   956             
   938             
   957             this.lmItem = this.iter.getNext();
   939             this.lmItem = this.iter.getNext();
   958             if (typeof(this.lmItem) == "undefined") {
   940             if (typeof(this.lmItem) == "undefined" || this.lmItem == null) {
   959                 this.lmItem = null;
   941                 this.lmItem = null;
   960             }
   942             }
   961             return new __sp_device_landmark_obj(tempObject);
   943             return new __sp_device_landmark_obj(tempObject);
   962         }
   944         }
   963     }
   945     }