supl/supltiapiimplementation/inc/lbssupltiapiimplementation.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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 "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: Implementation plugin for supltiapi   
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LBSSUPLTIAPIIMPL_H
       
    19 #define C_LBSSUPLTIAPIIMPL_H
       
    20 
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <lbs/supltiapi.h> //for MLbsSuplTiObserver
       
    24 
       
    25 //Forward Declarations
       
    26 class COMASuplTrace;
       
    27 class CCLbsSuplTiRequestManager;
       
    28 /**
       
    29  * Class:       CLbsSuplTiApiImplementation
       
    30  *
       
    31  * Description: Custom ECOM Implementation. This is used by SUPLTIAPI to
       
    32  *              interact with teminalinitiation library
       
    33  */
       
    34 
       
    35 
       
    36 class CLbsSuplTiApiImplementation : public CLbsSuplTiApi
       
    37     {
       
    38 
       
    39 public: 
       
    40 
       
    41     // Constructors and destructor
       
    42     /**
       
    43      * @Description:    For Two Phase Construction
       
    44      * @Param:          aObserver Reference to the observer to be notified when position request completes
       
    45      * @return:         instance of implementation		
       
    46      *
       
    47      */
       
    48 
       
    49     IMPORT_C   static CLbsSuplTiApiImplementation* NewL(MLbsSuplTiObserver& aObserver);
       
    50 
       
    51     /**
       
    52      * Function:   ~CLbsSuplTiApiImplementation  
       
    53      *
       
    54      * @Description: Destructor method for CLbsSuplTiApiImplementation
       
    55      */
       
    56     IMPORT_C  ~CLbsSuplTiApiImplementation();
       
    57 
       
    58 private:   
       
    59 
       
    60     /**
       
    61      * Function:     CLbsSuplTiApiImplementation 
       
    62      *
       
    63      * @Description: Default constructor
       
    64      * @Param:       aObserver Reference to the observer to be notified when position request completes
       
    65      * @Returns:     None
       
    66      */
       
    67     CLbsSuplTiApiImplementation(MLbsSuplTiObserver& aObserver);
       
    68 
       
    69     /**
       
    70      * Function:     ConstructL
       
    71      *
       
    72      * @Description: For two phase construction 
       
    73      *
       
    74      * @Param:       none
       
    75      *
       
    76      * @Returns:     None
       
    77      */
       
    78 
       
    79     void ConstructL(); 
       
    80 
       
    81 
       
    82 public://from CLbsSuplTiApi
       
    83     /** 
       
    84         Implementation method for CLbsSuplTiApi::RequestLocation()
       
    85         
       
    86         RequestLocation is an asynchronous call to determine the terminal's current
       
    87         position information or to determine additional positioning information such as
       
    88         assistance data.
       
    89 
       
    90         The client can cancel this request using CancelRequest().
       
    91 
       
    92         @param aSessionId is the Id of the location request. This is generated by the client and
       
    93                 must be used by the initiation module when it performs actions releated to that
       
    94                 request.
       
    95         @param aOptions should be of type TLbsNetPosRequestOptions.
       
    96                It provides information about the location request, including quality of the location
       
    97                required, and a flag to indicate this is the first request made by the client.
       
    98         @param aMethod This parameter contains a list of the positioning methods that should be used
       
    99                to obtain the device's position.
       
   100 
       
   101         @see TLbsNetSessionId
       
   102         @see TLbsNetPosRequestOptions
       
   103         @see TLbsNetPosRequestMethod
       
   104      */
       
   105     virtual void RequestLocation(const TLbsNetSessionId& aSessionId, const TLbsNetPosRequestOptionsBase& aOptions, const TLbsNetPosRequestMethod& aMethod);
       
   106 
       
   107 
       
   108     /**
       
   109         Implementation method for CLbsSuplTiApi::CancelRequest()
       
   110         
       
   111         Cancels an outstanding asynchronous location request started using RequestLocaion().
       
   112         Cancelling requests is typically attempted when an client is closing down.
       
   113 
       
   114         This method passes on the  the CancelRequest request to the CCLbsSuplTiRequestManager
       
   115         to cancel the location request.
       
   116 
       
   117         @param aSessionId The Id of the location request to be cancelled. This must be the same id used
       
   118                during the location request.
       
   119         @return an error code. A initiation module should return KErrNotFound for invalid session ids.
       
   120 
       
   121         @see TLbsNetSessionId
       
   122      */
       
   123     virtual TInt CancelRequest(const TLbsNetSessionId& aSessionId);
       
   124 
       
   125 
       
   126     /**
       
   127         This should be called when the request session is no longer required and prior to any call to ~CLbsSuplTiApi().
       
   128         All the outstanding requests must be cancelled before closing the session.
       
   129 
       
   130         The initiation module should use this opportunity to close any session and server connections it
       
   131         may have with any SUPL server framework.
       
   132      */
       
   133     virtual void CloseSession();
       
   134 
       
   135 
       
   136     /**
       
   137         Implementation method for CLbsSuplTiApi::GetPosition()
       
   138         This is an synchronous method for retrieving position information  
       
   139         determined during RSuplTiApi::RequestLocation().
       
   140 
       
   141         This method passes on the  the GetPosition request to the CCLbsSuplTiRequestManager
       
   142         to retrieve the position info.
       
   143         
       
   144         @param aSessionId the ID of session from which to obtain the location information.
       
   145         @param aPositionInfo the returned location information.
       
   146         @return an error code for the location information.
       
   147 
       
   148         @see TLbsNetSessionId
       
   149         @see TPositionInfoBase
       
   150      */
       
   151     virtual TInt GetPosition(const TLbsNetSessionId& aSessionId, TPositionInfoBase& aPositionInfo);
       
   152 
       
   153 private:
       
   154 
       
   155     /**
       
   156      *	By default, prohibit copy constructor
       
   157      */
       
   158 
       
   159     CLbsSuplTiApiImplementation( const CLbsSuplTiApiImplementation& );
       
   160 
       
   161     /**
       
   162      *	By default, Prohibit assigment operator
       
   163      */
       
   164 
       
   165     CLbsSuplTiApiImplementation& operator= ( const CLbsSuplTiApiImplementation& );
       
   166 
       
   167 private:
       
   168 
       
   169     /*For Logging*/
       
   170     COMASuplTrace* iTrace;
       
   171 
       
   172     //creates and manages CCLbsSuplTiApiRequestor objects for making location requests
       
   173     CCLbsSuplTiRequestManager* iRequestManager;
       
   174     };
       
   175 
       
   176 
       
   177 #endif // C_LBSSUPLTIAPIIMPL_H
       
   178 
       
   179 // End of File