voipplugins/dhcppositionprovider/inc/dhcpconnectionengine.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Class description file for CDhcpConnectionEngine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DHCPCONNECTIONENGINE_H
       
    20 #define DHCPCONNECTIONENGINE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <es_sock.h>
       
    24 #include <commdbconnpref.h> // For starting AP
       
    25 #include "dhcpconnectionstateobserver.h"
       
    26 
       
    27 class CDhcpConnectionProgressNotifier;
       
    28 
       
    29 /**
       
    30  *  Locate and activate proper connection method wlan
       
    31  * internet usage
       
    32  *
       
    33  *  @lib
       
    34  *  @since S60 3.2
       
    35  */
       
    36 class CDhcpConnectionEngine : public CActive,
       
    37     public MDhcpConnectionStateObserver
       
    38     {
       
    39     public:
       
    40 
       
    41         /**
       
    42          * Two-phased constructor.
       
    43          * @since S60 3.2
       
    44          *
       
    45          */
       
    46         static CDhcpConnectionEngine* NewL (RConnection& aConnection);
       
    47 
       
    48         /**
       
    49          * C++ destructor
       
    50          * @since S60 3.2
       
    51         */
       
    52         virtual ~CDhcpConnectionEngine ();
       
    53 
       
    54     public:
       
    55 
       
    56         /**
       
    57          * Check is we are already connected to the specified IAP or not.
       
    58          *
       
    59          * @since S60 3.2
       
    60          *
       
    61          * @param aIAPconnection An id to the connection which
       
    62          *                       will be activated.
       
    63          *
       
    64          */
       
    65 
       
    66         TBool IsConnectedL(TUint32 aIAPConnection);
       
    67 
       
    68         /**
       
    69         * Connects to the specified WLAN IAP.
       
    70         * @since S60 3.2
       
    71         * @param aIAPconnection An id to the connection which
       
    72         *                       will be activated.
       
    73         * @param aStatus        TRequestStatus to be signaled.
       
    74         *
       
    75         */
       
    76         void ConnectL (TUint aIAPConnection, TRequestStatus& aStatus);
       
    77 
       
    78     protected:
       
    79 
       
    80         /**
       
    81          * Cancellation of an outstanding request.
       
    82          */
       
    83         void DoCancel();
       
    84 
       
    85         /**
       
    86         * Handles an active object's request completion event.
       
    87         */
       
    88         void RunL();
       
    89 
       
    90     protected:
       
    91 
       
    92         /**
       
    93         * Handles a progress notifier state changing.
       
    94         */
       
    95         void StateChangedL ();
       
    96 
       
    97     private:    // methods
       
    98 
       
    99         /**
       
   100          * Finalise Symbian Os style construction.
       
   101          *
       
   102          * @since S60 3.2
       
   103          */
       
   104         void    ConstructL();
       
   105 
       
   106         /**
       
   107          * C++ constructor
       
   108          * @since S60 3.2
       
   109          *
       
   110          */
       
   111         CDhcpConnectionEngine (RConnection& aConnection);
       
   112 
       
   113         /**
       
   114          * SelfCall
       
   115          *
       
   116          * @since S60 3.2
       
   117          */
       
   118         void SelfCall ();
       
   119 
       
   120     private:    // Declarations.
       
   121 
       
   122         enum TConnectionStates
       
   123             {
       
   124             EIdle,
       
   125             ETurnConnectionOn,
       
   126             EConnectionStartup,
       
   127             };
       
   128 
       
   129     private:
       
   130         // Connection which we are used to.
       
   131         RConnection& iConnection;
       
   132 
       
   133         MDhcpConnectionStateObserver* iObserver;
       
   134 
       
   135         CDhcpConnectionProgressNotifier* iProgressNotifier;
       
   136 
       
   137         // Must be member varible since other wise confirmation
       
   138         // shown on the screen.
       
   139         TCommDbConnPref iPreferences;
       
   140 
       
   141         // State of this active object
       
   142         TConnectionStates  iStates;
       
   143 
       
   144         TRequestStatus* iClientStatus;
       
   145 
       
   146         // Used connection id
       
   147         TUint32 iIapProfileId;
       
   148     };
       
   149 
       
   150 #endif // DHCPCONNECTIONENGINE_H