wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsDlg.h
branchRCL_3
changeset 46 c74b3d9f6b9e
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
       
     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: Declares dialog. 
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: tr1cfwln#21 %
       
    20 */
       
    21 
       
    22 #ifndef WPA_SECURITY_SETTINGS_DLG_H
       
    23 #define WPA_SECURITY_SETTINGS_DLG_H
       
    24 
       
    25 
       
    26 // ENUMERATIONS
       
    27 
       
    28 // Members to be showed in the setting pages
       
    29 enum TWpaMember
       
    30     {
       
    31     EWpaMode,           // WPA mode
       
    32     EWpaEapConfig,      // EAP Plugin configuration
       
    33     EWpaWpa2Only,       // Wpa2 only mode
       
    34     EWpaPreSharedKey,    // Pre-shared key
       
    35     EWpaUnencryptedConn
       
    36     };
       
    37 
       
    38 
       
    39 // INCLUDES
       
    40 #include <AknDialog.h>
       
    41 #include <eiklbo.h>
       
    42 #include <aknlists.h>
       
    43 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    44 #include <commsdat.h>
       
    45 #else
       
    46 #include <commsdat.h>
       
    47 #include <commsdat_partner.h>
       
    48 #endif
       
    49 #include "WPASecuritySettingsImpl.h"
       
    50 
       
    51 // FORWARD DECLARATIONS
       
    52 class CAknTitlePane;
       
    53 class CWPASecuritySettingsImpl;
       
    54 class CEAPPluginConfigurationIf;
       
    55 
       
    56 
       
    57 // CLASS DECLARATION
       
    58 /**
       
    59 * CWPASecuritySettingsDlg dialog class
       
    60 */
       
    61 NONSHARABLE_CLASS( CWPASecuritySettingsDlg ) : public CAknDialog, 
       
    62                                                public MEikListBoxObserver
       
    63     {
       
    64 
       
    65     public: // Constructors and destructor
       
    66 
       
    67         /**
       
    68         * Create and launch dialog.
       
    69         * @param aSecuritySettings Security settings
       
    70         * @param aTitle Title of the dialog
       
    71         * @return The ID of the button that closed the dialog
       
    72         */
       
    73         TInt ConstructAndRunLD( CWPASecuritySettingsImpl* aSecuritySettings,
       
    74                                 const TDesC& aTitle );
       
    75 
       
    76 
       
    77         /**
       
    78         * Two-phase construction.
       
    79         * @param aEventStore A reference to hold the events happened
       
    80         * @param aIapId Id of the IAP.
       
    81         * @param aPlugin The EAP Configuration plugin.
       
    82         * @return The constructed CWPASecuritySettingsDlg object.
       
    83         */
       
    84         static CWPASecuritySettingsDlg* NewL( TInt& aEventStore, 
       
    85                                           const TUint32 aIapId,
       
    86                                           CEAPPluginConfigurationIf* aPlugin );
       
    87 
       
    88         /**
       
    89         * Destructor.
       
    90         */
       
    91         ~CWPASecuritySettingsDlg();
       
    92 
       
    93 
       
    94 	protected:
       
    95         /**
       
    96         * Constructor.
       
    97         * @param aEventStore A reference to hold the events happened
       
    98         * @param aIapId Id of the IAP.
       
    99         * @param aPlugin The EAP Configuration plugin.
       
   100         */
       
   101         CWPASecuritySettingsDlg( TInt& aEventStore, const TUint32 aIapId,
       
   102                                  CEAPPluginConfigurationIf* aPlugin );
       
   103 
       
   104 
       
   105     public:     // Functions from base classes
       
   106         /**
       
   107         * Handle key events. 
       
   108         * @param aKeyEvent: key event
       
   109         * @param aType: type of event
       
   110         * @return The key response, if it was consumed or not. 
       
   111         */
       
   112 		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   113                                      TEventCode aType );
       
   114 
       
   115 	private:    // Functions from base classes
       
   116 
       
   117         /**
       
   118         * This function is called by the dialog framework before the dialog is 
       
   119         * sized and laid out.
       
   120         */
       
   121         virtual void PreLayoutDynInitL();
       
   122 
       
   123 
       
   124         /**
       
   125         * Handles a dialog button press for the specified button 
       
   126         * @param aButtonId  The ID of the button that was activated.
       
   127         * @return   ETrue to validate and exit the dialog, 
       
   128         *           EFalse to keep the dialog active
       
   129         */
       
   130         TBool OkToExitL( TInt aButtonId );
       
   131 
       
   132 
       
   133 		/**
       
   134         * Processes user commands.
       
   135         * @param aCommandId ID of the command to respond to. 
       
   136         */
       
   137 		virtual void ProcessCommandL( TInt aCommandId );
       
   138 
       
   139 
       
   140 		/**
       
   141         * Handles list box events.
       
   142         * @param aListBox   The originating list box. 
       
   143         * @param aEventType A code for the event.
       
   144         */
       
   145 		void HandleListBoxEventL( CEikListBox* aListBox, 
       
   146                                   TListBoxEvent aEventType );
       
   147 
       
   148         /**
       
   149         * Get help context.
       
   150         * @param aContext Help context is returned here.
       
   151         */
       
   152         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   153 
       
   154         /**
       
   155         * Initialize menu pane.
       
   156         * @param aResourceId Menu pane resource id.
       
   157         * @param CEikMenuPane Menu pane.
       
   158         */
       
   159         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   160 
       
   161 
       
   162     protected:  // New functions
       
   163 
       
   164         /**
       
   165         * Handles listbox data change
       
   166         */
       
   167         void HandleListboxDataChangeL();
       
   168 
       
   169 
       
   170         /**
       
   171         * Fills up the listbox with data
       
   172         * @param aItemArray Array where to add the elements
       
   173         * @param arr        Array to be used as list elements
       
   174         * @param aRes       Array of resource IDs to be used for the 
       
   175         *                   elements of arr
       
   176         */
       
   177         void FillListWithDataL( CDesCArrayFlat& aItemArray, 
       
   178                                 const TWpaMember& arr, const TInt* aRes );
       
   179 
       
   180 
       
   181         /**
       
   182         * Updates one 'textual' listbox item for the given member
       
   183         * @param aMember    Value specifying which member has to be added to 
       
   184         *                   the list
       
   185         * @param aRes       Resource ID for the 'title text' for this member
       
   186         * @param aPos       The current position of the item in the list
       
   187         */
       
   188         void UpdateTextualListBoxItemL( TWpaMember aMember, TInt aRes, 
       
   189                                         TInt aPos );
       
   190 
       
   191 
       
   192         /**
       
   193         * Creates one 'textual' listbox item for the given member
       
   194         * @param aMember    Value specifying which member has to be added to
       
   195         *                   the list
       
   196         * @param aRes       Resource ID for the 'title text' for this member
       
   197         * @return The created listbox item text.
       
   198         */
       
   199         HBufC* CreateTextualListBoxItemL( TWpaMember aMember, TInt aRes );
       
   200 
       
   201 
       
   202         /**
       
   203         * Changes one setting. The setting, which is
       
   204         * highlighted as current in the listbox is changed.
       
   205         * @param aQuick ETrue if the setting is "two-choices", and can be 
       
   206         *               automatically changed, without showing the list of 
       
   207         *               elements
       
   208         */
       
   209         void ChangeSettingsL( TBool aQuick );
       
   210 
       
   211 
       
   212         /**
       
   213         * Shows a popup setting page (radio buttons) for the given member
       
   214         * @param aDataMember    The member which needs to be changed
       
   215         * @return   A boolean indicating whether the current setting
       
   216         *           has been changed or not.
       
   217         */
       
   218         TBool ShowPopupSettingPageL( TWpaMember aDataMember );
       
   219 
       
   220 
       
   221         /**
       
   222         * Shows a popup text setting page for the given member
       
   223         * @return   A boolean indicating whether the current setting
       
   224         *           has been changed or not.
       
   225         */
       
   226         TBool ShowPopupTextSettingPageL();
       
   227 
       
   228 
       
   229         /**
       
   230         * Fills up a pop-up radio button setting page with the currently
       
   231         * valid and available choices for the given member.
       
   232         * @param aData      The member whose new setting is needed
       
   233         * @param aCurrvalue The current value of the setting
       
   234         * @return   An array of choices for the given member, pushed to the 
       
   235         *           CleanupStack.
       
   236         */
       
   237         CDesCArrayFlat* FillPopupSettingPageLC( TWpaMember aData,
       
   238                                                 TInt& aCurrvalue );
       
   239 
       
   240 
       
   241         /**
       
   242         * Updates the given member's data with the new setting from the setting
       
   243         * page.
       
   244         * @param aData      The member to update
       
   245         * @param aCurrvalue The new value
       
   246         * @return   A boolean indicating if the value is actually changed
       
   247         */
       
   248         TBool UpdateFromPopupSettingPage( TWpaMember aData, TBool aCurrvalue );
       
   249 
       
   250 
       
   251         /**
       
   252         * Cleanup for the iEapConfigActive semaphore flag
       
   253         * @since S60 5.0
       
   254         * @param aPtr Pointer to this class
       
   255         */
       
   256         static void ResetEapConfigFlag( TAny* aPtr );
       
   257         
       
   258         /**
       
   259         * @see CEikDialog
       
   260         */
       
   261         void HandleDialogPageEventL( TInt aEventID );
       
   262 
       
   263     private: //data
       
   264 
       
   265         // Stores the name of the connection, to be showed as the title.
       
   266       	TBuf<CommsDat::KMaxTextLength> iConnectionName;
       
   267 
       
   268         // Title pane. Not owned.
       
   269         CAknTitlePane* iTitlePane;
       
   270 
       
   271         // Pointer to the old title. Owned.
       
   272         HBufC* iOldTitleText;
       
   273 
       
   274         // Owned through resources, destroyed automatically by the dialog.
       
   275         CAknSettingStyleListBox* iList;
       
   276 
       
   277         // Array of the items. Not owned.
       
   278         CDesCArrayFlat* iItemArray;
       
   279 
       
   280         // Fields of the main view. Not owned.
       
   281         TWpaMember* iFieldsMain;
       
   282 
       
   283         // Titles of the main view. Not owned.
       
   284         TInt* iTitlesMain;
       
   285 
       
   286         // Pointer to the WPA Security Settings. Not owned.
       
   287         CWPASecuritySettingsImpl* iSecuritySettings;
       
   288 
       
   289         // To hold the events. Not owned.
       
   290         TInt* iEventStore;
       
   291         
       
   292         // The Id of the AP.
       
   293         TUint32 iIapId;
       
   294 
       
   295         // The EAP Configuration plugin. Not owned.
       
   296         CEAPPluginConfigurationIf* iPlugin;
       
   297         
       
   298         // Indicates whether the EAP plugin configuration is active
       
   299         TBool iEapConfigActive;
       
   300         
       
   301         TBuf8<KWLANEAPLISTLENGTH> iEnabledPluginList;
       
   302         TBuf8<KWLANEAPLISTLENGTH> iDisabledPluginList;
       
   303     };
       
   304 
       
   305 
       
   306 #endif      // WPA_SECURITY_SETTINGS_DLG_H
       
   307 
       
   308 // End of File