wlanutilities/wlansniffer/mainapplication/inc/wsfappui.h
branchRCL_3
changeset 25 f28ada11abbf
parent 0 56b72877c1cb
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:  Class header for CWsfAppUi
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_WSFAPPUI_H
       
    19 #define C_WSFAPPUI_H
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <AknWaitDialog.h>
       
    23 #include <aknViewAppUi.h>
       
    24 
       
    25 
       
    26 //  FORWARD DECLARATIONS
       
    27 class CWsfMainView;
       
    28 class MWsfMainUiObserver;
       
    29 class MWsfMainViewControllerIf;
       
    30 class MWsfDetailsViewControllerIf;
       
    31 class CAknWaitDialog;
       
    32 class CWsfDocument;
       
    33 class CWsfConnectedDetailsDialog;
       
    34 class CWsfWlanInfoArray;
       
    35 
       
    36 /**
       
    37  * 'AppUi' class.
       
    38  *
       
    39  * @since S60 v5.0
       
    40  * @lib wlansniffer.exe
       
    41  */
       
    42 NONSHARABLE_CLASS( CWsfAppUi ): public CAknViewAppUi, 
       
    43                                 public MProgressDialogCallback
       
    44     {
       
    45     public:
       
    46         
       
    47         /**
       
    48         * 2nd phase constructor
       
    49         * @since S60 5.0 
       
    50         */
       
    51         void ConstructL();
       
    52     
       
    53         /**
       
    54         * Default C++ constructor 
       
    55         * @since S60 5.0 
       
    56         */
       
    57         CWsfAppUi();
       
    58     
       
    59         /**
       
    60         * Destructor of CWsfAppUi class
       
    61         * @since S60 5.0     
       
    62         */
       
    63         ~CWsfAppUi();
       
    64     
       
    65     
       
    66     public: // from CAknAppUi
       
    67         /**
       
    68         * Handle user menu selections
       
    69         * @since S60 5.0     
       
    70         * @param aCommand The enumerated code for the option selected
       
    71         */
       
    72         void HandleCommandL( TInt aCommand );
       
    73     
       
    74         /**
       
    75         * Handles a change to the application's resources
       
    76         * which are shared across the environment.
       
    77         * @since S60 5.0     
       
    78         * @param aType type of resources that have changed. 
       
    79         */
       
    80         void HandleResourceChangeL( TInt aType );
       
    81 
       
    82         /**
       
    83         * Handles changes in keyboard focus when an application switches to, 
       
    84         * or from, the foreground.
       
    85         * @since S60 5.0     
       
    86         * @param aForeground ETrue if the application is in the foreground,
       
    87         * otherwise EFalse.
       
    88         */
       
    89         void HandleForegroundEventL( TBool aForeground );    
       
    90 
       
    91         
       
    92     public:
       
    93     
       
    94         /**
       
    95         * Set an interface to the main controller for the AppUI.
       
    96         * @since S60 5.0   
       
    97         * @param aObserver Observer object
       
    98         */
       
    99         void SetUiObserver( MWsfMainUiObserver* aObserver );
       
   100         
       
   101         /**
       
   102         * Activate the Details View
       
   103         * @since S60 5.0   
       
   104         * @param aDetailsViewId View ID of Details View
       
   105         */
       
   106         void ActivateDetailsViewL( TUid aDetailsViewId );
       
   107         
       
   108         /**
       
   109         * Activate the Main View
       
   110         * @since S60 5.0   
       
   111         */
       
   112         void ActivateMainViewL();    
       
   113     
       
   114         /**
       
   115         * Create the Main View 
       
   116         * @since S60 5.0
       
   117         * @return reference to the Main View's controller
       
   118         */
       
   119         MWsfMainViewControllerIf& MainView();
       
   120     
       
   121         /**
       
   122         * Create the Details View
       
   123         * @since S60 5.0
       
   124         * @return reference to the Details View's controller
       
   125         */
       
   126         MWsfDetailsViewControllerIf& DetailsView( TInt aDetailsViewType );
       
   127         
       
   128         /**
       
   129         * Starts the wait note dialog
       
   130         * @since S60 5.0
       
   131         * @param aVisibilityDelayOff set the visibility of the dialog
       
   132         */
       
   133         void StartWaitNoteL( TBool aVisibilityDelayOff );
       
   134     
       
   135         /**
       
   136         * Dismiss the wait note dialog
       
   137         * @since S60 5.0
       
   138         */
       
   139         void HideWaitNoteL();
       
   140 
       
   141         /**
       
   142         * Displays the Main View's menu bar.
       
   143         * @since S60 5.0
       
   144         */
       
   145         void ShowMenuBarL();
       
   146     
       
   147         /**
       
   148         * Displays "No WLAN found" note.
       
   149         * @since S60 5.0
       
   150         */
       
   151         void ShowNoWlansFoundInfoL();
       
   152         
       
   153         /**
       
   154         * Displays an error note.
       
   155         * @since S60 5.0
       
   156         * @param aResourceId the text of the error note
       
   157         */
       
   158         void ShowErrorNoteL( TInt aResourceId ); 
       
   159         
       
   160         /**
       
   161         * Displays a Global error note.
       
   162         * @since S60 5.0
       
   163         * @param aError error ID
       
   164         */
       
   165         void ShowGlobalErrorNoteL( TInt aError );
       
   166         
       
   167         /**
       
   168         * Returns a pointer to the CWsfDocument
       
   169         * @since S60 5.0
       
   170         * @return pointer to the CWsfDocument
       
   171         */
       
   172         CWsfDocument* Doc();
       
   173         
       
   174         /**
       
   175         * Returns CWlanSettingsUi is in foreground
       
   176         * @since S60 5.0
       
   177         * @return ETrue if CWlanSettingsUi is in foreground
       
   178         *         EFalse if CWlanSettingsUi is in background
       
   179         */
       
   180         TBool Foreground();
       
   181         
       
   182         /**
       
   183         * Starts the Connected Details View 
       
   184         * @since S60 5.0
       
   185         * @param aWlanArray pointer to the Wlan Info Array
       
   186         * @param aSelectedWlanSsid string of the selected Wlan SSID
       
   187         */
       
   188         void StartConnectedDetailsL( CWsfWlanInfoArray* aWlanArray,
       
   189                                      const TDesC8& aSelectedWlanSsid );
       
   190     
       
   191         /**
       
   192         * Update content of the Connected Details View 
       
   193         * @since S60 5.0
       
   194         * @param aWlanArray pointer to the Wlan Info Array
       
   195         */
       
   196         void UpdateConnectedDetailsL( CWsfWlanInfoArray* aWlanArray );
       
   197 
       
   198         /**
       
   199          * Returns the value of key event suppression flag
       
   200          * @since S60 5.0
       
   201          * @return ETrue if key events are suppressed
       
   202          */
       
   203         TBool SuppressingKeyEvents() const;
       
   204         
       
   205         /**
       
   206          * Sets the value of key event suppression flag
       
   207          * @since S60 5.0
       
   208          * @param aSuppressing The new value of the flag
       
   209          */
       
   210         void SetSuppressingKeyEvents( TBool aSuppressing );
       
   211         
       
   212         
       
   213     protected:  // from MProgressDialogCallback
       
   214     
       
   215         /**
       
   216         * Callback function for MProgressDialogCallback
       
   217         * @since S60 5.0
       
   218         * @param aButtonId the ID of the button that was activated
       
   219         */
       
   220         void DialogDismissedL( TInt aButtonId ); 
       
   221     
       
   222         
       
   223     private:    // new methods
       
   224         
       
   225         /**
       
   226         * This function is used for querying whether the application
       
   227         * is launched in embedded mode or not.
       
   228         * @return ETrue:  The application is launched in embedded mode.
       
   229         *         EFalse: The application is launched in standalone mode.
       
   230         */
       
   231         TBool IsEmbedded() const;
       
   232     
       
   233         /**
       
   234         * Callback for CIdle. 
       
   235         * @since S60 5.0 
       
   236         * @param aObject pointer to this
       
   237         * @return zero value means not be called again.(Stops timer)
       
   238         */
       
   239         static TInt AppLaunchCompleteL( TAny* aObject );
       
   240     
       
   241     
       
   242     private:
       
   243     
       
   244         /**
       
   245         * Reference to UI observer
       
   246         * Not own.
       
   247         */
       
   248         MWsfMainUiObserver* iObserver;
       
   249     
       
   250         /**
       
   251         * Wait dialog
       
   252         * Own.
       
   253         */
       
   254         CAknWaitDialog* iWaitDialog;
       
   255     
       
   256         /**
       
   257         * Connected details view dialog
       
   258         * Own.
       
   259         */
       
   260         CWsfConnectedDetailsDialog* iConnectedDetailsDialog;
       
   261         
       
   262         /**
       
   263         * Used to launch wait dialog when application has been 
       
   264         * fully started and screen has been drawn
       
   265         * Own.
       
   266         */
       
   267         CIdle* iIdle;
       
   268         
       
   269         /*
       
   270         * Used to check CWlanSettingsUi is in foreground
       
   271         */
       
   272         TBool iForeground;
       
   273         
       
   274         /**
       
   275         * indicates whether the launching has ended
       
   276         */
       
   277         TBool iAppLaunchCompleted;
       
   278         
       
   279         /**
       
   280         * Indicates Featuremanger is initialized or not.
       
   281         */
       
   282         TBool iFeatureManagerInitialized;
       
   283         
       
   284         /**
       
   285          * Indicates whether keypress events are suppressed
       
   286          */
       
   287         TBool iSuppressingKeyEvents;
       
   288     };
       
   289 
       
   290 
       
   291 #endif // C_WSFAPPUI_H
       
   292