supl/locationsuplfw/gateway/inc/epos_csuplsessionrequest.h
changeset 0 667063e416a2
child 32 b12ea03c50a3
child 41 d746aee05493
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 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:  
       
    15 *    Active object and base class for subclasses implementing a SUPL session 
       
    16 *    request cycle.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __CSuplSessionRequest_H__
       
    23 #define __CSuplSessionRequest_H__
       
    24 
       
    25 // INCLUDE FILES
       
    26 #include <e32base.h>
       
    27 #include <lbspositioninfo.h>
       
    28 #include <epos_suplterminalqop.h>
       
    29 #include <epos_suplterminaltrigger.h>
       
    30 
       
    31 // CONSTANT DECLARATIONS
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class MSuplSessionObserver;
       
    35 class MNetInitiatedObserver;
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *    Active object implementing a position request cycle. Handles
       
    40 *    activities such as controlling logging and verifying privacy.
       
    41 *
       
    42 */
       
    43 class CSuplSessionRequest : public CActive
       
    44     {
       
    45     public:  // Constructors and destructor
       
    46    
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         */
       
    50         static CSuplSessionRequest* NewL(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver);
       
    51         static CSuplSessionRequest* NewL(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver);
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CSuplSessionRequest();
       
    57 
       
    58     public:  // New functions
       
    59 
       
    60         /**
       
    61         * Starts a SUPL session request cycle. 
       
    62         * @param aMessage the request message from the client
       
    63         */
       
    64         void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, TInt aSetCaps, TInt aReqId, TBool aFirstReq);
       
    65         void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq);
       
    66         void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TBool aFirstReq);
       
    67         void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq);
       
    68 
       
    69 		void MakeSuplSessionTriggerringRequestL(
       
    70 				CSuplSessionBase* aSuplSessn, 
       
    71 				TSuplTerminalPeriodicTrigger& aPTrigger,
       
    72 				TInt aSetCaps, 
       
    73 				TInt aReqId 
       
    74 			);
       
    75 		
       
    76 		void MakeSuplSessionTriggerringRequestL(
       
    77 				CSuplSessionBase* aSuplSessn, 
       
    78 				TSuplTerminalPeriodicTrigger& aPTrigger,
       
    79 				const TDesC& aHslpAddress, 
       
    80 				TBool aFallBack,
       
    81 				TInt aSetCaps, 
       
    82 				TInt aReqId
       
    83 			);
       
    84 		
       
    85 		void NotifyTriggerFiredRequestL(
       
    86 				CSuplSessionBase* aSuplSessn, 
       
    87 				TSuplTriggerFireInfo& aFireInfo
       
    88 			);
       
    89 		
       
    90         /**
       
    91         * Called when the server class is shutting down.
       
    92         */
       
    93         void NotifyServerShutdown();
       
    94 
       
    95 		void ForwardMessageRequestL(CSuplSessionBase* aSuplSessn,TInt aHandle,HBufC8* clientBuf);
       
    96 		
       
    97 		void CancelRunSessionRequest();
       
    98 		
       
    99 		void CancelTriggerringRequest();
       
   100 		
       
   101 		void ProtocolHUnloaded();
       
   102 		
       
   103     protected:  // From CActive
       
   104 
       
   105         void RunL();
       
   106         TInt RunError(TInt aError);
       
   107         void DoCancel();
       
   108 
       
   109     private:
       
   110 
       
   111         CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver);
       
   112 
       
   113 		CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver);
       
   114         void ConstructL();
       
   115 
       
   116         // By default, prohibit copy constructor
       
   117         CSuplSessionRequest( const CSuplSessionRequest& );
       
   118         // Prohibit assigment operator
       
   119         CSuplSessionRequest& operator= ( const CSuplSessionRequest& );
       
   120  		void CompleteSelf(TInt aReason);
       
   121 	
       
   122     private:  // Data
       
   123 
       
   124         enum TSuplRequestStage
       
   125             {
       
   126             ESuplReqInactive = 0,
       
   127             ESuplSessionRequest,
       
   128             ESuplCancelRunSessionRequest,
       
   129             ESuplForwardMessage,
       
   130             ESuplStartTriggerRequest,            
       
   131             ESuplStopTriggerRequest,
       
   132             ESuplTriggerFiredNotifyRequest
       
   133             };
       
   134      
       
   135 	 TSuplRequestStage           iRequestPhase;
       
   136      HBufC8*                     iPositionBuffer;
       
   137      MSuplSessionObserver* 	     iObserver;
       
   138      MNetInitiatedObserver*		 iNetObserver;
       
   139   	 CSuplSessionManager& 		 iSessnMgr;
       
   140 	 CSuplSessionBase*			 iSuplSessn;
       
   141 	 TInt iHandle;
       
   142     };  
       
   143 
       
   144 #endif  // __CSuplSessionRequest_H__
       
   145 
       
   146 // End of File