lbs/common/inc/ctlbsclientrequestor.h
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 /*
       
     2 * Copyright (c) 2001-2009 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 "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CT_LBS_CLIENT_REQUESTOR_H__ 
       
    21 #define __CT_LBS_CLIENT_REQUESTOR_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <Lbs.h>
       
    26 #include <EPos_CPosModules.h>
       
    27 #include <EPos_CPosModuleUpdate.h>
       
    28 #include <EPos_CPosModuleIdList.h>
       
    29 #include <testexecutelogger.h>
       
    30 
       
    31 
       
    32 // CONSTANTS
       
    33 const TInt KNoEvent = 42;
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class MCT_LbsRequestObserver;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  ?one_line_short_description.
       
    42 *  ?other_description_lines
       
    43 */
       
    44 class CT_LbsClientRequestor : public CActive
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47         
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         * @return A new instance of this class.
       
    51         */
       
    52         static CT_LbsClientRequestor* NewL(
       
    53             /* IN  */   TUid                aPsyUid,
       
    54 			/* IN  */   MCT_LbsRequestObserver*   aObserver,
       
    55 			/* IN  */	const TDesC& aClientName,
       
    56 		    CTestExecuteLogger&						aLogger
       
    57 		    );
       
    58         
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CT_LbsClientRequestor();
       
    63 
       
    64     protected:
       
    65 
       
    66         /**
       
    67         * C++ default constructor.
       
    68         */
       
    69         CT_LbsClientRequestor(
       
    70 			/* IN  */   MCT_LbsRequestObserver*   aObserver,
       
    71 						TUid				aPsyUid
       
    72 			);
       
    73 
       
    74         /**
       
    75         * By default EPOC constructor is private.
       
    76         */
       
    77         void ConstructL(const TDesC& aClientName, CTestExecuteLogger& aLogger);
       
    78 
       
    79     public: // New functions
       
    80         
       
    81         const TTime& CompletionTimeUTC() const;
       
    82        
       
    83 		TInt CompletionCode() const;
       
    84 
       
    85 		void ResetCompletionCode();
       
    86 
       
    87         /**
       
    88         * Performs a request to iPsy. Notifies iObserver when request is complete
       
    89         */
       
    90         void StartRequestL(TBool aDefaultPsy);
       
    91 
       
    92 		void RequestModuleStatusEvent();
       
    93 
       
    94 		TInt ReadModuleStatusEvent();
       
    95 
       
    96 		void ContinueRequesting();
       
    97 
       
    98 		void ClosePositioner();
       
    99 
       
   100 		TBool ReadModuleStatusModulesApi(CPosModules* aDb, TPositionModuleId aModuleId);
       
   101 		
       
   102 		TInt ReadModuleStatusClientApi(TPositionModuleId aModuleId);
       
   103 
       
   104 		void CancelModuleStatusEvent();
       
   105 
       
   106     public: // Functions from base classes
       
   107 
       
   108         void RunL();
       
   109 
       
   110         void DoCancel();
       
   111 
       
   112     protected: // New functions
       
   113 
       
   114         void RequestComplete();
       
   115 
       
   116     private:
       
   117 
       
   118         // By default, prohibit copy constructor
       
   119         CT_LbsClientRequestor( const CT_LbsClientRequestor& );
       
   120         // Prohibit assigment operator
       
   121         CT_LbsClientRequestor& operator= ( const CT_LbsClientRequestor& );
       
   122         
       
   123     	// Logger interface used for constructing result strings to be fed for the logger instance
       
   124     	inline CTestExecuteLogger& Logger() {return iLogger;};
       
   125 
       
   126     private:    // Data
       
   127 
       
   128         RPositionServer     iPosServer;
       
   129         RPositioner         iPositioner;
       
   130 		TBuf<100>			iName;
       
   131 
       
   132 		MCT_LbsRequestObserver*   iObserver;
       
   133         TTime               iCompletionTimeUTC;
       
   134         TInt                iCompletionCode;
       
   135         TRequestStatus      iRequestStatus;
       
   136         TPositionInfo       iModuleInfo;
       
   137 		TUid				iPsyUid;
       
   138 		TPositionModuleStatusEvent istatusEvent;
       
   139 		TBool iContinueEventRequesting;
       
   140 		
       
   141         CTestExecuteLogger	iLogger;
       
   142     };
       
   143 
       
   144 #endif      // __CT_LBS_CLIENT_REQUESTOR_H__  
       
   145             
       
   146 // End of File