vpnengine/kmdserver/inc/connectionstarter.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2008-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 "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:  active object, that monitors the real connection starting
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CONNECTIONSTARTER_H
       
    20 #define C_CONNECTIONSTARTER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class CVpnConnection;
       
    26 
       
    27 /**
       
    28  *  Connection starter callback interface.
       
    29  *  Callback interface which is used by CConnectionStarter object to notify
       
    30  *  about completion of real network connection's starting.
       
    31  * 
       
    32  *  @lib internal (kmdserver.exe)
       
    33   */
       
    34 class MConnectionStarterCallback
       
    35     {
       
    36 public:        
       
    37     /**
       
    38      * Notifies about completion of real connection starting.
       
    39      * @param aStatus Completion status
       
    40      * @param aRealIapId IAP Id of started connection
       
    41      * @param aRealNetId Net Id of started connection
       
    42      */
       
    43     virtual void RealConnectionStarted( TInt aStatus,
       
    44                                         TInt aRealIapId,
       
    45                                         TInt aRealNetId ) = 0;
       
    46     };
       
    47 
       
    48 
       
    49 /**
       
    50  *  Connection starter.
       
    51  *  Active object provides functionality for starting of real network
       
    52  *  connection.
       
    53  *
       
    54  *  @lib internal (kmdserver.exe)
       
    55   */
       
    56 class CConnectionStarter : public CActive
       
    57     {
       
    58 public:
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      * @param aConnection VPN connection object
       
    62      * @param aCallback Callback interface
       
    63      */
       
    64     static CConnectionStarter* NewL( CVpnConnection& aConnection,
       
    65                                      MConnectionStarterCallback& aCallback );
       
    66     
       
    67     /**
       
    68      * Destructor.
       
    69      */
       
    70     ~CConnectionStarter();
       
    71 
       
    72     /**
       
    73      * Starts real network connection. Completion is notified via
       
    74      * MConnectionStarterCallback interface.
       
    75      */
       
    76     void StartRealConnection();
       
    77 
       
    78 private:
       
    79     
       
    80     CConnectionStarter( CVpnConnection& aConnection,
       
    81                         MConnectionStarterCallback& aCallback );
       
    82     
       
    83 // from base class CActive
       
    84     
       
    85     /**
       
    86      * From CActive
       
    87      * Handles completion of asynchronous connection starting request.
       
    88      */    
       
    89     void RunL();
       
    90     
       
    91     /**
       
    92      * From CActive
       
    93      * Handles cancellation of asynchronous connection starting request.
       
    94      */    
       
    95     void DoCancel();
       
    96     
       
    97 private: // data
       
    98     
       
    99     /**
       
   100      * VPN connection object.
       
   101      * Not own.
       
   102      */
       
   103     CVpnConnection&             iConnection;
       
   104     
       
   105     /**
       
   106      * Callback interface.
       
   107      * Not own.
       
   108      */
       
   109     MConnectionStarterCallback& iCallback;
       
   110     };
       
   111 
       
   112 #endif // C_CONNECTIONSTARTER_H