wlanutilities/wlansniffer/mainapplication/inc/wsfmaincontroller.h
changeset 0 56b72877c1cb
child 3 ff3b37722600
equal deleted inserted replaced
-1:000000000000 0:56b72877c1cb
       
     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:  Class header for TWsfMainController
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef T_WSFMAINCONTROLLER_H
       
    19 #define T_WSFMAINCONTROLLER_H
       
    20 
       
    21 //  EXTERNAL INCLUDES
       
    22 #include <e32def.h>
       
    23 
       
    24 //  INTERNAL INCLUDES
       
    25 #include "wsfmainuiobserver.h" 
       
    26 #include "wsfmodelobserver.h"
       
    27 #include "wsfmainviewpartner.h"
       
    28 #include "wsfstatechangeobserver.h"
       
    29 #include "wsfdetailsviewpartner.h"
       
    30 
       
    31 
       
    32 
       
    33 //  FORWARD DECLARATIONS
       
    34 class CWsfAppUi;
       
    35 class CWsfModel;
       
    36 class MWsfMainViewControllerIf;
       
    37 class MWsfDetailsViewControllerIf;
       
    38 class CWsfWlanInfoArray;
       
    39 class CWsfWlanInfoArrayVisitor; 
       
    40 
       
    41 //  CLASS DEFINITION
       
    42 /**
       
    43  *  The main control class of the component. It is responsible for all
       
    44  *  the WLAN related functionalities.
       
    45  *  @since S60 v5.0
       
    46  */
       
    47 class TWsfMainController: public MWsfMainUiObserver, 
       
    48                           public MWsfModelObserver, 
       
    49                           public MWsfMainViewPartner,
       
    50                           public MWsfDetailsViewPartner,
       
    51                           public MWsfStateChangeObserver
       
    52     {
       
    53     public:     // New methods
       
    54 
       
    55         /**
       
    56          * PreInitialization for this class
       
    57          * @since S60 5.0 
       
    58          * @param aAppUi reference for the AppUI
       
    59          * @param aModel reference for the Model
       
    60          * @param aWlanInfoBranding reference for the WlanInfoArrayVisitor
       
    61          */
       
    62         void Initialize( CWsfAppUi& aAppUi, 
       
    63                          CWsfModel& aModel, 
       
    64                          CWsfWlanInfoArrayVisitor& aWlanInfoBranding );
       
    65         
       
    66         /**
       
    67          * Updating the active View 
       
    68          * @since S60 5.0 
       
    69          */
       
    70         void UpdateViewL();
       
    71         
       
    72         /**
       
    73          * Updating the active View 
       
    74          * @since S60 5.0 
       
    75          * @param aInfoArray - Current Wlan Array
       
    76          */
       
    77         void UpdateViewL( CWsfWlanInfoArray* aInfoArray );
       
    78 
       
    79     public:     //From MWsfMainUiObserver
       
    80         
       
    81         /**
       
    82          * Activate (Switch back to) the Main View
       
    83          * @since S60 5.0 
       
    84          */
       
    85         void ShowWlanListL();            
       
    86         
       
    87         /**
       
    88          * Incialize Main View 
       
    89          * @since S60 5.0 
       
    90          */
       
    91         void MainViewCreatedL();
       
    92         
       
    93         /**
       
    94          * Sarts the Borwser
       
    95          * @since S60 5.0 
       
    96          */
       
    97         void StartBrowsingL();
       
    98         
       
    99         /**
       
   100          * Continues browsing (browser launched if needed)
       
   101          * @since S60 5.0 
       
   102          */
       
   103         void ContinueBrowsingL();
       
   104               
       
   105         /**
       
   106          * Connect to an IAP and create a WLAN connection
       
   107          * @since S60 5.0 
       
   108          */
       
   109         void ConnectL();
       
   110         
       
   111         /**
       
   112          * Disconnect a connection
       
   113          * @since S60 5.0 
       
   114          */
       
   115         void DisconnectL();
       
   116         
       
   117         /**
       
   118          * Start a refresh scanning 
       
   119          * @since S60 5.0 
       
   120          */
       
   121         void RefreshL();
       
   122         
       
   123         /**
       
   124          * Start to display the diteils view of the selected connection
       
   125          * @since S60 5.0 
       
   126          */
       
   127         void ShowDetailsL();           
       
   128 
       
   129         /**
       
   130          * Create an Access Point
       
   131          * @since S60 5.0 
       
   132          */
       
   133         void CreateAccessPointL(); 
       
   134 
       
   135         /**
       
   136          * Used in AppUi side to check if the 
       
   137          * wait dialog should be shown
       
   138          * @since S60 5.0 
       
   139          * @return ETrue if first refreshing
       
   140          */
       
   141         TBool EngineRefreshing();        
       
   142 
       
   143         /**
       
   144          * Callback function, when the Sniffer started 
       
   145          * @since S60 5.0 
       
   146          */
       
   147         void AppLaunchCompleteL();
       
   148 
       
   149         /**
       
   150          * Enable Scanning 
       
   151          * @since S60 5.0 
       
   152          */
       
   153         void AppSwitchedForegroundL();
       
   154 
       
   155         /**
       
   156          * Disable Scanning 
       
   157          * @since S60 5.0 
       
   158          */
       
   159         void AppSwitchedBackgroundL();  
       
   160 
       
   161         /**
       
   162          * Displays the "Filter out Wlan" dialog  
       
   163          * @since S60 5.0 
       
   164          */
       
   165         void EditBlackListItemsL();
       
   166            
       
   167 
       
   168     public:     //From MWsfModelObserver
       
   169     
       
   170         /**
       
   171          * Called if the launch has been completed successfully
       
   172          * @since S60 5.0 
       
   173          */
       
   174         void BrowserLaunchCompleteL();
       
   175         
       
   176         /**
       
   177          * Called if the browser launch failed for some reason
       
   178          * @since S60 5.0 
       
   179          * @param aError error code
       
   180          */
       
   181         void BrowserLaunchFailed( TInt aError );
       
   182 
       
   183         /**
       
   184         * Called when the previously launched browser exits
       
   185         * @since S60 5.0
       
   186         */
       
   187         void BrowserExitL();
       
   188         
       
   189         /**
       
   190         * Notification that connection is going to be created
       
   191         * @since S60 5.0
       
   192         * @param aIapId The IAP id of the connection being created
       
   193         */
       
   194         void ConnectingL( TUint32 aIapId );
       
   195 
       
   196         /**
       
   197         * Notification that the connection creation process ended
       
   198         * @since S60 5.0
       
   199         * @param aResult The result of the connection creation
       
   200         */
       
   201         void ConnectingFinishedL( TInt aResult );
       
   202 
       
   203     
       
   204     public:     //From MWsfMainViewPartner
       
   205 
       
   206         /**
       
   207          * Mainview request to show manubar
       
   208          * @since S60 5.0
       
   209          */
       
   210         void ShowMenuBarL();
       
   211        
       
   212     public:     //From MWsfDetailsViewPartner
       
   213         
       
   214         /**
       
   215         * Detailsview requests to close view
       
   216         * @since S60 5.0
       
   217         */    
       
   218         void CloseDetailsViewL();
       
   219         
       
   220         /**
       
   221         * Refresh scanning
       
   222         */
       
   223         void DetailsScanL();       
       
   224         
       
   225     public:     // From MWsfStateChangeObserver
       
   226 
       
   227         /**
       
   228         * The current wlan data has changed and it is ready to be retrieved
       
   229         * @since S60 5.0
       
   230         */
       
   231         void WlanListChangedL();
       
   232 
       
   233         /**
       
   234          * Engine error occured
       
   235          * @since S60 5.0
       
   236          * @param aError System wide error code
       
   237          */
       
   238         void NotifyEngineError( TInt aError );
       
   239         
       
   240         /**
       
   241         * Scanning has been disabled
       
   242         * @since S60 5.0
       
   243         */
       
   244         void ScanDisabledL();
       
   245         
       
   246         /**
       
   247         * Scanning has been enabled
       
   248         * @since S60 5.0
       
   249         */
       
   250         void ScanEnabledL();
       
   251         
       
   252         /**
       
   253         * A WLAN connection has been established
       
   254         * @since S60 5.0
       
   255         * @param aAccesspointName The name of the active connection
       
   256         */
       
   257         void WlanConnectionActivatedL( const TDesC& aAccessPointName );
       
   258         
       
   259         /**
       
   260         * A WLAN connection has been closed
       
   261         * @since S60 5.0
       
   262         */
       
   263         void WlanConnectionClosedL();
       
   264         
       
   265         /**
       
   266         * Connection creation process finished
       
   267         * @since S60 5.2
       
   268         * @param aError System wide error code
       
   269         */
       
   270         void ConnectionCreationProcessFinishedL( TInt aError );
       
   271         
       
   272     private:
       
   273         
       
   274         /**
       
   275         * Cleanup function to release the key events suppressing
       
   276         * @since S60 5.0
       
   277         * @param aPtr Pointer for this class
       
   278         */
       
   279         static void ReleaseSuppressingKeyEvents( TAny* aPtr );
       
   280         
       
   281     private:    // Data
       
   282 
       
   283         /**
       
   284         * Reference to AppUi
       
   285         */
       
   286         CWsfAppUi* iAppUi;
       
   287 
       
   288         /**
       
   289         * Reference to Model
       
   290         */
       
   291         CWsfModel* iModel;
       
   292         
       
   293         /**
       
   294         * Reference to Main View
       
   295         */
       
   296         MWsfMainViewControllerIf* iMainView;
       
   297         
       
   298         /**
       
   299         * Reference to WlanInfoArrayVisitor
       
   300         */
       
   301         CWsfWlanInfoArrayVisitor* iWlanInfoBranding; 
       
   302         
       
   303         /**
       
   304         * Reference to Deatils View
       
   305         */
       
   306         MWsfDetailsViewControllerIf* iDetailsView;
       
   307 
       
   308         /**
       
   309         * Reference to WlanInfoArray
       
   310         */
       
   311         CWsfWlanInfoArray* iInfoArray;
       
   312 
       
   313     };
       
   314 
       
   315 
       
   316 #endif      //  T_WSFMAINCONTROLLER_H
       
   317 
       
   318 // End of file