supl/locationsuplfw/gateway/inc/epos_csuplsessionrequest.h
changeset 0 667063e416a2
child 32 b12ea03c50a3
child 41 d746aee05493
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/supl/locationsuplfw/gateway/inc/epos_csuplsessionrequest.h	Tue Feb 02 01:06:48 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*    Active object and base class for subclasses implementing a SUPL session 
+*    request cycle.
+*
+*/
+
+
+
+#ifndef __CSuplSessionRequest_H__
+#define __CSuplSessionRequest_H__
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <lbspositioninfo.h>
+#include <epos_suplterminalqop.h>
+#include <epos_suplterminaltrigger.h>
+
+// CONSTANT DECLARATIONS
+
+// FORWARD DECLARATIONS
+class MSuplSessionObserver;
+class MNetInitiatedObserver;
+// CLASS DECLARATION
+
+/**
+*    Active object implementing a position request cycle. Handles
+*    activities such as controlling logging and verifying privacy.
+*
+*/
+class CSuplSessionRequest : public CActive
+    {
+    public:  // Constructors and destructor
+   
+        /**
+        * Two-phased constructor.
+        */
+        static CSuplSessionRequest* NewL(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver);
+        static CSuplSessionRequest* NewL(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSuplSessionRequest();
+
+    public:  // New functions
+
+        /**
+        * Starts a SUPL session request cycle. 
+        * @param aMessage the request message from the client
+        */
+        void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, TInt aSetCaps, TInt aReqId, TBool aFirstReq);
+        void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq);
+        void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TBool aFirstReq);
+        void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq);
+
+		void MakeSuplSessionTriggerringRequestL(
+				CSuplSessionBase* aSuplSessn, 
+				TSuplTerminalPeriodicTrigger& aPTrigger,
+				TInt aSetCaps, 
+				TInt aReqId 
+			);
+		
+		void MakeSuplSessionTriggerringRequestL(
+				CSuplSessionBase* aSuplSessn, 
+				TSuplTerminalPeriodicTrigger& aPTrigger,
+				const TDesC& aHslpAddress, 
+				TBool aFallBack,
+				TInt aSetCaps, 
+				TInt aReqId
+			);
+		
+		void NotifyTriggerFiredRequestL(
+				CSuplSessionBase* aSuplSessn, 
+				TSuplTriggerFireInfo& aFireInfo
+			);
+		
+        /**
+        * Called when the server class is shutting down.
+        */
+        void NotifyServerShutdown();
+
+		void ForwardMessageRequestL(CSuplSessionBase* aSuplSessn,TInt aHandle,HBufC8* clientBuf);
+		
+		void CancelRunSessionRequest();
+		
+		void CancelTriggerringRequest();
+		
+		void ProtocolHUnloaded();
+		
+    protected:  // From CActive
+
+        void RunL();
+        TInt RunError(TInt aError);
+        void DoCancel();
+
+    private:
+
+        CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver);
+
+		CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver);
+        void ConstructL();
+
+        // By default, prohibit copy constructor
+        CSuplSessionRequest( const CSuplSessionRequest& );
+        // Prohibit assigment operator
+        CSuplSessionRequest& operator= ( const CSuplSessionRequest& );
+ 		void CompleteSelf(TInt aReason);
+	
+    private:  // Data
+
+        enum TSuplRequestStage
+            {
+            ESuplReqInactive = 0,
+            ESuplSessionRequest,
+            ESuplCancelRunSessionRequest,
+            ESuplForwardMessage,
+            ESuplStartTriggerRequest,            
+            ESuplStopTriggerRequest,
+            ESuplTriggerFiredNotifyRequest
+            };
+     
+	 TSuplRequestStage           iRequestPhase;
+     HBufC8*                     iPositionBuffer;
+     MSuplSessionObserver* 	     iObserver;
+     MNetInitiatedObserver*		 iNetObserver;
+  	 CSuplSessionManager& 		 iSessnMgr;
+	 CSuplSessionBase*			 iSuplSessn;
+	 TInt iHandle;
+    };  
+
+#endif  // __CSuplSessionRequest_H__
+
+// End of File