apengine/apsettingshandlerui/inc/ApSelPopupList.h
changeset 61 8b0c979bbe8c
parent 59 2709c04a4af5
child 70 ac5daea24fb0
equal deleted inserted replaced
59:2709c04a4af5 61:8b0c979bbe8c
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Declares CApSelPopupList for access point selection.
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef APSEL_POPUP_LIST_DIALOG_H
       
    20 #define APSEL_POPUP_LIST_DIALOG_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknradiobuttonsettingpage.h>
       
    24 #include <ApSettingsHandlerCommons.h>
       
    25 #include <ActiveApDb.h>  // for MActiveApDbObserver
       
    26 
       
    27 
       
    28 #include <AknIconArray.h>
       
    29 
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CApSelectorListboxModel;
       
    33 class CApSettingsHandlerImpl;
       
    34 
       
    35 
       
    36 // CLASS DECLARATION
       
    37 /**
       
    38 * CApSelPopupList class
       
    39 * Pop-up access point selector 'control' object.
       
    40 */
       
    41 NONSHARABLE_CLASS( CApSelPopupList ) : public CAknRadioButtonSettingPage, 
       
    42                                        public MActiveApDbObserver
       
    43     {
       
    44 
       
    45     public: // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Creates the popup list selector object
       
    49         * @param aModel                 Data model to be used for reading data.
       
    50         *                               Not owned. Must remain intact while 
       
    51         *                               the dialog exists.
       
    52         * @param aHandler               A CApSettingsHandlerImpl handling data
       
    53         * @param aCurrentSelectionIndex The item to highlight
       
    54         * @param aPreferredUid          The preferred Uid to select
       
    55         * @param aSelMenuType           The Options menu type it should have
       
    56         * @param aIspFilter             The ISP filtering criteria
       
    57         * @param aBearerFilter          The bearer filtering criteria
       
    58         * @param aSortType              The ordering type for the list
       
    59         * @param aEventStore            Event information holder
       
    60         * @param aItemArray             The listbox items
       
    61         * @param aNeedsNone             Gives whether 'None' item is present
       
    62         * @param aNoEdit                Gives wether editing is allowed or not
       
    63         * @param aReqIpvType            The IPv types included in the list
       
    64         * @param aVpnFilterType         The VPN filtering type
       
    65         * @return The created popup list selector object
       
    66         */
       
    67         static CApSelPopupList* NewL
       
    68                                 (
       
    69                                 CApSettingsModel& aModel,
       
    70                                 CApSettingsHandlerImpl& aHandler,
       
    71                                 TInt& aCurrentSelectionIndex,
       
    72                                 TInt& aPreferredUid,
       
    73                                 TSelectionMenuType aSelMenuType,
       
    74                                 TInt aIspFilter,
       
    75                                 TInt aBearerFilter,
       
    76                                 TInt aSortType,
       
    77                                 TUint32& aEventStore,
       
    78                                 CDesCArrayFlat* aItemArray,
       
    79                                 TBool aNeedsNone,
       
    80                                 TBool aNoEdit,
       
    81                                 TInt aReqIpvType = EIPv4,
       
    82                                 TVpnFilterType aVpnFilterType = EVpnFilterBoth
       
    83                                 );
       
    84 
       
    85 
       
    86 
       
    87         /**
       
    88         * Creates the popup list selector object
       
    89         * @param aModel                 Data model to be used for reading data.
       
    90         *                               Not owned. Must remain intact while 
       
    91         *                               the dialog exists.
       
    92         * @param aHandler               A CApSettingsHandlerImpl handling data
       
    93         * @param aCurrentSelectionIndex The item to highlight
       
    94         * @param aPreferredUid          The preferred Uid to select
       
    95         * @param aSelMenuType           The Options menu type it should have
       
    96         * @param aIspFilter             The ISP filtering criteria
       
    97         * @param aBearerFilter          The bearer filtering criteria
       
    98         * @param aSortType              The ordering type for the list
       
    99         * @param aEventStore            Event information holder
       
   100         * @param aItemArray             The listbox items
       
   101         * @param aNeedsNone             Gives whether 'None' item is present
       
   102         * @param aReqIpvType            The IPv types included in the list
       
   103         * @param aVpnFilterType         The VPN filtering type
       
   104         * @param aIncludeEasyWlan       To include Easy WLAN AP's or not
       
   105         * @param aNoEdit                Gives wether editing is allowed or not
       
   106         * @return The created popup list selector object
       
   107         */
       
   108         static CApSelPopupList* NewL
       
   109                                 (
       
   110                                 CApSettingsModel& aModel,
       
   111                                 CApSettingsHandlerImpl& aHandler,
       
   112                                 TInt& aCurrentSelectionIndex,
       
   113                                 TInt& aPreferredUid,
       
   114                                 TSelectionMenuType aSelMenuType,
       
   115                                 TInt aIspFilter,
       
   116                                 TInt aBearerFilter,
       
   117                                 TInt aSortType,
       
   118                                 TUint32& aEventStore,
       
   119                                 CDesCArrayFlat* aItemArray,
       
   120                                 TBool aNeedsNone,
       
   121                                 TInt aReqIpvType,
       
   122                                 TVpnFilterType aVpnFilterType,
       
   123                                 TBool aIncludeEasyWlan,
       
   124                                 TBool aNoEdit
       
   125                                 );
       
   126 
       
   127         /**
       
   128         * Constructor
       
   129         */
       
   130         virtual void ConstructL();
       
   131 
       
   132 
       
   133     protected:
       
   134         /**
       
   135         * Creates the popup list selector object
       
   136         * @param aModel                 Data model to be used for reading data.
       
   137         *                               Not owned. Must remain intact while 
       
   138         *                               the dialog exists.
       
   139         * @param aHandler               A CApSettingsHandlerImpl handling data
       
   140         * @param aIndex                 The item to highlight
       
   141         * @param aPreferredUid          The preferred Uid to select
       
   142         * @param aSelMenuType           The Options menu type it should have
       
   143         * @param aIspFilter             The ISP filtering criteria
       
   144         * @param aBearerFilter          The bearer filtering criteria
       
   145         * @param aSortType              The ordering type for the list
       
   146         * @param aItemArray             The listbox items
       
   147         * @param aEventStore            Event information holder
       
   148         * @param aNeedsNone             Gives whether 'None' item is present
       
   149         * @param aNoEdit                Gives wether editing is allowed or not
       
   150         * @param aReqIpvType            The IPv types included in the list
       
   151         * @param aVpnFilterType         The VPN filtering type
       
   152         * @return The created popup list selector object
       
   153         */
       
   154         CApSelPopupList
       
   155             (
       
   156             CApSettingsModel& aModel,
       
   157             CApSettingsHandlerImpl& aHandler,
       
   158             TInt& aIndex,
       
   159             TInt& aPreferredUid,
       
   160             TSelectionMenuType aSelMenuType,
       
   161             TInt aIspFilter,
       
   162             TInt aBearerFilter,
       
   163             TInt aSortType,
       
   164             CDesCArrayFlat* aItemArray,
       
   165             TUint32& aEventStore,
       
   166             TBool aNeedsNone,
       
   167             TBool aNoEdit,
       
   168             TInt aReqIpvType = EIPv4,
       
   169             TVpnFilterType aVpnFilterType = EVpnFilterBoth
       
   170             );
       
   171 
       
   172 
       
   173 
       
   174         /**
       
   175         * Creates the popup list selector object
       
   176         * @param aModel                 Data model to be used for reading data.
       
   177         *                               Not owned. Must remain intact while 
       
   178         *                               the dialog exists.
       
   179         * @param aHandler               A CApSettingsHandlerImpl handling data
       
   180         * @param aIndex                 The item to highlight
       
   181         * @param aPreferredUid          The preferred Uid to select
       
   182         * @param aSelMenuType           The Options menu type it should have
       
   183         * @param aIspFilter             The ISP filtering criteria
       
   184         * @param aBearerFilter          The bearer filtering criteria
       
   185         * @param aSortType              The ordering type for the list
       
   186         * @param aItemArray             The listbox items
       
   187         * @param aEventStore            Event information holder
       
   188         * @param aNeedsNone             Gives whether 'None' item is present
       
   189         * @param aReqIpvType            The IPv types included in the list
       
   190         * @param aVpnFilterType         The VPN filtering type
       
   191         * @param aIncludeEasyWlan       To include Easy WLAN AP's or not
       
   192         * @param aNoEdit                Gives wether editing is allowed or not
       
   193         * @return The created popup list selector object
       
   194         */
       
   195         CApSelPopupList
       
   196             (
       
   197             CApSettingsModel& aModel,
       
   198             CApSettingsHandlerImpl& aHandler,
       
   199             TInt& aIndex,
       
   200             TInt& aPreferredUid,
       
   201             TSelectionMenuType aSelMenuType,
       
   202             TInt aIspFilter,
       
   203             TInt aBearerFilter,
       
   204             TInt aSortType,
       
   205             CDesCArrayFlat* aItemArray,
       
   206             TUint32& aEventStore,
       
   207             TBool aNeedsNone,
       
   208             TInt aReqIpvType,
       
   209             TVpnFilterType aVpnFilterType,
       
   210             TBool aIncludeEasyWlan,
       
   211             TBool aNoEdit
       
   212             );
       
   213 
       
   214         /**
       
   215         * Destructor
       
   216         */
       
   217         virtual ~CApSelPopupList();
       
   218 
       
   219 
       
   220     public: // New functions
       
   221         /**
       
   222         * Sets the highlight.
       
   223         */
       
   224         void SetHighlighted();
       
   225 
       
   226     private:
       
   227 
       
   228         /**
       
   229         * Loads our own icons
       
   230         * @return The icon offset where they were appended.
       
   231         */
       
   232         TInt LoadIconsL();
       
   233 
       
   234 
       
   235     public: // Functions from base classes
       
   236         // From CCoeControl
       
   237         virtual void GetHelpContext(TCoeHelpContext& aContext) const;
       
   238 
       
   239         /**
       
   240         * Implements the MActiveApDbObserver protocol
       
   241         */
       
   242         virtual void HandleApDbEventL( TEvent anEvent );
       
   243 
       
   244 
       
   245         /**
       
   246         * Overrides ActivateL
       
   247         */
       
   248         virtual void ActivateL();
       
   249 
       
   250         // from CCoeControl
       
   251         virtual void HandleResourceChange(TInt aType);
       
   252 
       
   253     protected:
       
   254         // From CAknRadioButtonPage
       
   255         /*
       
   256         * Needed to know about SELECTION (not HIGHLIGHT!) changes
       
   257         * to be able to update currently valid selection UID.
       
   258         */
       
   259         virtual void SelectCurrentItemL();
       
   260         
       
   261     private:
       
   262         /**
       
   263         * From CAknSettingPage
       
   264         */
       
   265         TBool OkToExitL( TInt aButtonId );
       
   266 
       
   267 
       
   268     protected:  // New functions
       
   269         /**
       
   270         * Fills up listbox control with data dynamically
       
   271         */
       
   272         void FillListBoxWithDataL();
       
   273         
       
   274 
       
   275         /*
       
   276         * Sets the Selected item in the list.
       
   277         * Needed to initialize the list according to the Uid 
       
   278         * and not to 'itemindex'...
       
   279         */
       
   280         void SetSelectedL();
       
   281 
       
   282 
       
   283         /*
       
   284         * Checks for & handles the 'empty list' situation.
       
   285         * According to the spec., prompts for creating a new one...
       
   286         */
       
   287         void CheckIfEmptyL();
       
   288 
       
   289     protected:  // Functions from base classes
       
   290 
       
   291         /**
       
   292         * From CAknSettingPage
       
   293         */
       
   294         virtual void DynInitMenuPaneL( TInt aResourceId, 
       
   295                                        CEikMenuPane* aMenuPane );
       
   296 
       
   297         // From MEikCommandObserver
       
   298         virtual void ProcessCommandL( TInt aCommandId );
       
   299         
       
   300         // From MEikListBoxObserver
       
   301         void HandleListBoxEventL( CEikListBox* aListBox, 
       
   302                 MEikListBoxObserver::TListBoxEvent aEventType );
       
   303 
       
   304         // From CCoeControl
       
   305         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
       
   306                                      TEventCode aType);
       
   307 
       
   308     private: //data
       
   309         CApSettingsModel*               iDataModel; // not owns it, 
       
   310                                                     // just passed for usage!
       
   311         CAknSetStyleListBox*            iList;
       
   312         CApSelectorListboxModel*        iModel;     // owns it, just passes
       
   313                                                     // items for usage to list!
       
   314         TInt*                           iSelected;  // does not owns it, 
       
   315                                                     // just passed for usage!
       
   316         TInt                            iBearerFilter;
       
   317         TInt                            iIspFilter;
       
   318         TInt                            iSortType;
       
   319         TSelectionMenuType              iSelMenuType;
       
   320         CApSettingsHandlerImpl*         iHandler;       // does not owns it, 
       
   321                                                         // passed for usage
       
   322         TUint32*                        iEventStore;    // to hold the events
       
   323         TUint32                         iPreferredUid;
       
   324         TInt                            iPreferredLine;
       
   325         TBool                           iNeedsNone;
       
   326         TBool                           iNeedUnlock;
       
   327 
       
   328         TInt                            iReqIpvType; // Default is IPv4
       
   329         TVpnFilterType                  iVpnFilterType;
       
   330         TInt                            iVariant;       /// Local variant value
       
   331 
       
   332         CAknIconArray*                  iIcons;
       
   333 
       
   334         TBool                           iIncludeEasyWlan;
       
   335         TBool                           iInitialised;
       
   336         TBool                           iNoEdit;
       
   337         TBool							iHelpSupported;
       
   338         TBool							iProtectionSupported;
       
   339         TBool                           iDoExit;
       
   340     };
       
   341 
       
   342 #endif
       
   343 
       
   344 // End of File