cmmanager/cmmgr/Framework/Inc/destdlg.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 0 5a93021fdf25
child 14 7958d42f9d1a
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
       
     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:  Dialog for displaying and editing destinations.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DESTDIALOG_H
       
    19 #define DESTDIALOG_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <AknForm.h>
       
    23 #include <cmsettingsui.h>
       
    24 #include "destlistboxmodel.h"
       
    25 #include "destlistbox.h"
       
    26 #include "cmmanagerimpl.h"
       
    27 #include "cmconnsettingsuiimpl.h"
       
    28 #include <mcmdexec.h>
       
    29 #include "cmcommsdatnotifier.h"
       
    30 
       
    31 // CLASS DECLARATION
       
    32 class CEikStatusPane;
       
    33 class CAknTitlePane;
       
    34 class CAknNavigationControlContainer;
       
    35 class CAknNavigationDecorator;
       
    36 class CCmWizard;
       
    37 class CCmdExec;
       
    38 
       
    39 /**
       
    40 *  Dialog for setting the gateway's IP address
       
    41 */
       
    42 NONSHARABLE_CLASS( CDestDlg ) : public CAknDialog
       
    43                               , MEikListBoxObserver
       
    44                               , public MCmdExec
       
    45                               , public MCmCommsDatWatcher
       
    46     {
       
    47     public :    // construction
       
    48     
       
    49         /**
       
    50         * Default constructor.
       
    51         */
       
    52         CDestDlg();
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         ~CDestDlg();
       
    58         
       
    59          /**
       
    60         * Create and launch dialog.
       
    61         * @return           The code returned by the dialogs' ExecuteLD
       
    62         */
       
    63         TInt ConstructAndRunLD( CCmManagerImpl* aCmManager, TUint32 aHighLight, 
       
    64                                 TUint32& aSelected, TBool& aExiting );
       
    65 
       
    66         // From MEikMenuObserver
       
    67         virtual void DynInitMenuPaneL( TInt aResourceId, 
       
    68                                        CEikMenuPane* aMenuPane );
       
    69 
       
    70         // From MEikCommandObserver
       
    71         virtual void ProcessCommandL( TInt aCommandId ) ; 
       
    72 
       
    73         /**
       
    74         * Updates listbox data
       
    75         */
       
    76         void HandleListboxDataChangeL();
       
    77 
       
    78         /**
       
    79         * Handle key event.
       
    80         * @param aKeyEvent The key event.
       
    81         * @param aType Key event type.
       
    82         * @return Response (was the key event consumed?).
       
    83         */
       
    84         TKeyResponse OfferKeyEventL
       
    85             ( const TKeyEvent& aKeyEvent, TEventCode aType );        
       
    86         
       
    87      
       
    88 	public:
       
    89         /**
       
    90          * From base class MCmdExec
       
    91          */
       
    92         void Execute();
       
    93 
       
    94         /**
       
    95          * From base class MCmdExec
       
    96          */
       
    97         void CDestDlg::HandleLeaveError( TInt aError );
       
    98 
       
    99     public: // From CCoeControl
       
   100     
       
   101         /**
       
   102         * Returns the help context
       
   103         * From CCoeControl
       
   104         * 
       
   105         * @since S60 3.2
       
   106         * @param aContext the returned help context
       
   107         */
       
   108         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   109         
       
   110         /**
       
   111         * Handles the resource change
       
   112         * From CCoeControl
       
   113         * 
       
   114         * @since S60 5.0
       
   115         * @param aType Type of the resource change
       
   116         */
       
   117 		void HandleResourceChange( TInt aType );
       
   118         
       
   119         /**
       
   120         * Show default connection note
       
   121         * 
       
   122         * @since S60 5.0
       
   123         * @param aOldConn Old default connection
       
   124         */
       
   125         void ShowDefaultConnectionNoteL(TCmDefConnValue aOldDefConn);
       
   126         
       
   127     public: // From MCmCommsDatWatcher
       
   128         
       
   129         /**
       
   130          * Watch changes in CommsDat
       
   131          */
       
   132         void CommsDatChangesL();
       
   133         
       
   134     protected :    // from CEikDialog
       
   135     
       
   136         /**
       
   137         * Set the gateway's IP address, if the user pressed OK.
       
   138         * @param aButtonId The ID of the pressed button.
       
   139         * @return May the dialog exit?
       
   140         */
       
   141         TBool OkToExitL( TInt aButtonId ) ;
       
   142         
       
   143         void PreLayoutDynInitL();
       
   144         
       
   145         SEikControlInfo CreateCustomControlL ( TInt aControlType );
       
   146 
       
   147         // From MEikListBoxObserver
       
   148         void HandleListBoxEventL( CEikListBox* aListBox, 
       
   149                                   TListBoxEvent aEventType );
       
   150                                   
       
   151         /**
       
   152         * Sets the number of connections text on navi pane
       
   153         */                                  
       
   154         void SetNoOfDestsL(TInt aCount);                                  
       
   155 
       
   156     private:
       
   157     
       
   158         /**
       
   159         * Initialises listbox texts
       
   160         */    
       
   161         void InitTextsL();
       
   162 
       
   163         /**
       
   164         * Creates a new destination and adds it to Destination view.
       
   165         */
       
   166         void AddDestinationL();
       
   167         
       
   168         /**
       
   169         * Called when user selected edit on a destination.
       
   170         */
       
   171         void OnCommandDestinationEditL();
       
   172         
       
   173         /**
       
   174         * Called when user selected delete on a destination.
       
   175         */
       
   176         void OnCommandDestinationDeleteL();
       
   177         
       
   178         /**
       
   179         * Called when user selected rename on a destination.
       
   180         */
       
   181         void OnCommandDestinationRenameL();
       
   182         
       
   183         /**
       
   184         * Called when destination is about to be deleted.
       
   185         */
       
   186         TBool IsThereProtectedMethodL( CCmDestinationImpl* aDest );
       
   187         
       
   188         /**
       
   189         * Sets the text of the middle soft key by the text resource. 
       
   190         */
       
   191         void CDestDlg::SetMskL( TInt aResourceId );
       
   192         
       
   193         /**
       
   194         * Shows the 'Default set to:' note.
       
   195         */
       
   196         void ShowDefaultSetNoteL(TCmDefConnValue aSelection);
       
   197         
       
   198         /**
       
   199         * Shows the 'Default:' in navi pane.
       
   200         */
       
   201         void SetDefaultNaviL( TCmDefConnValue aSelection );
       
   202         
       
   203         /**
       
   204         * Counts how many CMs can be displayed.(Shouldn't display
       
   205         * CMs for which the plugin is not loaded.)
       
   206         */
       
   207         TUint32 NumberOfCMsL( RArray<TUint32> cmArray );
       
   208 
       
   209         /**
       
   210         * Enforced to release allocated memory and reset protection
       
   211         * when some exceptions occur
       
   212         */
       
   213         void EnforcedResetCDestDlg();
       
   214      
       
   215     protected:
       
   216     
       
   217         CDestListboxModel*      iModel;
       
   218         CDestListbox*           iListbox;
       
   219         TUint32                 iHighlight;
       
   220         TUint32*                iSelected;           
       
   221         TBool                   iModelPassed;
       
   222         CEikStatusPane*         iStatusPane;    // NOT owned
       
   223         CAknTitlePane*          iTitlePane;     // NOT owned
       
   224         CAknNavigationControlContainer* iNaviPane;      // NOT owned
       
   225         CAknNavigationDecorator*        iNaviDecorator; // owned
       
   226         HBufC*                  iOldTitleText;
       
   227         CCmManagerImpl*         iCmManagerImpl; // NOT owned
       
   228         TInt                    iExitReason;    // Exit reason, can be 
       
   229                                                 // KUserExit or KUserBack
       
   230                                                 // used to pass user exit event   
       
   231         CCmConnSettingsUiImpl* iConnSettingsImpl;
       
   232         CCmdExec*             iCmdExec;        
       
   233         
       
   234      private:     
       
   235 
       
   236         CCmWizard*          iCmWizard; // wizard for connection method creation
       
   237         // Indicated that Escape has arrived and it should be forwarded when CmWizard
       
   238         // finished its work
       
   239         TBool               iEscapeArrived;
       
   240         
       
   241         // Indicates whether the Exit button was pressed. Not owned.
       
   242         TBool*              iExiting;
       
   243         
       
   244         // This dialog shouldn't exit while processing in a plugin
       
   245         // Indicates whether processing or not
       
   246         TBool               iProcessing;
       
   247     };
       
   248 
       
   249 #endif