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