messagingfw/wappushfw/pushwatcher/inc/ConnMan.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file contains the declaration of the CConnectionManager which manages the Wap Push Connections
       
    15 // to the WAP STACK
       
    16 // WAP Push Message Header File - ConnectionManager
       
    17 // 
       
    18 //
       
    19 
       
    20 /**
       
    21  @file ConnMan.H
       
    22 */
       
    23 
       
    24 #ifndef __CONNMAN_H__
       
    25 #define __CONNMAN_H__
       
    26 
       
    27 #include <e32base.h>
       
    28 #include "CLWatcher.h"
       
    29 #include "cmanobserver.h"
       
    30 
       
    31 
       
    32 /**
       
    33  * 
       
    34  *
       
    35  *		- Creates Connectionless (CL) Watchers that will *always* be running
       
    36  *
       
    37  *		- Connection Oriented (CO) connections are started via an exposed API and managed 
       
    38  *		  When a CO it opened, it will:
       
    39  *
       
    40  *			-  Opens a PPP Connection (if one is not already opened)
       
    41  *
       
    42  *			-  Start a Connection Oriented Watcher, and keeps a reference to it
       
    43  *
       
    44  *			- If the Connection Oriented Watcher already opened, it leaves it open
       
    45  *
       
    46  *			- Deletes the Connection Oriented Watcher when signaled EComplete
       
    47  *
       
    48  *			- Closes PPP Connection if no more Connection Oriented Watchers
       
    49  *
       
    50  *		Note: The Connection Manager is *always* running
       
    51  *
       
    52  */
       
    53 class CConnectionManager : public CActive, public MConnManObserver
       
    54 /**
       
    55 @internalComponent
       
    56 @released
       
    57 */
       
    58 	{
       
    59 public:
       
    60 	static CConnectionManager* NewL(MWapPushLog& aLog);
       
    61 	~CConnectionManager();
       
    62 
       
    63 	// from MConnManObserver
       
    64 	void CMOpenConnectionL(TPushConnPoint& aConnPoint);
       
    65 	void CMWatcherComplete(CCOWatcherBase& aCOWatcher, TInt aError);
       
    66 
       
    67 
       
    68 private:
       
    69 	CConnectionManager(MWapPushLog& aLog); 
       
    70 	void ConstructL();
       
    71 
       
    72 	// from CActive 
       
    73 	void RunL();
       
    74 
       
    75 	void DoCancel();
       
    76 
       
    77 	TInt RunError(TInt aError);
       
    78 
       
    79 private:
       
    80 	MWapPushLog&			iLog;
       
    81 	CCLUnsecureWatcher*		iCLUnsecWatcher;
       
    82 	CCLSecureWatcher*		iCLSecureWatcher;	
       
    83 	TBool					iConnectionExists;
       
    84 	};
       
    85 
       
    86 
       
    87 #endif