apengine/apsettingshandlerui/inc/ApSelectorDialog.h
changeset 0 5a93021fdf25
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     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 dialog CApSelectorDialog for access point selection.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef APSELECTORDIALOG_H
       
    21 #define APSELECTORDIALOG_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <aknlists.h>
       
    25 #include <AknForm.h>
       
    26 
       
    27 #include <ApSettingsHandlerCommons.h>
       
    28 #include <ActiveApDb.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CApSelectorListboxModel;
       
    32 class CApSelectorListbox;
       
    33 class CTextOverrides;
       
    34 class CEikStatusPane;
       
    35 class CAknTitlePane;
       
    36 class CAknNavigationControlContainer;
       
    37 class CAknNavigationDecorator;
       
    38 class CApSettingsModel;
       
    39 class CApSettingsHandlerImpl;
       
    40 
       
    41 
       
    42 // CLASS DECLARATION
       
    43 /**
       
    44 * CApSelectorDialog dialog class
       
    45 * 
       
    46 */
       
    47 NONSHARABLE_CLASS( CApSelectorDialog ) : 
       
    48         public CAknDialog, public MEikListBoxObserver, 
       
    49         public MActiveApDbObserver
       
    50     {
       
    51 
       
    52     public: // Constructors and destructor
       
    53         /**
       
    54         * Create and launch dialog.
       
    55         * @param aModel Model to be used for reading data. Not owned.
       
    56         * Must remain intact while the dialog exists.
       
    57         * @param aHandler A CApSettingsHandlerImpl 
       
    58         * @param aHighLight The item to highlight
       
    59         * @param aSelected  The UID of the selected item. 
       
    60         * @return The dialog's return code
       
    61         */
       
    62         TInt ConstructAndRunLD( CApSettingsModel& aModel, 
       
    63                                 CApSettingsHandlerImpl& aHandler,
       
    64                                 TUint32 aHighLight, TUint32& aSelected );
       
    65 
       
    66 
       
    67    
       
    68         /**
       
    69         * Construct the dialog. The passed parameters determine 
       
    70         * the filtering rules it will use.
       
    71         * @param aListType      The list type it should use to display 
       
    72         *                       the list of access points
       
    73         * @param aSelMenuType   The Options menu type it should have
       
    74         * @param aIspFilter     The ISP filtering criteria
       
    75         * @param aBearerFilter  The bearer filtering criteria
       
    76         * @param aSortType      The ordering type for the list
       
    77         * @param aEventStore    Event information holder
       
    78         * @param aNoEdit        Gives wether editing is allowed or not
       
    79         * @param aReqIpvType    The IPv type which are included in the list
       
    80         * @return The constructed dialog object
       
    81         */
       
    82         static CApSelectorDialog* NewL( TSelectionListType aListType,
       
    83                                         TSelectionMenuType aSelMenuType,
       
    84                                         TInt aIspFilter,
       
    85                                         TInt aBearerFilter,
       
    86                                         TInt aSortType,
       
    87                                         TUint32& aEventStore,
       
    88                                         TBool aNoEdit,
       
    89                                         TInt aReqIpvType = EIPv4 
       
    90                                         );
       
    91 
       
    92 
       
    93         /** 
       
    94         * Destructor.
       
    95         */
       
    96         ~CApSelectorDialog();
       
    97 
       
    98     protected:
       
    99         /**
       
   100         * Constructor. The passed parameters determine 
       
   101         * the filtering rules it will use.
       
   102         * @param aListType      The list type it should use to display 
       
   103         *                       the list of access points
       
   104         * @param aSelMenuType   The Options menu type it should have
       
   105         * @param aIspFilter     The ISP filtering criteria
       
   106         * @param aBearerFilter  The bearer filtering criteria
       
   107         * @param aSortType      The ordering type for the list
       
   108         * @param aEventStore    Event information holder
       
   109         * @param aReqIpvType    The IPv type which are included in the list
       
   110         * @param aNoEdit        Gives wether editing is allowed or not
       
   111         */
       
   112         CApSelectorDialog(  TSelectionListType aListType,
       
   113                             TSelectionMenuType aSelMenuType,
       
   114                             TInt aIspFilter,
       
   115                             TInt aBearerFilter,
       
   116                             TInt aSortType,
       
   117                             TUint32& aEventStore,
       
   118                             TInt aReqIpvType,
       
   119                             TBool aNoEdit
       
   120                           );
       
   121 
       
   122 
       
   123 
       
   124     public: // New functions
       
   125 
       
   126         /**
       
   127         * Sets initial texts
       
   128         */
       
   129         void InitTextsL();
       
   130 
       
   131 
       
   132         /**
       
   133         * Handles listbox data changes
       
   134         */
       
   135         void HandleListboxDataChangeL();
       
   136 
       
   137         
       
   138         /**
       
   139         * Sets the text overrides.
       
   140         * @param aOverrides An object containing the overriden texts
       
   141         */
       
   142         void SetTextOverrides( CTextOverrides* aOverrides );
       
   143 
       
   144         
       
   145         /**
       
   146         * Checks if the list is empty
       
   147         */
       
   148         void CheckIfEmptyL();
       
   149 
       
   150         
       
   151         /**
       
   152         * Sets the highlight 
       
   153         */
       
   154         void SetHighlighted();
       
   155 
       
   156     public: // Functions from base classes
       
   157         // From CCoeControl
       
   158         virtual void ActivateL();
       
   159         
       
   160         // From CCoeControl
       
   161         virtual void GetHelpContext(TCoeHelpContext& aContext) const;
       
   162 
       
   163         // From MActiveApDbObserver
       
   164         virtual void HandleApDbEventL( TEvent anEvent );
       
   165 
       
   166         // From MEikCommandObserver
       
   167         virtual void ProcessCommandL( TInt aCommandId ) ; 
       
   168 
       
   169         // From MEikListBoxObserver
       
   170         void HandleListBoxEventL( CEikListBox* aListBox, 
       
   171                                   TListBoxEvent aEventType );
       
   172 
       
   173         SEikControlInfo CreateCustomControlL( TInt aControlType );
       
   174 
       
   175         // From MEikMenuObserver
       
   176         virtual void DynInitMenuPaneL( TInt aResourceId, 
       
   177                                        CEikMenuPane* aMenuPane );
       
   178 
       
   179         // From CAknDialog
       
   180         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   181                                      TEventCode aType);
       
   182 
       
   183 
       
   184     protected:
       
   185         // From CEikDialog
       
   186         virtual void PreLayoutDynInitL();
       
   187 
       
   188         
       
   189         // From CEikDialog
       
   190         virtual void PostLayoutDynInitL();
       
   191 
       
   192         // From CAknDialog
       
   193         TBool OkToExitL( TInt aButtonId );
       
   194 
       
   195         /**
       
   196         * Internal representation of the implementation of 
       
   197         * ProcessCommandL from MEikCommandObserver
       
   198         */
       
   199         void DoProcessCommandL( TInt aCommandId );
       
   200 
       
   201 
       
   202     private: //data
       
   203 
       
   204         CEikStatusPane*                 iStatusPane;    // NOT owned
       
   205         CAknTitlePane*                  iTitlePane;     // NOT owned
       
   206         CAknNavigationControlContainer* iNaviPane;      // NOT owned
       
   207         CAknNavigationDecorator*        iNaviDecorator; // owned
       
   208         HBufC*                          iOldTitleText;
       
   209         CApSettingsModel*               iDataModel; // not owned,
       
   210                                                     // passed for usage
       
   211         CApSelectorListbox*             iList;
       
   212 
       
   213         CApSettingsHandlerImpl*         iHandler;
       
   214         CApSelectorListboxModel*        iModel;
       
   215         TSelectionListType              iListType;
       
   216         TSelectionMenuType              iSelMenuType;
       
   217 
       
   218         TUint32                         iHighLight;
       
   219         TUint32*                        iSelected;        
       
   220 
       
   221         TInt                            iIspFilter;
       
   222         TInt                            iBearerFilter;
       
   223         TInt                            iSortType;
       
   224 
       
   225         CTextOverrides*                 iTextOverrides; // not owned,
       
   226                                                         // passed for usage
       
   227 
       
   228         TUint32                         iPreferredUid;
       
   229         TInt                            iPreferredLine;
       
   230         TUint32*                        iEventStore;
       
   231         TBool                           iNeedUnlock;
       
   232         TBool                           iModelPassed;
       
   233         TApUiExitReason                 iExitReason;
       
   234         
       
   235         TInt                            iReqIpvType; /// Default is IPv4
       
   236         TInt                            iVariant;    /// Local variant value
       
   237 
       
   238 #ifdef __TEST_OOMDEBUG
       
   239         TBool                           iMemTestOn;
       
   240 #endif // __TEST_OOMDEBUG
       
   241         
       
   242         TBool                           iInitialised;
       
   243         TBool                           iNoEdit;
       
   244         TBool							iHelpSupported;
       
   245     };
       
   246 
       
   247 #endif
       
   248 
       
   249 // End of File