serviceproviders/sapi_location/locationservice/inc/locationservice.h
changeset 22 fc9cf246af83
parent 19 989d2f495d90
child 32 8d692d9f828f
equal deleted inserted replaced
19:989d2f495d90 22:fc9cf246af83
    26  * client and will be passed onto location server
    26  * client and will be passed onto location server
    27  */
    27  */
    28 
    28 
    29 _LIT(KIdentity,"Location SAPI");
    29 _LIT(KIdentity,"Location SAPI");
    30 
    30 
    31 /**
       
    32  * Key for locating active objects associated with async request in registration table
       
    33  *
       
    34  * @ 0 for  Getlocation async Active object
       
    35  * @ 1 for Trace async active object
       
    36  */
       
    37  
       
    38 const TInt KARRAY_INDEX_GETLOCATION = 0 ;
       
    39 const TInt KARRAY_INDEX_TRACE       = 1 ; 
       
    40 
       
    41 
    31 
    42 
    32 
    43 /**
    33 /**
    44  * Key for locating location information in CLiwGenericParamList
    34  * Key for locating location information in CLiwGenericParamList
    45  */
    35  */
    46 _LIT8(KLongitudeKey,"Longitude") ;
    36 _LIT8(KLongitudeKey,"Longitude") ;
    47 _LIT8(KLatitudeKey , "Latitude") ;
    37 _LIT8(KLatitudeKey , "Latitude") ;
    48 _LIT8(KAltitudeKey , "Altitude") ;
    38 _LIT8(KAltitudeKey , "Altitude") ;
       
    39 _LIT8(KHorAccuracy,"HorizontalAccuracy");
       
    40 _LIT8(KVerAccuracy,"VerticalAccuracy");
    49 
    41 
    50 _LIT(KUnknown,"Unknown");
    42 _LIT(KUnknown,"Unknown");
    51 
    43 
    52 /**
    44 /**
    53  * Default Update options
    45  * Default Update options
    61 //Update time out
    53 //Update time out
    62 const TInt KSUpdateTimeOut = 15*KSSecond;
    54 const TInt KSUpdateTimeOut = 15*KSSecond;
    63 
    55 
    64 //MaxAge
    56 //MaxAge
    65 const TInt KSMaxAge = 0;
    57 const TInt KSMaxAge = 0;
       
    58 const TInt KGetLocationReq = 0 ;
       
    59 const TInt KTraceReq   = 1 ;
    66 
    60 
    67 /**
    61 /**
    68  * Enums required for mathoperations
    62  * Enums required for mathoperations
    69  */
    63  */
    70 enum TMathOperationChoice
    64 enum TMathOperationChoice
   136      * @see HPositionGenericInfo in LbsPositionInfo.h for details
   130      * @see HPositionGenericInfo in LbsPositionInfo.h for details
   137      *
   131      *
   138      */
   132      */
   139     public :
   133     public :
   140     virtual TInt HandleNotifyL(HPositionGenericInfo* aOutPos , TInt aError) = 0 ;
   134     virtual TInt HandleNotifyL(HPositionGenericInfo* aOutPos , TInt aError) = 0 ;
       
   135     /*
       
   136      * To be implemented by every class that derives from this. This function should return 
       
   137      * the Async Request type for which this callback is used.
       
   138      */ 
       
   139     
       
   140     virtual TUint GetRequestType(void) = 0; 
       
   141     
       
   142     /*
       
   143      * To be implemented by every class that derives from this. This returns the 
       
   144      * TransactionId associated with the Async request for which this Callback
       
   145      * object is used.
       
   146      */
       
   147     
       
   148     virtual TInt32 GetTransactionId(void) = 0;
       
   149     
       
   150     
       
   151     virtual ~MLocationCallBack(){}
   141     };
   152     };
   142 
   153 
   143 
   154 
   144 /**
   155 /**
   145  * CLocationService class : This is a wrapper class for the Functionalities 
   156  * CLocationService class : This is a wrapper class for the Functionalities 
   174 	    /**
   185 	    /**
   175 	     * Synchronous get location with update options returns current location of the user
   186 	     * Synchronous get location with update options returns current location of the user
   176 	     *
   187 	     *
   177 	     * @param aPosinfobase input TPositionInfoBase object which will hold location details
   188 	     * @param aPosinfobase input TPositionInfoBase object which will hold location details
   178 	     * @param aUpdateOpts updateoptions for synchronous calls 
   189 	     * @param aUpdateOpts updateoptions for synchronous calls 
   179 	     */
   190 	     * @param aEnableHighAcc - Tells whether to use greater accuracy modules to obtain updates
   180 	    IMPORT_C TInt GetLocationL( TPositionInfoBase* aPos ,
   191 	     */
   181 	    							const TPositionUpdateOptions* aUpdateOpts= NULL ) ;
   192 	    IMPORT_C void GetLocationL( TPositionInfoBase* aPos ,
       
   193 	    							const TPositionUpdateOptions* aUpdateOpts= NULL,
       
   194 	    							TBool aEnableHighAcc = false ) ;
   182 	    							
   195 	    							
   183 
   196 
   184 	    /**
   197 	    /**
   185 	     * Gets the current location of user asynchronosly calls the users callback handle on reciving 
   198 	     * Gets the current location of user asynchronosly calls the users callback handle on reciving 
   186 	     * location updates
   199 	     * location updates
   187 	     * @param aCallBack callback object after reciving the position updates 
   200 	     * @param aCallBack callback object after reciving the position updates 
   188 	     * @param aLocationInfoCategory specifying one of the enumeration in TLocationInfoType.
   201 	     * @param aLocationInfoCategory specifying one of the enumeration in TLocationInfoType.
   189 	     * @param aFieldIdList specifies field of HPositionGenericInfo that user intend to retrieve.
   202 	     * @param aFieldIdList specifies field of HPositionGenericInfo that user intend to retrieve.
   190 	     * @param aUpdateoptions update options for asynchronous requests.
   203 	     * @param aUpdateoptions update options for asynchronous requests.
       
   204 	     * @param aEnableHighAcc - Tells whether to use greater accuracy modules to obtain updates
   191 	     * @see Lsbcommon.h for details of TPositionFieldIdList and TPositionUpdateOptions
   205 	     * @see Lsbcommon.h for details of TPositionFieldIdList and TPositionUpdateOptions
   192 	     */
   206 	     */
   193 	    IMPORT_C TInt GetLocationL( MLocationCallBack* aCallBackObj ,
   207 	    IMPORT_C void GetLocationL( MLocationCallBack* aCallBackObj ,
   194 	    							TInt aLocationInfoCategory = 0, 
   208 	    							TInt aLocationInfoCategory = 0, 
   195 	    							TPositionFieldIdList aFieldIdList = NULL ,
   209 	    							TPositionFieldIdList aFieldIdList = NULL ,
   196 	    							const TPositionUpdateOptions* aUpdateopts = NULL
   210 	    							const TPositionUpdateOptions* aUpdateopts = NULL,
       
   211 	    							TBool aEnableHighAcc = false
   197 	    							 );
   212 	    							 );
   198 	    							
   213 	    							
   199 	    /**
   214 	    /**
   200 	     * Gets module information of the Positioning module specified my aModuleId
   215 	     * Gets module information of the Positioning module specified my aModuleId
   201 	     *
   216 	     *
   222 	     *
   237 	     *
   223 	     * @param aCallBackObj callback object after reciving location updates 
   238 	     * @param aCallBackObj callback object after reciving location updates 
   224 	     * @param aLocationInfoCategory specifying one of the enumeration in TLocationInfoType.
   239 	     * @param aLocationInfoCategory specifying one of the enumeration in TLocationInfoType.
   225 	     * @param aFiledList List of position fields that should be retrived 
   240 	     * @param aFiledList List of position fields that should be retrived 
   226 	     * @param aUpdateOptions update options for trace
   241 	     * @param aUpdateOptions update options for trace
   227 	     *
   242 	     * @param aEnableHighAcc Tells whether to use greater accuracy modules to obtain updates
   228 	     * @see Lsbcommon.h for details of TPositionFieldIdList and TPositionUpdateOptions
   243 	     * @see Lsbcommon.h for details of TPositionFieldIdList and TPositionUpdateOptions
   229 	     */ 
   244 	     */ 
   230 
   245 
   231 	    IMPORT_C TInt TraceL(MLocationCallBack* aCallBackObj , 
   246 	    IMPORT_C void TraceL(MLocationCallBack* aCallBackObj , 
   232 	    						TInt aLocationInfoCategory = 0,
   247 	    						TInt aLocationInfoCategory = 0,
   233 	    						TPositionFieldIdList aFiledList = NULL ,
   248 	    						TPositionFieldIdList aFiledList = NULL ,
   234 	    						const TPositionUpdateOptions* aUpateOptions= NULL );
   249 	    						const TPositionUpdateOptions* aUpateOptions= NULL,
       
   250 	    						TBool aEnableHighAcc = false);
   235 	    						
   251 	    						
   236 
   252 
   237 	    /**
   253 	    /**
   238 	     * Method to cancell pending async request
   254 	     * Method to cancell pending async request
   239 	     * 
   255 	     * 
   243 	     */
   259 	     */
   244 
   260 
   245 	     IMPORT_C TInt CancelOnGoingService( TInt aCancelparam ) ;
   261 	     IMPORT_C TInt CancelOnGoingService( TInt aCancelparam ) ;
   246 	    
   262 	    
   247 	    /**
   263 	    /**
       
   264          * Method to cancel pending async request
       
   265          * 
       
   266          * aTransId Transaction Id that was returned for an Async request         
       
   267          */
       
   268 	     IMPORT_C TInt CancelService( TInt aTransId);
       
   269 	     
       
   270 	    /**
   248 	     * Method to fetch last known location from location server
   271 	     * Method to fetch last known location from location server
   249 	     */
   272 	     */
   250 
   273 
   251 	     TInt GetLastKnownLoc( TPosition& aResultPos ) ; 
   274 	     IMPORT_C TInt GetLastKnownLoc( TPosition& aResultPos ) ; 
   252 
   275 
   253 
   276 	     /**
       
   277 	      * Method to obtain the High Accuracy module out of the 
       
   278 	      * currently available modules on the phone
       
   279 	      */
       
   280 	     
       
   281 	     void GetHighAccuracyModuleL(TPositionModuleId* aModId);
   254 
   282 
   255 
   283 
   256 
   284 
   257     protected:
   285     protected:
   258 	    /**
   286 	    /**
   263 	    /**
   291 	    /**
   264 	     * Default constructor 
   292 	     * Default constructor 
   265 	     */
   293 	     */
   266 	    CLocationService() ;  
   294 	    CLocationService() ;  
   267 	    
   295 	    
   268 	    /**
       
   269 	     * Method to initalise class memebers 
       
   270 	     */
       
   271 	    void DoInitialiseL() ;
       
   272 
   296 
   273 	    private :
   297 	    private :
   274 	    
   298 	    
   275 	    /**
   299 	    /**
   276 	     * Subsession used to fetch location information
   300 	     * Subsession used to fetch location information
   287 	    /**
   311 	    /**
   288 	     * Registration table for callbacks
   312 	     * Registration table for callbacks
   289 	     */
   313 	     */
   290 	          
   314 	          
   291 	    RPointerArray<CGetLoc> iRegTable; 
   315 	    RPointerArray<CGetLoc> iRegTable; 
   292 	    TInt iIndex;
       
   293 
   316 
   294 	    
   317 	    
   295 	    /**
   318 	    /**
   296 	     * Module indtifier used by location server for getting location information
   319 	     * Module indtifier used by location server for getting location information
   297 	     */
   320 	     */