ipsservices/ipssossettings/inc/ipssetuidialog.h
changeset 0 8466d47a6819
child 16 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 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:  File for dialog control.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IPSSETUIDIALOG_H
       
    21 #define IPSSETUIDIALOG_H
       
    22 
       
    23 
       
    24 #include <iapprefs.h>           // TImIAPChoice
       
    25 #include <msvapi.h>             // MMsvSessionObserver
       
    26 
       
    27 #include "ipssetuibasedialog.h" // CIpsSetUiBaseDialog
       
    28 
       
    29 class CIpsSetData;
       
    30 class CIpsSetUi;
       
    31 
       
    32 class CIpsSetUiDialogCtrl :
       
    33     public CIpsSetUiBaseDialog
       
    34     {
       
    35 public:
       
    36 
       
    37     /**
       
    38      * Class destructor.
       
    39      */
       
    40     ~CIpsSetUiDialogCtrl();
       
    41 
       
    42     /**
       
    43      * 2-phase constructor.
       
    44      */
       
    45     static CIpsSetUiDialogCtrl* NewL(
       
    46         CIpsSetUi& aDialog,
       
    47         CEikFormattedCellListBox& aListBox,
       
    48         CAknTitlePane& aTitlePane,
       
    49         CEikButtonGroupContainer& aButtons,
       
    50         CMsvSession& aSession,
       
    51         TUint64& aFlags );
       
    52 
       
    53     /**
       
    54      * 2-phase constructor with stack push.
       
    55      */
       
    56     static CIpsSetUiDialogCtrl* NewLC(
       
    57         CIpsSetUi& aDialog,
       
    58         CEikFormattedCellListBox& aListBox,
       
    59         CAknTitlePane& aTitlePane,
       
    60         CEikButtonGroupContainer& aButtons,
       
    61         CMsvSession& aSession,
       
    62         TUint64& aFlags );
       
    63 
       
    64 // New functions
       
    65 
       
    66     /**
       
    67      * Retrieves the current help context.
       
    68      *
       
    69      * @param aContext Current help context.
       
    70      */
       
    71     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
    72     
       
    73     void DynInitMenuPaneL(   /*TInt aResourceId,*/
       
    74             CEikMenuPane* aMenuPane );    
       
    75 
       
    76     /**
       
    77      * Saves the settings.
       
    78      */
       
    79     void StoreSettingsToAccountL();
       
    80 
       
    81 // From base class CIpsSetUiBaseDialog
       
    82 
       
    83     /**
       
    84      * Catches key events.
       
    85      *
       
    86      * @param aKeyEvent Invoked event.
       
    87      * @param aType Type of event.
       
    88      * @return State of the key event after procesessing.
       
    89      */
       
    90     TKeyResponse OfferKeyEventL(
       
    91         const TKeyEvent& aKeyEvent,
       
    92         TEventCode aType );
       
    93 
       
    94     /**
       
    95      * Processes the dialog commands.
       
    96      *
       
    97      * @param aCommandId Invoked command.
       
    98      */
       
    99     virtual void ProcessCommandL( TInt aCommandId );
       
   100 
       
   101     /**
       
   102      * Check whether the dialog can be exited.
       
   103      *
       
   104      * @param aButtonId Pressed button.
       
   105      */
       
   106     virtual TBool OkToExitL(
       
   107         const TInt aButtonId );
       
   108 
       
   109 protected:
       
   110 
       
   111     /**
       
   112      * Constructor.
       
   113      *
       
   114      * @param aDialog Actual dialog.
       
   115      * @param aListBox Listbox the dialog is showing.
       
   116      * @param aTitlePane Guess...
       
   117      * @param aFlags Flags to control dialog behavior and exit.
       
   118      */
       
   119     CIpsSetUiDialogCtrl(
       
   120         CIpsSetUi& aDialog,
       
   121         CEikFormattedCellListBox& aListBox,
       
   122         CAknTitlePane& aTitlePane,
       
   123         CMsvSession& aSession,
       
   124         TUint64& aFlags );
       
   125 
       
   126 private:
       
   127 
       
   128     /**
       
   129      * 2nd phase of construction.
       
   130      *
       
   131      * @param aButtons Button container of the dialog
       
   132      * @leave For any odd reason.
       
   133      */
       
   134     void ConstructL( CEikButtonGroupContainer& aButtons );
       
   135 
       
   136 // New functions
       
   137 
       
   138     /**
       
   139      * Gets IapChoice from the item.
       
   140      *
       
   141      * @param aItemId Preferably access point item id.
       
   142      * @return Access point choice item.
       
   143      */
       
   144     TImIAPChoice GetIapPref( const TInt aItemId );
       
   145 
       
   146     /**
       
   147      * Handles any event from the system.
       
   148      *
       
   149      * @param aCommandId Commands to be handled.
       
   150      */
       
   151     virtual TBool EventHandlerL( const TInt aCommandId );
       
   152 
       
   153     /**
       
   154      * Handles softkey pressed event.
       
   155      *
       
   156      * @param aButton Button that is pressed.
       
   157      * @return ETrue, when handled.
       
   158      */
       
   159     TBool KeyPressSoftkeyL( const TInt aButton );
       
   160 
       
   161     /**
       
   162      * Handles OK key press.
       
   163      *
       
   164      * @param aButton Button that is pressed.
       
   165      */
       
   166     TBool KeyPressOKButtonL( const TInt aButton );
       
   167 
       
   168     /**
       
   169      * @param aItem Port item for initialization.
       
   170      */
       
   171     void InitPort( CIpsSetUiItem& aItem );
       
   172 
       
   173     /**
       
   174      * Get the port item
       
   175      *
       
   176      * @param aIncoming Defines item for fetching.
       
   177      * @param aEditor Defines if the editor should be found.
       
   178      * @return Requested item.
       
   179      */
       
   180     CIpsSetUiItem& PortItem(
       
   181         const TBool aIncoming,
       
   182         const TBool aEditor );
       
   183 
       
   184     /**
       
   185 
       
   186 
       
   187     /**
       
   188      * Open folder subscription dialog.
       
   189      */
       
   190     TIpsSetUiEventResult HandleEventSubscribeFoldersL();
       
   191 
       
   192     /**
       
   193      * @param aBaseItem Port item for handling after editor close.
       
   194      */
       
   195     void HandleEventPort( CIpsSetUiItem& aBaseItem );
       
   196 
       
   197     /**
       
   198      * Handle the change of Outgoing User Authentication value
       
   199      *
       
   200      * @param aBaseItem Authentication item
       
   201      * @param aForceClear Clears the username and password fields.
       
   202      */
       
   203     void HandleEventAuthentication(
       
   204         CIpsSetUiItem& aBaseItem,
       
   205         const TBool aForceClear );
       
   206 
       
   207     /**
       
   208      * Hides/Unhides roaming depending on the status
       
   209      *
       
   210      * @param aBaseItem Scheduling item
       
   211      */
       
   212     void HandleEventSchedule( CIpsSetUiItem& aBaseItem );
       
   213 
       
   214     /**
       
   215      * Change the setting label for day item.
       
   216      *
       
   217      * @param aParam Day item
       
   218      */
       
   219     void HandleEventDaysL( CIpsSetUiItem& aBaseItem );
       
   220 
       
   221     /**
       
   222      * Updates the settings text for download size item.
       
   223      *
       
   224      * @param aBaseItem Download size page
       
   225      */
       
   226     void HandleDownloadSizeL( CIpsSetUiItem& aBaseItem );
       
   227 
       
   228     /**
       
   229      * Updates the settings text for email retrieval settings.
       
   230      *
       
   231      * @param aBaseItem Download size page
       
   232      */
       
   233     void HandleEmailsToRetrieve( CIpsSetUiItem& aBaseItem );
       
   234 
       
   235     /**
       
   236      * Changes resource for port editor
       
   237      */
       
   238     TIpsSetUiEventResult HandlePort();
       
   239 
       
   240     /**
       
   241      * Launch IAP page.
       
   242      *
       
   243      * @since FS v1.0
       
   244      * @param aBaseItem Access point item.
       
   245      */
       
   246     TIpsSetUiEventResult HandleAccessPointOpeningL( CIpsSetUiItem& aBaseItem );
       
   247 
       
   248     /**
       
   249      * @return Access point settings from the item.
       
   250      */
       
   251     TImIAPChoice GetIapChoiceL( const TUid& aId ) const;
       
   252 
       
   253     /**
       
   254      * Initialize signature item
       
   255      *
       
   256      * @param aBaseItem Signature item for init
       
   257      */
       
   258     void InitSignatureL(
       
   259         CIpsSetUiItem& aBaseItem );
       
   260 
       
   261     /**
       
   262      * Initializes download size items
       
   263      *
       
   264      * @param aBaseItem Download size item
       
   265      * @param aValue Value for initialization
       
   266      */
       
   267     void InitDownloadSizeL(
       
   268         CIpsSetUiItem& aBaseItem,
       
   269         const TInt aValue );
       
   270 
       
   271     /**
       
   272      * @param aBaseItem Access point item for initialization
       
   273      */
       
   274     void InitIapL( CIpsSetUiItem& aBaseItem );
       
   275 
       
   276     /**
       
   277      * Initializes retrieve limit editors
       
   278      *
       
   279      * @param aBaseItem Editor for initialization.
       
   280      * @param aValue Stored value.
       
   281      */
       
   282     void InitRetrieve(
       
   283         CIpsSetUiItem& aBaseItem,
       
   284         const TInt aValue );
       
   285 
       
   286     /**
       
   287      * Initializes hours dialog
       
   288      *
       
   289      * @param aBaseItem Hours item
       
   290      * @param aStartTime Starting hour
       
   291      * @param aStopTime Stop hour
       
   292      */
       
   293     void InitHoursL(
       
   294         CIpsSetUiItem& aBaseItem,
       
   295         const TInt64 aStartTime,
       
   296         const TInt64 aStopTime );
       
   297 
       
   298     /**
       
   299      * Initializes roaming item
       
   300      *
       
   301      * @param aBaseItem Roaming item for initialization
       
   302      * @param aValue for initialization
       
   303      */
       
   304     void InitRoaming(
       
   305         CIpsSetUiItem& aBaseItem,
       
   306         const TInt aValue );
       
   307 
       
   308     //<cmail>
       
   309     void InitSecuritySetting(
       
   310         CIpsSetUiItem& aBaseItem,
       
   311         const TInt aValue );
       
   312     
       
   313     //</cmail>  
       
   314 
       
   315     /**
       
   316      * Stores the retrieval limit status.
       
   317      */
       
   318     void StoreRetrievalLimit();
       
   319 
       
   320     /**
       
   321      * Formats time string for setting item.
       
   322      *
       
   323      * @param aText Return string
       
   324      * @param aStartTime Starting hour
       
   325      * @param aStopTime Stopping hour
       
   326      */
       
   327     void FormatTimeStringL(
       
   328         TDes& aText,
       
   329         const TInt64 aStartTime,
       
   330         const TInt64 aStopTime ) const;
       
   331 
       
   332 // From base class CIpsSetUiBaseArray
       
   333 
       
   334     /**
       
   335      * @param aBaseItem Item for initialization.
       
   336      */
       
   337     void InitUserData( CIpsSetUiItem& aBaseItem );
       
   338 
       
   339     
       
   340     /**
       
   341      * @param aBaseItem Item for initialization.
       
   342      */
       
   343     void InitUserDataL( CIpsSetUiItem& aBaseItem );
       
   344     
       
   345     /**
       
   346      * Initializes user name. Should be used for Outgoing setting.
       
   347      *
       
   348      * @param aBaseItem Container for username
       
   349      * @param aLogin Text to be stored
       
   350      */
       
   351     void InitLogin(
       
   352         CIpsSetUiItem& aBaseItem,
       
   353         const TDesC& aLogin );
       
   354 
       
   355     /**
       
   356      * Creates array of custom items.
       
   357      *
       
   358      * @param aId Item which stores the array
       
   359      * @return Item which contains the array and ownership to it.
       
   360      */
       
   361     CIpsSetUiItem* CreateCustomItemToArrayLC( const TUid& aId );
       
   362 
       
   363     /**
       
   364      * Make hide check including protocol checks.
       
   365      *
       
   366      * @param aItem Item to be checked
       
   367      * @return KErrNotSupported when the item should not be visible
       
   368      */
       
   369     TInt IsHidden(
       
   370         const CIpsSetUiItem& aItem ) const;
       
   371 
       
   372 // From base class CIpsSetUiBaseDialog
       
   373 
       
   374     /**
       
   375      * Setting page event handling.
       
   376      *
       
   377      * @param aSettingPage Setting page that invokes the event.
       
   378      * @param aEventType Invoked event.
       
   379      */
       
   380     virtual void HandleSettingPageEventL(
       
   381         CAknSettingPage* aSettingPage,
       
   382         TAknSettingPageEvent aEventType );
       
   383 
       
   384     /**
       
   385      * Array change event handling.
       
   386      *
       
   387      * @param aBaseItem Item that invoked the event.
       
   388      * @return Result of the event handling.
       
   389      */
       
   390     virtual TInt EventSubArrayChangeL(
       
   391         CIpsSetUiItem& aBaseItem );
       
   392 
       
   393     /**
       
   394      * Handles the events, after the settings editor has been closed
       
   395      *
       
   396      * @param aBaseItem Item that has been edited.
       
   397      * @return Result of the handling
       
   398      */
       
   399     TInt EventItemEditEndsL( CIpsSetUiItem& aBaseItem );
       
   400 
       
   401     /**
       
   402      * Handles the events, before the settings editor is opened
       
   403      *
       
   404      * @param aBaseItem Item that is going to be edited.
       
   405      * @return Result of the handling
       
   406      */
       
   407     TIpsSetUiEventResult EventItemEditStartsL( CIpsSetUiItem& aBaseItem );
       
   408 
       
   409     /**
       
   410      * Launches the multiline editor
       
   411      *
       
   412      * @param aBaseItem Multiline editor item
       
   413      * @param aUpdateMode Editors mode
       
   414      * @return Result of edit
       
   415      */
       
   416     TIpsSetUiEventResult SettingLaunchMultilineEditorL(
       
   417         CIpsSetUiItem& aBaseItem,
       
   418         TIpsSetUiUpdateMode& aUpdateMode );
       
   419 
       
   420 // Data
       
   421 
       
   422     /**
       
   423      * Dialog which created the controller.
       
   424      */
       
   425     CIpsSetUi&      iDialog;
       
   426 
       
   427 
       
   428     /**
       
   429      * Message server session.
       
   430      */
       
   431     CMsvSession&    iSession;
       
   432 
       
   433     /**
       
   434      * Flags to control dialog behavior.
       
   435      */
       
   436     TUint64&        iFlags;
       
   437 
       
   438     /**
       
   439      * Data object store.
       
   440      * Owned.
       
   441      */
       
   442     CIpsSetData*    iData;
       
   443 
       
   444     /**
       
   445      * Temporary storage for signature.
       
   446      */
       
   447     RBuf            iSignature;
       
   448 
       
   449     };
       
   450 
       
   451 #endif      // IPSSETUIDIALOG_H
       
   452 
       
   453 // End of File