wvuing/IMPSServiceSettingsUI/Src/CWVSettingsUIServerListDialog.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Serverlist dialog
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWVSETTINGSUISERVERLISTDIALOG_H
       
    21 #define CWVSETTINGSUISERVERLISTDIALOG_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CWVSettingsUIDefineNewServerDialog.h"
       
    25 #include "CWVSettingsUIDialogImp.h"
       
    26 
       
    27 #include <eiklbo.h>
       
    28 #include <MIMPSSAPObserver.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CIMPSSAPSettingsStore;
       
    32 class CWVSettingsUIServersArray;
       
    33 class CAknSingleStyleListBox;
       
    34 class MWVSettingsObserver;
       
    35 class CWVSettingsUIDialogTitlePaneHandler;
       
    36 class CIMPSPresenceConnectionUi;
       
    37 class CIMPSSAPSettingsList;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Server list dialog
       
    43 *
       
    44 *  @lib WVServiceSettingsUi.dll
       
    45 *  @since 2.1
       
    46 */
       
    47 NONSHARABLE_CLASS( CWVSettingsUIServerListDialog ) : public CAknDialog,
       
    48         public MEikListBoxObserver,
       
    49         public MIMPSSAPObserver
       
    50     {
       
    51 public:  // Constructors and destructor
       
    52 
       
    53     /**
       
    54     * C++ default constructor.
       
    55     * @param aSAPSettingsStore Pointer to SAP settings store
       
    56     * @param aCaller Pointer to the dialog observer
       
    57     * @param aTitlePaneHandler Pointer to status-pane handler
       
    58     * @param aDialog Pointer to the service settings ui dialog
       
    59     * @param aConnectionUi pointer to connection ui
       
    60     */
       
    61     CWVSettingsUIServerListDialog(	CIMPSSAPSettingsStore& aSAPSettingsStore,
       
    62     MWVSettingsObserver& aCaller,
       
    63     CWVSettingsUIDialogTitlePaneHandler& aTitlePaneHandler,
       
    64     CWVSettingsUIDialogImp& aDialog,
       
    65     CIMPSPresenceConnectionUi* aConnectionUi );
       
    66 
       
    67     /**
       
    68     * Destructor.
       
    69     */
       
    70     virtual ~CWVSettingsUIServerListDialog();
       
    71 
       
    72 public: // New functions
       
    73 
       
    74     /**
       
    75      * Refreshes title
       
    76      * @since 2.1
       
    77      */
       
    78     void RefreshTitleL();
       
    79 
       
    80     /**
       
    81      * Help key support - GetHelpContext is called by the framework on
       
    82      * event EAknCmdHelp
       
    83      * --------------------------------------------------------------------------------
       
    84      * CWVSettingsUIDefineNewServerDialog::GetHelpContext
       
    85      * @param 	aContext	The context dependent on the current view is passed by the framework.
       
    86      */
       
    87     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
    88 
       
    89 private: //New functions
       
    90 
       
    91     /**
       
    92     * Displays server editor
       
    93     * @since 2.1
       
    94     * @param aEditMode Edit mode
       
    95     */
       
    96     TWVSettingsDialogReturnValue DisplayServerEditorDialogL(
       
    97         CWVSettingsUIDefineNewServerDialog::TEditMode aEditMode );
       
    98 
       
    99     /**
       
   100     * Asks needed confirmations and deletes selected server
       
   101     * @since 2.1
       
   102     */
       
   103     void DeleteSelectedServerL();
       
   104 
       
   105     /**
       
   106     * Asks for confirmation about logout and performs it if accepted
       
   107     * @since 2.1
       
   108     * @return ETrue if logged out, EFalse if we stayed logged in
       
   109     */
       
   110     TBool ConfirmLogoutL();
       
   111 
       
   112     /**
       
   113     * Executes confirmation dialog
       
   114     * @since 2.1
       
   115     * @param aPrompt Text in dialog
       
   116     * @return Dialog return value
       
   117     */
       
   118     TInt ExecuteConfirmationDialogL( const TDesC& aPrompt );
       
   119 
       
   120     /**
       
   121     * Return SAP settings of given index
       
   122     * Ownership is transferred to caller
       
   123     * @since 2.1
       
   124     * @param aIndex Index of the server in array
       
   125     * @return SAP settings, NOTE can return NULL!
       
   126     */
       
   127     CIMPSSAPSettings* GetSAPL( TInt aIndex );
       
   128 
       
   129     /**
       
   130     * Refreshes internal model
       
   131     * @since 2.1
       
   132     */
       
   133     void UpdateModelL();
       
   134 
       
   135     /**
       
   136     * Loads protected server icon bitmap.
       
   137     * @since 2.1
       
   138     */
       
   139     void LoadListboxIconArrayL();
       
   140 
       
   141     /**
       
   142     * Launches help
       
   143     * @param aContext, the help context to be shown
       
   144     * @since 2.1
       
   145     */
       
   146     void LaunchHelpL( const TDesC& aContext );
       
   147 
       
   148     /**
       
   149     * Show brand protection note
       
   150     * @since 2.1
       
   151     */
       
   152     void ShowBrandProtectionNoteL();
       
   153 
       
   154     /**
       
   155      * Stores the given command and launches correct dialog
       
   156      * asynchronously
       
   157      * @param aCommand command to execute
       
   158      */
       
   159     void LaunchCorrectDialog( TInt aCommand );
       
   160 
       
   161     /**
       
   162      * Static TCallBack method to handle async dialog launching
       
   163      * This will call DoLaunchCorrectDialogL.
       
   164      * @see TCallBack
       
   165      */
       
   166     static TInt LaunchDlgCallback( TAny* aDlg );
       
   167 
       
   168     /**
       
   169      * This method will launch the correct dialog
       
   170      * determined by iDlgCommand.
       
   171      * Do not call this directly. Use LaunchCorrectDialog;
       
   172      */
       
   173     void DoLaunchCorrectDialogL();
       
   174 
       
   175     /**
       
   176      *
       
   177      * set the iIsOpenedTargettDlg value.
       
   178      * aFlag is ETrue while try to open target dialog, or is EFalse after target was closed.
       
   179      */
       
   180     void SetTargetDlgFlag( TBool aFlag );
       
   181 
       
   182     /**
       
   183      *
       
   184      * get the flag value.
       
   185      */
       
   186     TBool GetTargetDlgFlag();
       
   187 
       
   188 private:	//From MEikCommandObserver
       
   189 
       
   190     /**
       
   191     * From MEikCommandObserver Command handler
       
   192     * @param aCommand Command that was initiated
       
   193     */
       
   194     void ProcessCommandL( TInt aCommand );
       
   195 
       
   196 private: // Functions from MEikListBoxObserver
       
   197 
       
   198     /**
       
   199     * From MEikListBoxObserver Callback for listbox events
       
   200     * @param aListBox Originating listbox
       
   201     * @param aEventType Event type
       
   202     */
       
   203     void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   204 
       
   205 private:
       
   206     /**
       
   207      * From CCoeControl. Handles the keyevents
       
   208      * @param aKeyEvent The key event.
       
   209      * @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
       
   210      * @return Indicates whether or not the key event was used by this control
       
   211      */
       
   212     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   213 
       
   214     /**
       
   215     * From Uikon framework. Dynamically initialises a menu pane.
       
   216     * @param aResourceId Resource ID identifying the menu pane to initialise
       
   217     * @param aMenuPane The in-memory representation of the menu pane
       
   218     */
       
   219     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   220 
       
   221 private: // From MIMPSSAPObserver
       
   222 
       
   223     /**
       
   224     * From MIMPSSAPObserver
       
   225     * @see MIMPSSAPObserver for more information
       
   226     */
       
   227     void HandleSAPEvent( TSAPEvent aEvent );
       
   228 
       
   229 private:
       
   230 
       
   231     /**
       
   232     * The function to fetch the setting value given the ID, which could be in CENREP or Variation file
       
   233     */
       
   234     TInt IntResourceValueL( TInt aResourceId );
       
   235 
       
   236 protected:  // Functions from CEikDialog
       
   237 
       
   238     /**
       
   239     * From CEikDialog @see CEikDialog for more information
       
   240     */
       
   241     void PreLayoutDynInitL();
       
   242 
       
   243     /**
       
   244     * From CEikDialog @see CEikDialog for more information
       
   245     */
       
   246     TInt MappedCommandId( TInt aButtonId );
       
   247 
       
   248     /**
       
   249      * @see CEikDialog
       
   250      */
       
   251     TBool OkToExitL( TInt aButtonId );
       
   252 
       
   253 private:    // Data
       
   254 
       
   255     // Doesn'w own. sap settings storage
       
   256     CIMPSSAPSettingsStore* iSAPSettingsStore;
       
   257     // Doesn't own. Listbox owns this data
       
   258     CWVSettingsUIServersArray* iServerListAdapter;
       
   259     // Doesn't own. This is responsibility of dialog
       
   260     CAknSingleStyleListBox* iListBox;
       
   261     // Doesn't own the user of the dialog
       
   262     MWVSettingsObserver* iObserver;
       
   263 
       
   264     // Owns. Title pane text
       
   265     HBufC* iTitle;
       
   266 
       
   267     // array of protected servers
       
   268     RArray<TInt> iProtectedServers;
       
   269     // Doesn't own. Title pane handler. Changes the title pane text
       
   270     CWVSettingsUIDialogTitlePaneHandler* iTitlePaneHandler;
       
   271 
       
   272     // Doesn't own, the "base"-dialog (imp)
       
   273     CWVSettingsUIDialogImp* iDialog;
       
   274 
       
   275     // Doesn't own: Pointer to a presence connection UI
       
   276     CIMPSPresenceConnectionUi* iConnectionUI;
       
   277 
       
   278     // Owns: sap settings
       
   279     CIMPSSAPSettings* iSAP;
       
   280 
       
   281     // Tells if the editor dialog is active
       
   282     TBool iEditorActive;
       
   283 
       
   284     // the uid of the selected server
       
   285     TUint32 iCurrent;
       
   286 
       
   287     // Tells if a SAP has possibly been added to the list
       
   288     TBool iAdded;
       
   289 
       
   290     // the uid of the added server
       
   291     TUint32 iNewUid;
       
   292 
       
   293     // Async command to execute
       
   294     TInt iDlgCommand;
       
   295 
       
   296     // Async dialog launcher
       
   297     CAsyncCallBack* iDlgLauncher;
       
   298 
       
   299 
       
   300     // to avoid twice calling LaunchCorrectDialog()
       
   301     TBool iIsOpenedTargettDlg;
       
   302     };
       
   303 
       
   304 #endif      // CWVSETTINGSUISERVERLISTDIALOG_H
       
   305 
       
   306 // End of File