wlansecuritysettings/wifiprotectedsetup/inc/wifiprotsyncclient.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-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 the License "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: CWiFiProtSyncClient class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_WIFIPROTSYNCCLIENT_H
       
    20 #define C_WIFIPROTSYNCCLIENT_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "wifiprotsession.h"
       
    26 
       
    27 /**
       
    28 * CWiFiProtSyncClient
       
    29 * Active object to convert a sychronous client call asynchronous, and
       
    30 * return only when the request is completed
       
    31 */
       
    32 class CWiFiProtSyncClient : public CActive
       
    33     {
       
    34     public:
       
    35         /**
       
    36         * Two phased constructor
       
    37         * @param aClient RWiFiProtSession class to handle communication with
       
    38         * Notifier Framework
       
    39         * @param aPriority Active object priority
       
    40         **/
       
    41         static CWiFiProtSyncClient* NewL( RWiFiProtSession& aClient,
       
    42             TInt aPriority = CActive::EPriorityStandard );
       
    43         /**
       
    44         * Destructor
       
    45         **/            
       
    46         ~CWiFiProtSyncClient();
       
    47 
       
    48         /**
       
    49         * Starts WiFi Protected Setup sequence
       
    50         * @param aSSid contains SSid of the network we want to configure 
       
    51         * @param aConnectionNeeded ETrue if we need a connection via the
       
    52         * configured network 
       
    53         * @param aUidsReturned uids of the configured connection methods
       
    54         * @return possible return values are ok, cancel process and not use 
       
    55         * protected setup (No Automatic Setup).
       
    56         */
       
    57         WiFiProt::TWiFiReturn StartWiFiProtL(  const TWlanSsid& aSSid, 
       
    58                                   TBool aConnectionNeeded,
       
    59                                   RArray<TUint32>& aUidsReturned
       
    60                                   );
       
    61         
       
    62     private:
       
    63         // Each Notifier Framework call has a corresponding enum,
       
    64         // and CWiFiProtSyncClient uses it to keep track of the
       
    65         // currently active call
       
    66         // The only one is ERunWiFiProt at the moment
       
    67         enum TWiFiState
       
    68             {
       
    69             ENoState = 0,
       
    70             // StartWiFiProtL was called
       
    71             ERunWiFiProt
       
    72             };
       
    73 
       
    74     private:
       
    75         /**
       
    76         * Constructor
       
    77         * @param aClient RWiFiProtSession class to handle communication
       
    78         * with Notifier Framework
       
    79         * @param aPriority Active object priority
       
    80         **/    
       
    81         CWiFiProtSyncClient( RWiFiProtSession& aClient, TInt aPriority );
       
    82         
       
    83         /**
       
    84         * Second phase constructor
       
    85         **/           
       
    86         void ConstructL();
       
    87         
       
    88         /**
       
    89         * Calls CActive::SetActive() and sets TWiFiState also
       
    90         * @param aState identifier of the active call
       
    91         **/           
       
    92         void SetActive( TWiFiState aState );
       
    93 
       
    94         /** From CActive */
       
    95         
       
    96         /**
       
    97         * @see CActive::DoCancel
       
    98         **/ 
       
    99         virtual void DoCancel();
       
   100  
       
   101         /**
       
   102         * @see CActive::RunL
       
   103         **/        
       
   104         virtual void RunL();
       
   105 
       
   106     private:
       
   107         // RWiFiProtSession class to handle communication with Notifier
       
   108         // Framework
       
   109         RWiFiProtSession& iClient;
       
   110         // identifier of the active call
       
   111         CWiFiProtSyncClient::TWiFiState iState;
       
   112         // Active Scheduler Waiter class to halt the process until the
       
   113         // call is completed
       
   114         CActiveSchedulerWait iWait;
       
   115     };
       
   116 
       
   117 
       
   118 #endif //C_WIFIPROTSYNCCLIENT_H
       
   119 
       
   120 // End of File