cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnnextlayerselectdlg.h
changeset 0 5a93021fdf25
child 4 77415202bfc8
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Popup for selecting the underlying connection method or 
       
    15 *                destination for a VPN connection method
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CMPVPN_NEXT_LAYER_SELECT_DLG_H
       
    20 #define CMPVPN_NEXT_LAYER_SELECT_DLG_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <eikmobs.h>  // MEikMenuObserver
       
    24 #include <aknPopup.h> // CAknPopupList
       
    25 
       
    26 #include <ConeResLoader.h> // resource reader
       
    27 
       
    28 class CEikFormattedCellListBox;
       
    29 class CEikMenuBar;
       
    30 class CEikonEnv;
       
    31 class CCmPluginBaseEng;
       
    32 class CCmManagerImpl;
       
    33 class CGulIcon;
       
    34 
       
    35 
       
    36     
       
    37 /**
       
    38  *  CmPluginVpnNextLayerSelectDlg dialog class
       
    39  *
       
    40  *  
       
    41  *
       
    42  *  @since S60 v3.2
       
    43  */
       
    44 NONSHARABLE_CLASS( CmPluginVpnNextLayerSelectDlg ) : public CAknPopupList, 
       
    45                                                      public MEikMenuObserver
       
    46     {
       
    47     public: // Constructors and destructor
       
    48     
       
    49         static CmPluginVpnNextLayerSelectDlg* NewL( 
       
    50                                         CCmPluginBaseEng& aCmPluginBaseEng,
       
    51                                         RArray<TUint32>& aBindableMethods,
       
    52                                         TBool& aSnapSelected,
       
    53                                         TUint32& aNextLayerId );
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CmPluginVpnNextLayerSelectDlg();
       
    59     
       
    60     private: // Constructor
       
    61     
       
    62         /**
       
    63         * Constructor.
       
    64         */      
       
    65         CmPluginVpnNextLayerSelectDlg( CCmPluginBaseEng& aCmPluginBaseEng,
       
    66                                        RArray<TUint32>& aBindableMethods,
       
    67                                        TBool& aSnapSelected,
       
    68                                        TUint32& aNextLayerId );
       
    69         
       
    70         /**
       
    71         * Second phase constructor. Leaves on failure.
       
    72         */      
       
    73         void ConstructL();
       
    74 
       
    75     public: // From MEikMenuObserver
       
    76         
       
    77         /**
       
    78          * See base class
       
    79          */
       
    80         void ProcessCommandL( TInt aCommandId );
       
    81         
       
    82         /**
       
    83          * See base class
       
    84          */
       
    85         void SetEmphasis( CCoeControl* aMenuControl, TBool aEmphasis );
       
    86         
       
    87         /**
       
    88          * See base class
       
    89          */
       
    90         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    91 
       
    92     public: // From CCoeControl
       
    93     
       
    94         /**
       
    95         * Returns the help context
       
    96         * From CCoeControl
       
    97         * 
       
    98         * @since S60 3.2
       
    99         * @param aContext the returned help context
       
   100         */
       
   101         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   102         
       
   103          /**
       
   104         * From CCoeControl, makes control visible/invisible.
       
   105         * @param aVisible ETrue if visible, EFalse if invisible.
       
   106         */
       
   107         void MakeVisible( TBool aVisible );
       
   108         
       
   109         /**
       
   110         * From CCoeControl
       
   111         *
       
   112         * @since S60 3.2
       
   113         * @param aKeyEvent The key event.
       
   114         * @param aType Key event type.
       
   115         * @return key response (was the key event consumed?).
       
   116         */
       
   117         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
       
   118                                      TEventCode aType );
       
   119                                      
       
   120         // From MEikListBoxObserver
       
   121         void HandleListBoxEventL( CEikListBox* aListBox, 
       
   122                                   TListBoxEvent aEventType );
       
   123                                    
       
   124     public: // new functions
       
   125    
       
   126         /**
       
   127         * Display the Options menu
       
   128         *
       
   129         *
       
   130         * @since S60 3.2
       
   131         */
       
   132         void DisplayMenuL();
       
   133 
       
   134         /**
       
   135         * Hide the Options menu.
       
   136         *
       
   137         *
       
   138         * @since S60 3.2
       
   139         */
       
   140         void HideMenu();
       
   141 
       
   142         /**
       
   143         * Is the Options menu opened?
       
   144         *
       
   145         *
       
   146         * @since S60 3.2
       
   147         * @return ETrue if showing
       
   148         */
       
   149         TBool MenuShowing() const;
       
   150         
       
   151     private: // new functions
       
   152     
       
   153         /*
       
   154         * Load the given resource file
       
   155         *
       
   156         * @since S60 3.2
       
   157         * @param aResFileName
       
   158         */
       
   159         void LoadResourceL( const TDesC& aResFileName );
       
   160         
       
   161         /*
       
   162         * Formats the texts for the list items using given resources
       
   163         *
       
   164         * @param aFirstLineResId the resource Id for the first line
       
   165         * @param aSecondLineResId the resource Id for the second line
       
   166         * @param aIconIndex the icon's index value
       
   167         * @return the formatted text
       
   168         */
       
   169         HBufC* FormatListItemTextsLC( TInt aFirstLineResId,
       
   170                                       TInt aSecondLineResId,
       
   171                                       TInt aIconIndex );
       
   172         
       
   173         
       
   174         
       
   175         /**
       
   176         */
       
   177         HBufC* FormatListItemTextsLC( TInt aFirstLineResId,
       
   178                                       const TDesC& aSecondLineText,
       
   179                                       TInt aIconIndex );
       
   180                                       
       
   181         /**
       
   182         */
       
   183         HBufC* FormatListItemTextsLC( const TDesC& aFirstLineResId,
       
   184                                       const TDesC& aSecondLineText,
       
   185                                       TInt aIconIndex );
       
   186                                       
       
   187         /**
       
   188         */
       
   189         HBufC* FormatListItemTextsL( const TDesC& aFirstLineText,
       
   190                                      const TDesC& aSecondLineText,
       
   191                                      TInt aIconIndex );
       
   192                                      
       
   193         /**
       
   194         * Displays a radio button selection dialog to select the 
       
   195         * underlying connection method
       
   196         *
       
   197         * @since S60 3.2
       
   198         * @param aDestinationId the destination id to search
       
   199         * @param aCmId the selection as a return value
       
   200         * @return ETrue if selection made EFalse if cancelled
       
   201         */
       
   202         TBool ShowCMSelectionDlgL( TUint32 aDestinationId, 
       
   203                                    TUint32& aCmId );
       
   204 
       
   205         void InitialiseL();
       
   206         
       
   207         void SetTextsAndIconsL();
       
   208         
       
   209         void AppendDestinationTextsL( CCmDestinationImpl& aDestination,
       
   210                                  TInt aNumCms,
       
   211                                  CDesCArray& aItems,
       
   212                                  CArrayPtr<CGulIcon>& aIcons );
       
   213                                        
       
   214         void AppendUncatDestinationL( CDesCArray& aItems,
       
   215                                       CArrayPtr<CGulIcon>& aIcons );
       
   216                                     
       
   217         void AppendEasyWlanL( CDesCArray& aItems,
       
   218                               CArrayPtr<CGulIcon>& aIcons );
       
   219                            
       
   220 
       
   221     private: // data members
       
   222   
       
   223         /**
       
   224          * Eikon environment
       
   225          */
       
   226         CEikonEnv& iMyEikonEnv;        
       
   227   
       
   228         /**
       
   229          * Owned list box
       
   230          */
       
   231         CEikFormattedCellListBox* iMyListBox;
       
   232         
       
   233         /**
       
   234          * Owned menu bar.
       
   235          */
       
   236         CEikMenuBar* iMenuBar;
       
   237         
       
   238         /**
       
   239          * base class not owned
       
   240          */
       
   241         CCmPluginBaseEng& iCmPluginBaseEng;
       
   242         
       
   243         /**
       
   244          * Result of selection: ETrue if a SNAP was selected
       
   245          */
       
   246         TBool& iSnapSelected;
       
   247         
       
   248         /**
       
   249          * Result of selection: The ID of the connection method or SNAP
       
   250          */
       
   251         TUint32& iNextLayerId;
       
   252                  
       
   253         /**
       
   254          * Resource reader
       
   255          */
       
   256         RConeResourceLoader iResourceReader;
       
   257                  
       
   258         /**
       
   259          * An array containing all of the destination's ids
       
   260          */
       
   261         RArray<TUint32>& iDestinations;
       
   262         
       
   263         /**
       
   264          * The id of EasyWlan ( zero if none )
       
   265          */
       
   266         TUint32 iEasyWlanId;
       
   267         
       
   268         /**
       
   269          * access to the cmmanager
       
   270          */
       
   271         CCmManagerImpl& iCmManager; // not owned
       
   272         
       
   273         /**
       
   274          * Flag to determine if there are uncategorised connection methods
       
   275          */
       
   276         TBool iUncatItems;
       
   277         
       
   278     };
       
   279 #endif // CMPVPN_NEXT_LAYER_SELECT_DLG_H