wlansecuritysettings/wepsecuritysettingsui/inc/WEPSecuritySettingsDlg.h
branchRCL_3
changeset 46 c74b3d9f6b9e
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#14 %
       
    20 */
       
    21 
       
    22 #ifndef WEP_SECURITY_SETTINGS_DLG_H
       
    23 #define WEP_SECURITY_SETTINGS_DLG_H
       
    24 
       
    25 
       
    26 // INCLUDES
       
    27 #include <eiklbo.h>
       
    28 #include <AknDialog.h>
       
    29 #include <aknlists.h>
       
    30 #include <AknTabObserver.h>
       
    31 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    32 #include <commsdat.h>
       
    33 #else
       
    34 #include <commsdat.h>
       
    35 #include <commsdat_partner.h>
       
    36 #endif
       
    37 
       
    38 #include "WepSecuritySettingsDefs.h"
       
    39 
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CAknTitlePane;
       
    43 class CAknNavigationControlContainer;
       
    44 class CAknNavigationDecorator;
       
    45 class CAknTabGroup;
       
    46 
       
    47 
       
    48 // CLASS DECLARATION
       
    49 /**
       
    50 * CWEPSecuritySettingsDlg dialog class
       
    51 */
       
    52 NONSHARABLE_CLASS( CWEPSecuritySettingsDlg ) : public CAknDialog, 
       
    53                                                public MEikListBoxObserver,
       
    54                                                public MAknTabObserver
       
    55     {
       
    56 
       
    57     public: // Constructors and destructor
       
    58 
       
    59         /**
       
    60         * Create and launch dialog.
       
    61         * @param aSecuritySettings Security settings
       
    62         * @param aTitle Title of the dialog
       
    63         * @return The ID of the button that closed the dialog
       
    64         */
       
    65         TInt ConstructAndRunLD( CWEPSecuritySettingsImpl* aSecuritySettings,
       
    66                                 const TDesC& aTitle );
       
    67 
       
    68 
       
    69         /**
       
    70         * Two-phase construction.
       
    71         * @param aEventStore A reference to hold the events happened
       
    72         * @return The constructed CWEPSecuritySettingsDlg object.
       
    73         */
       
    74         static CWEPSecuritySettingsDlg* NewL( TInt& aEventStore );
       
    75 
       
    76 
       
    77         /**
       
    78         * Destructor.
       
    79         */
       
    80         ~CWEPSecuritySettingsDlg();
       
    81 
       
    82 
       
    83 	protected:
       
    84         /**
       
    85         * Constructor.
       
    86         * @param aEventStore A reference to hold the events happened
       
    87         */
       
    88         CWEPSecuritySettingsDlg( TInt& aEventStore );
       
    89 
       
    90 
       
    91     public: // Functions from base classes
       
    92         /**
       
    93         * Handle key events. 
       
    94         * @param aKeyEvent: key event
       
    95         * @param aType: type of event
       
    96         * @return The key response, if it was consumed or not. 
       
    97         */
       
    98 		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
    99                                      TEventCode aType );
       
   100 
       
   101 
       
   102     public: // From MAknTabObserver
       
   103 
       
   104         /**
       
   105         * Called when a key is tab change happens.
       
   106         * @param aIndex index of the new tab
       
   107         */
       
   108         void TabChangedL( TInt aIndex ); 
       
   109 
       
   110 
       
   111 	private:
       
   112 
       
   113         /**
       
   114         * This function is called by the dialog framework before the dialog is 
       
   115         * sized and laid out.
       
   116         */
       
   117         virtual void PreLayoutDynInitL();
       
   118 
       
   119 
       
   120         /**
       
   121         * Handles a dialog button press for the specified button 
       
   122         * @param aButtonId  The ID of the button that was activated.
       
   123         * @return   ETrue to validate and exit the dialog, 
       
   124         *           EFalse to keep the dialog active
       
   125         */
       
   126         TBool OkToExitL( TInt aButtonId );
       
   127 
       
   128 
       
   129 		/**
       
   130         * Processes user commands.
       
   131         * @param aCommandId ID of the command to respond to. 
       
   132         */
       
   133 		virtual void ProcessCommandL( TInt aCommandId );
       
   134 
       
   135 
       
   136 		/**
       
   137         * Handles list box events.
       
   138         * @param aListBox   The originating list box. 
       
   139         * @param aEventType A code for the event.
       
   140         */
       
   141 		void HandleListBoxEventL( CEikListBox* aListBox, 
       
   142                                   TListBoxEvent aEventType );
       
   143 
       
   144         /**
       
   145         * Get help context.
       
   146         * @param aContext Help context is returned here.
       
   147         */
       
   148         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   149 
       
   150         /**
       
   151         * Initialize menu pane.
       
   152         * @param aResourceId Menu pane resource id.
       
   153         * @param CEikMenuPane Menu pane.
       
   154         */
       
   155         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   156 
       
   157 
       
   158     protected:  // New functions
       
   159 
       
   160         /**
       
   161         * Handles listbox data change
       
   162         */
       
   163         void HandleListboxDataChangeL();
       
   164 
       
   165 
       
   166         /**
       
   167         * Fills up the listbox with data
       
   168         * @param aItemArray Array where to add the elements
       
   169         * @param arr        Array to be used as list elements
       
   170         * @param aLength    The number of elements in the above array
       
   171         * @param aRes       Array of resource IDs to be used for the 
       
   172         *                   elements of arr
       
   173         */
       
   174         void FillListWithDataL( CDesCArrayFlat& aItemArray, 
       
   175                                 const CWEPSecuritySettings::TWepMember& arr, 
       
   176                                 TInt aLength,
       
   177                                 const TInt* aRes );
       
   178 
       
   179 
       
   180         /**
       
   181         * Updates one listbox item for the given member
       
   182         * @param aMember    Value specifying which member has to be added to 
       
   183         *                   the list
       
   184         * @param aRes       Resource ID for the 'title text' for this member
       
   185         * @param aPos       The current position of the item in the list
       
   186         */
       
   187         void UpdateListBoxItemL( CWEPSecuritySettings::TWepMember aMember, 
       
   188                                  TInt aRes, TInt aPos );
       
   189 
       
   190 
       
   191         /**
       
   192         * Creates one 'textual' listbox item for the given member
       
   193         * @param aMember    Value specifying which member has to be added to
       
   194         *                   the list
       
   195         * @param aRes       Resource ID for the 'title text' for this member
       
   196         * @return The created listbox item text.
       
   197         */
       
   198         HBufC* CreateTextualListBoxItemL( CWEPSecuritySettings::TWepMember aMember, 
       
   199                                           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( 
       
   219                                 CWEPSecuritySettings::TWepMember aDataMember );
       
   220 
       
   221 
       
   222         /**
       
   223         * Shows a popup text setting page for the given member
       
   224         * @return   A boolean indicating whether the current setting
       
   225         *           has been changed or not.
       
   226         */
       
   227         TBool ShowPopupTextSettingPageL();
       
   228 
       
   229 
       
   230         /**
       
   231         * Fills up a pop-up radio button setting page with the currently
       
   232         * valid and available choices for the given member.
       
   233         * @param aData      The member whose new setting is needed
       
   234         * @param aCurrvalue The current value of the setting
       
   235         * @return   An array of choices for the given member, pushed to the 
       
   236         *           CleanupStack.
       
   237         */
       
   238         CDesCArrayFlat* FillPopupSettingPageLC( 
       
   239                                         CWEPSecuritySettings::TWepMember aData,
       
   240                                         TInt& aCurrvalue );
       
   241 
       
   242 
       
   243         /**
       
   244         * Updates the given member's data with the new setting from the setting
       
   245         * page.
       
   246         * @param aData      The member to update
       
   247         * @param aCurrvalue The new value
       
   248         * @return   A boolean indicating if the value is actually changed
       
   249         */
       
   250         TBool UpdateFromPopupSettingPage( CWEPSecuritySettings::TWepMember aData, 
       
   251                                           TInt aCurrvalue );
       
   252 
       
   253 
       
   254         /**
       
   255         * Inverts one boolean member 
       
   256         * @param aDataMember the member to invert.
       
   257         */
       
   258         void InvertSettings( CWEPSecuritySettings::TWepMember aDataMember );
       
   259 
       
   260 
       
   261     private: //data
       
   262 
       
   263         // Stores the name of the connection, to be showed as the title.
       
   264       	TBuf<CommsDat::KMaxTextLength> iConnectionName;
       
   265 
       
   266         // Title pane. Not owned.
       
   267         CAknTitlePane* iTitlePane;
       
   268 
       
   269         // Pointer to the old title. Owned.
       
   270         HBufC* iOldTitleText;
       
   271 
       
   272         // Empty Navigation decorator. Owned.
       
   273         CAknNavigationDecorator* iNaviDecoratorEmpty;
       
   274 
       
   275         // Tabbed Navigation decorator. Owned.
       
   276         CAknNavigationDecorator* iNaviDecoratorTabbed;
       
   277 
       
   278         // Navi Pane. Not owned.
       
   279         CAknNavigationControlContainer* iNaviPane;
       
   280 
       
   281         // Tab Group. Not owned.
       
   282         CAknTabGroup* iTabGroup;
       
   283 
       
   284         // Index of the active tab
       
   285         TInt iActiveTab;
       
   286 
       
   287         // Owned through resources, destroyed automatically by the dialog.
       
   288         CAknSettingStyleListBox* iList;
       
   289 
       
   290         // Array of the items. Not owned.
       
   291         CDesCArrayFlat* iItemArray;
       
   292 
       
   293         // Fields of the main view. Not owned.
       
   294         CWEPSecuritySettings::TWepMember* iFieldsMain;
       
   295 
       
   296         // Titles of the main view. Not owned.
       
   297         TInt* iTitlesMain;
       
   298 
       
   299         // Fields of the key configuration view. Not owned.
       
   300         CWEPSecuritySettings::TWepMember* iFieldsKeyConfiguration;
       
   301 
       
   302         // Titles of the key configuration view. Not owned.
       
   303         TInt* iTitlesKeyConfiguration;
       
   304 
       
   305         // Pointer to the WEP Security Settings. Not owned.
       
   306         CWEPSecuritySettingsImpl* iSecuritySettings;
       
   307 
       
   308         // current level (main or key configuration)
       
   309         TInt iLevel;
       
   310 
       
   311         // To hold the events. Not owned.
       
   312         TInt* iEventStore;
       
   313     };
       
   314 
       
   315 
       
   316 #endif      // WEP_SECURITY_SETTINGS_DLG_H
       
   317 
       
   318 // End of File