sapi_location/inc/locationcb.h
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Header file for location SAPI core implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LOCATIONCB_H
       
    19 #define C_LOCATIONCB_H
       
    20 
       
    21 #include <LiwCommon.h> 
       
    22 #include "locationservice.h"
       
    23 
       
    24 const TInt KGetLocationCB = 0 ;
       
    25 const TInt KTraceCB   = 1 ;
       
    26 
       
    27 /**
       
    28  * CallBack fuction called by core dll locationnservice.lib on reciving
       
    29  * Location updates from location server
       
    30  * Implements HandleNotifyL() from base class MLocationCallBack
       
    31  *
       
    32  * @locationservice.lib dependency
       
    33  * @see MLocationCallBack in locationservice.h for details.
       
    34  */
       
    35 
       
    36 class LocationInterfaceCB : public MLocationCallBack
       
    37     {
       
    38     private :
       
    39     MLiwNotifyCallback  *iCallBack ;
       
    40     CLiwGenericParamList *iOutParmList ;
       
    41     CLiwGenericParamList *iInParmList ;
       
    42     TInt32 iTransactionId  ;
       
    43     TPositionModuleInfo *iModuleInfo ;  
       
    44     TUint iRequestType ;    
       
    45     /**
       
    46 	 * Member variable representing what category of location information user is 
       
    47 	 * interested in
       
    48 	 */
       
    49 	 
       
    50 	 TInt iLocinfoCategory;      
       
    51       
       
    52 
       
    53 
       
    54     /**
       
    55      * Default constructor , to controlled construction
       
    56      */
       
    57     LocationInterfaceCB( ); 
       
    58 
       
    59     /**
       
    60      * Overloaded constructor which registers the callback adders
       
    61      *
       
    62      * @param aCallBack: Callback object after reciving location updates from core class
       
    63      * @param aInParamList: input paramater list for location request 
       
    64      * @param aOutParamList: out put paramater list to be which will contained location information
       
    65      * @param aModuleInfo module information of positioning module used
       
    66      * @param aTransactionId: Tracnsaction Id from recived from LIW 
       
    67      */
       
    68      
       
    69      LocationInterfaceCB( MLiwNotifyCallback* aCallBack , 
       
    70      					  const CLiwGenericParamList* aInParmList ,	
       
    71      				      TPositionModuleInfo* aModuleInfo,
       
    72      				      TInt32 aTransactionId = 0 ) ;
       
    73      				      
       
    74     
       
    75      
       
    76 
       
    77     public :
       
    78 
       
    79     /**
       
    80      * Construction method for call back class
       
    81      *
       
    82      * @param aCallBack: Callback object after reciving location updates from core class
       
    83      * @param aInParamList: input paramater list for location request 
       
    84      * @param aOutParamList: out put paramater list to be which will contained location information
       
    85      * @param aModuleInfo module information of positioning module used
       
    86      * @param aTransactionId: Tracnsaction Id from recived from LIW 
       
    87      */
       
    88 
       
    89     static LocationInterfaceCB * NewL( MLiwNotifyCallback* aCallBack , 
       
    90     									 const CLiwGenericParamList* aInParmList, 
       
    91     									 TPositionModuleInfo* aModuleInfo ,
       
    92     									 TInt32 aTransactionId = 0)  ;
       
    93 
       
    94     /**
       
    95      * Implementaion of HandleNotifyL() derived from  LocationInterfaceCB this function
       
    96      * is called by core dll locationservice.dll on reciving location updates
       
    97      *
       
    98      * @aOutPos GenericPositioninfo class which contains location information
       
    99      * @aError success/failure code passed by core dll.
       
   100      */
       
   101      
       
   102     TInt HandleNotifyL( HPositionGenericInfo* aOutPos , TInt aError ) ;
       
   103     
       
   104     /**
       
   105      * Function to set call back object type (Get location or Trace type), this is needed to 
       
   106      * for sending Event notifications to users(KLiwEventCompleted/KLiwEventInProgress) for
       
   107      * Getlocation and Trace Async calls 
       
   108      *
       
   109      * @aRequestType request type (Getlocation , Trace)
       
   110      */ 
       
   111     
       
   112     inline void SetRequestType(TInt aRequestType)
       
   113         {
       
   114             iRequestType = aRequestType ;
       
   115         }
       
   116     
       
   117     /**
       
   118      * Function to get the type of request(Trace/GetLocation) associated with this async 
       
   119      * object, 
       
   120      */
       
   121      
       
   122      inline TUint GetRequestType(void) 
       
   123         {
       
   124         return iRequestType ;
       
   125         }
       
   126      MLiwNotifyCallback* GetCallBackobj()
       
   127 	     {
       
   128 	     return iCallBack;	
       
   129 	     }
       
   130 
       
   131     /**
       
   132      * GetTransactionId function returns transcation id associated with current async object
       
   133      *
       
   134      */
       
   135      inline TInt32 GetTransactionId(void)
       
   136         {
       
   137           return iTransactionId ;
       
   138         }
       
   139     /**
       
   140      * HandleL, an internal utility funtion which is called by HandleNotifyL method,
       
   141      * This methods encapsulates all the leaving methods which could be traped by 
       
   142      * HandleNotifyL method
       
   143      */
       
   144      
       
   145      void HandleL(HPositionGenericInfo* aOutPos , TInt aError )  ;  
       
   146      
       
   147       
       
   148     /**
       
   149      * destructor 
       
   150      */
       
   151     virtual ~LocationInterfaceCB( ) ;  //Default destructor   
       
   152 
       
   153 
       
   154     };
       
   155 
       
   156 #endif // C_LOCATIONCB_H