wlanutilities/wlansniffer/aiplugin/inc/wsflaunchaihelperactivewrapper.h
branchRCL_3
changeset 25 f28ada11abbf
parent 12 981afc7d3841
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
       
     1 /*
       
     2  * Copyright (c) 2007-2008 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:  Implementation of CWsfLaunchAiHelperActiveWrapper.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CWSFLAUNCHAIHELPERACTIVEWRAPPER_H
       
    19 #define CWSFLAUNCHAIHELPERACTIVEWRAPPER_H
       
    20 
       
    21 //  EXTERNAL INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 //  INTERNAL INCLUDES
       
    25 #include "wsfaicontroller.h"
       
    26 
       
    27 //  FORWARD DECLARATIONS
       
    28 class CWsfModel;
       
    29 
       
    30 /**
       
    31  *  Active object launches ai helper
       
    32  *
       
    33  *  @lib wsfaiplugin.lib
       
    34  *  @since S60 v5.2
       
    35  */
       
    36 class CWsfLaunchAiHelperActiveWrapper : public CActive
       
    37     {
       
    38 public: // Constructors and destructor
       
    39 
       
    40     /**
       
    41      * Destructor
       
    42      * @since S60 5.2     
       
    43      */
       
    44     ~CWsfLaunchAiHelperActiveWrapper();
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      * @since S60 5.2     
       
    49      */
       
    50     static CWsfLaunchAiHelperActiveWrapper* NewL( CWsfModel* aModel,
       
    51                                             TWsfAiController &aController );
       
    52 
       
    53     /**
       
    54      * Two-phased constructor.
       
    55      * @since S60 5.2     
       
    56      */
       
    57     static CWsfLaunchAiHelperActiveWrapper* NewLC( CWsfModel* aModel, 
       
    58                                              TWsfAiController &aController );
       
    59 
       
    60 public:
       
    61     /**
       
    62      * Function for making the initial request
       
    63      * @since S60 5.2
       
    64      * @param aWlanInfo The WlanInfo object to be passed to the helper app
       
    65      * @param aConnectOnly ETrue if we are only connecting, 
       
    66      *                     EFalse if we should also launch the browser   
       
    67      * @param aTestAccessPoint ETrue if ICT is executed, 
       
    68      *                         EFalse if ICT is not executed  
       
    69      */
       
    70     void Start( TWsfWlanInfo& aInfo, TBool aConnectOnly, 
       
    71                 TBool aTestAccessPoint );
       
    72 
       
    73 private:
       
    74     
       
    75     /**
       
    76      * constructor
       
    77      */
       
    78     CWsfLaunchAiHelperActiveWrapper();
       
    79 
       
    80     /**
       
    81      * Factory function.
       
    82      * @since S60 5.2
       
    83      * @param aModel Whether to react to screensaver events 
       
    84      * @param aController Whether to react to screensaver events
       
    85      */
       
    86     void ConstructL( CWsfModel* aModel, TWsfAiController &aController );
       
    87 
       
    88 private: // From CActive
       
    89 
       
    90     /**
       
    91      * @see CActive
       
    92      */
       
    93     void RunL();
       
    94 
       
    95     /**
       
    96      * @see CActive
       
    97      */
       
    98     void DoCancel();
       
    99 
       
   100     /**
       
   101      * @see CActive
       
   102      */
       
   103     TInt RunError( TInt aError );
       
   104 
       
   105 private:
       
   106 
       
   107     /**
       
   108      * States of the active object
       
   109      */
       
   110     enum TCWsfWLANListActiveWrapperState
       
   111         {
       
   112         EUninitialized, // Uninitialized
       
   113         EInitialized, // Initalized
       
   114         EError // Error condition
       
   115         };
       
   116 
       
   117 private:
       
   118 
       
   119     /**
       
   120      * State of the active object
       
   121      */
       
   122     TInt iState; 
       
   123 
       
   124     /**
       
   125      * Reference to Model
       
   126      */
       
   127     CWsfModel* iModel;
       
   128 
       
   129     /**
       
   130      * Pointer to TWsfAiController
       
   131      */
       
   132     TWsfAiController *iController;
       
   133     
       
   134     /**
       
   135     * Handle to the ai helper exit code property value
       
   136     */
       
   137     RProperty iAiHelperAppExitCode;
       
   138     
       
   139     /**
       
   140     * Handle to the ai helper iap id property value
       
   141     */
       
   142     RProperty iAiHelperAppIapId;
       
   143     
       
   144     /**
       
   145     * Cache of the used info
       
   146     */
       
   147     TWsfWlanInfo iUsedInfo;
       
   148     
       
   149     /**
       
   150     * Indicates if "Connect" or "Start Web browsing" is selected.
       
   151     */
       
   152     TBool iConnectOnly;
       
   153     
       
   154     /**
       
   155     * Indicates if ICT needs to be executed
       
   156     */
       
   157     TBool iTestAccessPoint;
       
   158     
       
   159     /**
       
   160     * Indicates if ai helper was stopped
       
   161     */
       
   162     TBool iStoppingHelper;
       
   163     
       
   164     /**
       
   165     * Timer to wait for ai helper to close
       
   166     */
       
   167     RTimer iTimer; 
       
   168 
       
   169     };
       
   170 
       
   171 #endif // CWSFLAUNCHAIHELPERACTIVEWRAPPER_H