IMPSengine/engsrv/inc/impsactiveconnmonitor.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003 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 * A manager class for connection component.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CImpsConnManager_H
       
    21 #define CImpsConnManager_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <msgconnmanagerapi.h>
       
    26 #include <msgbearerobscallback.h>
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CImpsSendReceive2;
       
    31 class MMsgConnManager;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 class CImpsConnManager : public CActive, public MMsgBearerObsCallback
       
    36     {
       
    37     public: // new methods
       
    38 
       
    39         /**
       
    40         * Two phase constructor
       
    41         * @param aSender CImpsSendReceive2 entity
       
    42         * @param aPriority CActive priority
       
    43         * @return CImpsConnManager entity
       
    44         */
       
    45         static CImpsConnManager* NewL( CImpsSendReceive2& aSender, TInt aPriority );
       
    46 
       
    47         /**
       
    48         * Destructor
       
    49         */
       
    50         virtual ~CImpsConnManager();
       
    51 
       
    52         /**
       
    53         * Start to wait open.
       
    54         * Use CActive::Cancel() to cancel the request.
       
    55         * @param aAIP IAP number in CommDb
       
    56         */
       
    57         void OpenAPL(
       
    58             TInt  aIAP, TBool aDelayed );
       
    59 
       
    60         /**
       
    61         * Close AP
       
    62         * @param aTotalClose ETrue if bearer statu events not wanted,
       
    63         *        EFalse if PDP context released only.
       
    64         * @return error code
       
    65         */
       
    66         void CloseAP( TBool aTotalClose );
       
    67 
       
    68         /**
       
    69         * Deletes members while active scheduler is still running
       
    70         */
       
    71         void Destroy();
       
    72 
       
    73         /**
       
    74         * ConnectionManager accessor
       
    75         * Leaves if handle not created.
       
    76         * @return Connection Manager entity
       
    77         */
       
    78         MMsgConnManager& ManagerHandleL() const;
       
    79 
       
    80         /**
       
    81         * Start a delayed request
       
    82         * @return error code KErrNotReady if previous request incomplete
       
    83         */
       
    84         TInt StartDelayed();
       
    85 
       
    86     public: // from base classes
       
    87 
       
    88         /**
       
    89         * Callback from base class
       
    90         * @param aBearerEvent The event that took place
       
    91         * @param aAuthoritativeClose indicates whether connection
       
    92         *              was authoritatively closed (i.e. by the user)
       
    93         */
       
    94         void HandleBearerEventL( TBool aAuthoritativeClose,
       
    95                                  TMsgBearerEvent aBearerEvent );
       
    96 
       
    97 
       
    98     protected:
       
    99         // From base class
       
   100         void DoCancel();
       
   101         void RunL();
       
   102 
       
   103     private:
       
   104 
       
   105         /**
       
   106         * By default constructor is private.
       
   107         */
       
   108         void ConstructL(  );
       
   109 
       
   110         /**
       
   111         * Constructor
       
   112         * @param aServer WV engine server
       
   113         * @param aPriority Active objects priority
       
   114         */
       
   115         CImpsConnManager( CImpsSendReceive2& aSender, TInt aPriority );
       
   116 
       
   117         /**
       
   118         * Activate entity
       
   119         * @return error code KErrNotReady if previous request incomplete
       
   120         */
       
   121         TInt ActivateMe();
       
   122 
       
   123 
       
   124     protected:
       
   125         CImpsSendReceive2&      iSender;
       
   126         TImpsConnectionState    iState;
       
   127         TImpsTransCmd           iCmd;
       
   128         TMsgBearerEvent         iConnState;
       
   129         MMsgConnManager*        iManager;
       
   130         TInt                    iIAP;
       
   131         TBool                   iRunL;
       
   132         RTimer                  iTimer;
       
   133     };
       
   134 
       
   135 
       
   136 #endif      // ?INCLUDE_H   
       
   137 
       
   138 // End of File