ipsservices/ipssossettings/inc/ipssetuibasedialog.h
branchRCL_3
changeset 64 3533d4323edc
parent 0 8466d47a6819
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     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:  Decleares base dialog controlling functionality.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IPSSETUIBASEDIALOG_H
       
    21 #define IPSSETUIBASEDIALOG_H
       
    22 
       
    23 
       
    24 #include <eiklbo.h>                 // MEikListBoxObserver
       
    25 #include <coedef.h>                 // TKeyResponse
       
    26 #include <w32std.h>                 // TKeyEvent
       
    27 #include <eikcmobs.h>               // MEikCommandObserver
       
    28 #include <aknsettingpage.h>         // MAknSettingPageObserver
       
    29 
       
    30 #include "ipssetuibasearray.h"
       
    31 #include "ipssetuictrlpageresource.h"
       
    32 
       
    33 typedef CArrayFixFlat<TInt> CIpsSetUiIntArray;
       
    34 typedef CArrayPtrFlat<CAknSettingPage> CIpsSetUiPages;
       
    35 typedef CAknSettingPage::TAknSettingPageUpdateMode TIpsSetUiUpdateMode;
       
    36 
       
    37 class CEikFormattedCellListBox;
       
    38 class CEikScrollBarFrame;
       
    39 class CAknSettingPage;
       
    40 class CAknTitlePane;
       
    41 class CAknQueryDialog;
       
    42 class CEikButtonGroupContainer;
       
    43 class CSelectionItemList;
       
    44 class CIpsSetUiApprover;
       
    45 class CIpsSetUiItem;
       
    46 class CIpsSetUiCtrlSoftkey;
       
    47 
       
    48 /**
       
    49  * Base dialog control functionality.
       
    50  *
       
    51  * @since FS v1.0
       
    52  * @lib IpsSosSettings.lib
       
    53  */
       
    54 class CIpsSetUiBaseDialog :
       
    55     public CIpsSetUiBaseArray,
       
    56     public MEikListBoxObserver,
       
    57     public MEikCommandObserver,
       
    58     public MAknSettingPageObserver
       
    59     {
       
    60 public: // Constructors and destructor
       
    61 
       
    62     /**
       
    63      * Destructor.
       
    64      */
       
    65     virtual ~CIpsSetUiBaseDialog();
       
    66 
       
    67 public: // New virtual functions
       
    68 
       
    69     /**
       
    70      * Setting has started.
       
    71      *
       
    72      * @return ETrue, when continue is ok.
       
    73      */
       
    74     virtual TBool SettingsStartedL();
       
    75 
       
    76 public: // New functions
       
    77 
       
    78     /**
       
    79      * @return Currently active item.
       
    80      */
       
    81     TInt CurrentItemIndex() const;
       
    82 
       
    83     /**
       
    84      * @return Currently focused item.
       
    85      */
       
    86     CIpsSetUiItem* CurrentItem() const;
       
    87 
       
    88     //<cmail>
       
    89     /**
       
    90      * Count of list box items
       
    91      * 
       
    92      * @return count of list box items
       
    93      */
       
    94     TInt CountInListBox() const;
       
    95     //</cmail>
       
    96 
       
    97 protected:  // Constructors
       
    98 
       
    99     /**
       
   100      * Constructor.
       
   101      *
       
   102      * @param aListBox Listbox owned by the dialog.
       
   103      * @param aTitlePane Just take a wild guess.
       
   104      */
       
   105     CIpsSetUiBaseDialog(
       
   106         CEikFormattedCellListBox& aListBox,
       
   107         CAknTitlePane& aTitlePane );
       
   108 
       
   109     /**
       
   110      * 2nd phase of constuction
       
   111      *
       
   112      * @param aButtons Buttons owned by the dialog.
       
   113      * @param aResource Settings resource.
       
   114      * @param aUpdateMSK Middle softkey support.
       
   115      */
       
   116     void ConstructL(
       
   117         CEikButtonGroupContainer& aButtons,
       
   118         const TInt aResource = NULL,
       
   119         const TBool aUpdateMSK = EFalse );
       
   120 
       
   121 protected:  // New virtual functions
       
   122 
       
   123 // From MAknSettingPageObserver
       
   124 
       
   125     /**
       
   126      * Handle event invoked by the setting page.
       
   127      *
       
   128      * @param aSettingPage SettingPage that invoked the event.
       
   129      * @param aEventType Type of invoked event.
       
   130      */
       
   131     virtual void HandleSettingPageEventL(
       
   132         CAknSettingPage* aSettingPage,
       
   133         TAknSettingPageEvent aEventType ) = 0;
       
   134 
       
   135     /**
       
   136      * Check if the exiting is ok.
       
   137      *
       
   138      * @param aButtonId Button that is pressed.
       
   139      * @return ETrue, when exit is ok.
       
   140      */
       
   141     virtual TBool OkToExitL(
       
   142         const TInt aButtonId ) = 0;
       
   143 
       
   144     /**
       
   145      * Initializes undefined item.
       
   146      *
       
   147      * @param aBaseItem Item to be initialized.
       
   148      * @param aValue Value to be used in initialization.
       
   149      * @param aText Text to be used in initialization.
       
   150      * @return KErrNone, when init is success.
       
   151      */
       
   152     virtual TInt InitItemUnidentified(
       
   153         CIpsSetUiItem& aBaseItem,
       
   154         const TInt aValue,
       
   155         const TDesC& aText );
       
   156 
       
   157     /**
       
   158      * Launch multiline editor.
       
   159      *
       
   160      * @param aBaseItem Preferably multiline editor item.
       
   161      * @param aUpdateMode Mode to be used to launch the editor.
       
   162      * @return Result of the edit.
       
   163      */
       
   164     virtual TIpsSetUiEventResult SettingLaunchMultilineEditorL(
       
   165         CIpsSetUiItem& aBaseItem,
       
   166         TIpsSetUiUpdateMode& aUpdateMode );
       
   167 
       
   168     /**
       
   169      * Key event catcher.
       
   170      *
       
   171      * @param aKeyEvent Invoked key event.
       
   172      * @param aType Type of the event.
       
   173      * @return Consumed/Not consumed.
       
   174      */
       
   175     virtual TKeyResponse OfferKeyEventL(
       
   176         const TKeyEvent& aKeyEvent,
       
   177         TEventCode aType );
       
   178 
       
   179     /**
       
   180      * Get unique setting page.
       
   181      *
       
   182      * @param aReturnPage Page to be created.
       
   183      * @param aReturnUpdateMode Update mode of the page.
       
   184      * @param aReturnSettingValue User input value.
       
   185      * @param aReturnSettingText User input text.
       
   186      * @param aRetrunRadioButtonArray Custom array of buttons.
       
   187      * @param aParamBaseItem Item invoked the event.
       
   188      */
       
   189     virtual void AcquireCustomSettingPageL(
       
   190         CAknSettingPage*& aReturnPage,
       
   191         TIpsSetUiUpdateMode& aReturnUpdateMode,
       
   192         TInt& aReturnSettingValue,
       
   193         TDes& aReturnSettingText,
       
   194         CDesCArrayFlat& aReturnRadioButtonArray,
       
   195         CIpsSetUiItem& aParamBaseItem );
       
   196 
       
   197     /**
       
   198      *
       
   199      *
       
   200      * @param aBaseItem Item invoked the event.
       
   201      */
       
   202     virtual TInt EventSubArrayChangeL(
       
   203         CIpsSetUiItem& aBaseItem );
       
   204 
       
   205     /**
       
   206      *
       
   207      *
       
   208      * @param aBaseItem Item invoked the event.
       
   209      */
       
   210     virtual TIpsSetUiEventResult EventItemEditStartsL(
       
   211         CIpsSetUiItem& aBaseItem );
       
   212 
       
   213     /**
       
   214      *
       
   215      *
       
   216      * @param aBaseItem Item invoked the event.
       
   217      */
       
   218     virtual TInt EventItemEditEndsL(
       
   219         CIpsSetUiItem& aBaseItem );
       
   220 
       
   221     /**
       
   222      *
       
   223      *
       
   224      * @param aBaseItem Item invoked the event.
       
   225      */
       
   226     virtual TIpsSetUiEventResult EventItemEvaluateValue(
       
   227         const CIpsSetUiItem& aBaseItem,
       
   228         TInt& aNewValue );
       
   229 
       
   230     /**
       
   231      * Checks user input.
       
   232      *
       
   233      * @param aBaseItem Item invoked the event.
       
   234      * @param aNewValue User input value.
       
   235      */
       
   236     virtual TIpsSetUiEventResult EventItemEvaluateRadioButton(
       
   237         const CIpsSetUiItem& aBaseItem,
       
   238         TInt& aNewValue );
       
   239 
       
   240     /**
       
   241      * Checks user input.
       
   242      *
       
   243      * @param aBaseItem Item invoked the event.
       
   244      * @param aNewText User input text.
       
   245      */
       
   246     virtual TIpsSetUiEventResult EventItemEvaluateText(
       
   247         const CIpsSetUiItem& aBaseItem,
       
   248         TDes& aNewText );
       
   249 
       
   250 protected:  // New functions
       
   251 
       
   252     // Setting page opening
       
   253 
       
   254 
       
   255     /**
       
   256      *
       
   257      *
       
   258      * @param .
       
   259      * @return .
       
   260      */
       
   261     TIpsSetUiPageResult OpenSettingPageL(
       
   262         const TInt aIndex = KErrNotFound );
       
   263 
       
   264     /**
       
   265      *
       
   266      *
       
   267      * @param .
       
   268      * @return .
       
   269      */
       
   270     TIpsSetUiPageResult OpenSettingPageL(
       
   271         CIpsSetUiItem& aBaseItem );
       
   272 
       
   273     /**
       
   274      *
       
   275      *
       
   276      * @param .
       
   277      * @param .
       
   278      */
       
   279     void SetMainMBoxMenuTitlePaneTextL(
       
   280         const TDesC& aText,
       
   281         const TBool aSaveCurrent = ETrue );
       
   282 
       
   283     /**
       
   284      *
       
   285      *
       
   286      * @param .
       
   287      */
       
   288     void SetSettingsMenuTitlePaneText(
       
   289         const TBool aSaveCurrent = ETrue );
       
   290     
       
   291 
       
   292     /**
       
   293      *
       
   294      *
       
   295      * @param .
       
   296      * @param .
       
   297      * @param .
       
   298      * @return .
       
   299      */
       
   300     CIpsSetUiItem* SettingFindEditor(
       
   301         const CIpsSetUiItem& aBaseItem,
       
   302         const TInt aIndex,
       
   303         const TBool aExcludeHidden = ETrue );
       
   304 
       
   305     /**
       
   306      *
       
   307      *
       
   308      * @param .
       
   309      * @param .
       
   310      * @param .
       
   311      * @return .
       
   312      */
       
   313     CIpsSetUiItem* SettingFindEditor(
       
   314         const CIpsSetUiItem& aBaseItem,
       
   315         const TUid& aId,
       
   316         const TBool aExcludeHidden = ETrue );
       
   317 
       
   318     /**
       
   319      *
       
   320      *
       
   321      * @param .
       
   322      * @param .
       
   323      * @param .
       
   324      * @return .
       
   325      */
       
   326     TInt InitAnyItem(
       
   327         CIpsSetUiItem& aBaseItem,
       
   328         const TInt aValue,
       
   329         const TDesC& aText );
       
   330 
       
   331     /**
       
   332      *
       
   333      *
       
   334      * @param .
       
   335      * @return .
       
   336      */
       
   337     TInt ShowCustomQueryL(
       
   338         const TInt aResourceStringId );
       
   339 
       
   340     /**
       
   341      *
       
   342      *
       
   343      * @param .
       
   344      * @return .
       
   345      */
       
   346     TInt GetTextEditorFlags( const CIpsSetUiItem& aBaseItem );
       
   347 
       
   348     /**
       
   349      *
       
   350      *
       
   351      * @param .
       
   352      * @return .
       
   353      */
       
   354     TInt GetValueEditorFlags( const CIpsSetUiItem& aBaseItem );
       
   355 
       
   356 
       
   357     /**
       
   358      *
       
   359      *
       
   360      * @param .
       
   361      */
       
   362     void SetListboxEmptyTextL( const TDesC& aText );
       
   363 
       
   364     /**
       
   365      * Gets the setting page resource of specific item
       
   366      *
       
   367      * @param .
       
   368      * @return resource id of the page
       
   369      */
       
   370     TInt SettingPageResource(
       
   371         const TIpsSetUiPageResource aSettingPage ) const;
       
   372 
       
   373     /**
       
   374      * Sets the new setting page resource for specific item
       
   375      *
       
   376      * @param aSettingPage Inserts the resource for the page
       
   377      * @param .
       
   378      */
       
   379     void SetSettingPageResource(
       
   380         const TIpsSetUiPageResource aSettingPage,
       
   381         const TInt aResourceId );
       
   382 
       
   383     /**
       
   384      *
       
   385      *
       
   386      * @param .
       
   387      * @param .
       
   388      */
       
   389     void CheckRadioButton(
       
   390         CIpsSetUiItemLink& aRadioButtonArray,
       
   391         const TInt aRadioButtonIndex );
       
   392 
       
   393     /**
       
   394      *
       
   395      *
       
   396      * @param .
       
   397      * @param .
       
   398      */
       
   399     void CheckRadioButton(
       
   400         CIpsSetUiItemLink& aRadioButtonArray,
       
   401         const TUid& aId );
       
   402 
       
   403     /**
       
   404      *
       
   405      *
       
   406      * @param .
       
   407      * @param .
       
   408      * @param .
       
   409      * @return .
       
   410      */
       
   411      TInt FindCheckedRadiobutton(
       
   412         const CIpsSetUiItemLinkExt& aArray,
       
   413         TUid& aId,
       
   414         TInt& aIndex );
       
   415 
       
   416     /**
       
   417      *
       
   418      *
       
   419      * @param .
       
   420      */
       
   421     void AddBackupItemL(
       
   422         const CIpsSetUiItem& aBaseItem );
       
   423 
       
   424     /**
       
   425      *
       
   426      *
       
   427      */
       
   428     void RemoveLastBackupItem();
       
   429 
       
   430     /**
       
   431      *
       
   432      *
       
   433      * @return .
       
   434      */
       
   435     CIpsSetUiItem* GetLastBackupItem();
       
   436 
       
   437     /**
       
   438      *
       
   439      *
       
   440      */
       
   441     void RestoreFromBackup();
       
   442 
       
   443     /**
       
   444      *
       
   445      *
       
   446      */
       
   447     void CleanBackupArray();
       
   448 
       
   449 protected:  // Functions from base classes
       
   450 
       
   451     // MEikCommandObserver
       
   452 
       
   453     /**
       
   454      *
       
   455      *
       
   456      * @param .
       
   457      */
       
   458     virtual void ProcessCommandL( TInt aCommandId ) = 0;
       
   459 
       
   460 private:  // New functions
       
   461 
       
   462     // Setting page opening
       
   463 
       
   464     /**
       
   465      *
       
   466      *
       
   467      * @return .
       
   468      */
       
   469     TIpsSetUiPageResult SettingsPageOpenCheckL();
       
   470 
       
   471     /**
       
   472      *
       
   473      *
       
   474      * @return .
       
   475      */
       
   476     TIpsSetUiPageResult SettingPageOpenEditorL();
       
   477 
       
   478     /**
       
   479      *
       
   480      *
       
   481      */
       
   482     void SettingPageOpenFinishL();
       
   483 
       
   484     /**
       
   485      *
       
   486      *
       
   487      * @param .
       
   488      * @return .
       
   489      */
       
   490     TIpsSetUiPageResult SettingPageOpenL(
       
   491         CIpsSetUiItem& aBaseItem );
       
   492 
       
   493     /**
       
   494      * Launches setting page.
       
   495      *
       
   496      * @param aBaseItem Item to be edited by the UI.
       
   497      * @param aUpdateMode Mode of the editor.
       
   498      * @return Result of the edit operation.
       
   499      */
       
   500     TIpsSetUiPageResult SettingLaunchPageLD(
       
   501         CIpsSetUiItem& aBaseItem,
       
   502         TIpsSetUiUpdateMode& aUpdateMode );
       
   503 
       
   504     /**
       
   505      * Launches setting page.
       
   506      *
       
   507      * @param aBaseItem Item to be edited by the UI.
       
   508      * @param aUpdateMode Mode of the editor.
       
   509      * @return Result of the edit operation.
       
   510      */
       
   511     TIpsSetUiPageResult SettingLaunchRadioButtonPageLD(
       
   512         CIpsSetUiItem& aBaseItem,
       
   513         TIpsSetUiUpdateMode& aUpdateMode );
       
   514 
       
   515     /**
       
   516      * Launches setting page.
       
   517      *
       
   518      * @param aBaseItem Item to be edited by the UI.
       
   519      * @param aUpdateMode Mode of the editor.
       
   520      * @return Result of the edit operation.
       
   521      */
       
   522     TIpsSetUiPageResult SettingLaunchCheckboxPageLD(
       
   523         CIpsSetUiItem& aBaseItem,
       
   524         TIpsSetUiUpdateMode& aUpdateMode );
       
   525 
       
   526     /**
       
   527      * Launches setting page.
       
   528      *
       
   529      * @param aBaseItem Item to be edited by the UI.
       
   530      * @param aUpdateMode Mode of the editor.
       
   531      * @return Result of the edit operation.
       
   532      */
       
   533     TIpsSetUiPageResult SettingLaunchTextEditorPageLD(
       
   534         CIpsSetUiItem& aBaseItem,
       
   535         TIpsSetUiUpdateMode& aUpdateMode );
       
   536 
       
   537     /**
       
   538      * Launches setting page.
       
   539      *
       
   540      * @param aBaseItem Item to be edited by the UI.
       
   541      * @param aUpdateMode Mode of the editor.
       
   542      * @return Result of the edit operation.
       
   543      */
       
   544     TIpsSetUiPageResult SettingLaunchNumberEditorPageLD(
       
   545         CIpsSetUiItem& aBaseItem,
       
   546         TIpsSetUiUpdateMode& aUpdateMode );
       
   547 
       
   548     /**
       
   549      * Launches setting page.
       
   550      *
       
   551      * @param aBaseItem Item to be edited by the UI.
       
   552      * @param aUpdateMode Mode of the editor.
       
   553      * @return Result of the edit operation.
       
   554      */
       
   555     TIpsSetUiPageResult SettingLaunchScNumberEditorPageLD(
       
   556         CIpsSetUiItem& aBaseItem,
       
   557         TIpsSetUiUpdateMode& aUpdateMode );
       
   558 
       
   559     /**
       
   560      * Launches setting page.
       
   561      *
       
   562      * @param aBaseItem Item to be edited by the UI.
       
   563      * @param aUpdateMode Mode of the editor.
       
   564      * @return Result of the edit operation.
       
   565      */
       
   566     TIpsSetUiPageResult SettingLaunchMultilinePageL(
       
   567         CIpsSetUiItem& aBaseItem,
       
   568         TIpsSetUiUpdateMode& aUpdateMode );
       
   569 
       
   570     /**
       
   571      * Check if new editor must be opened.
       
   572      *
       
   573      * @param .
       
   574      */
       
   575     void SettingsCheckNextEditorOpenL(
       
   576         TIpsSetUiPageResult& aResult );
       
   577 
       
   578     // Setting page creation
       
   579 
       
   580     /**
       
   581      * Create specific setting editor.
       
   582      *
       
   583      * @param aBaseItem Item to be edited through the UI.
       
   584      * @param aUpdateMode Mode of the editor.
       
   585      */
       
   586     void SettingCreateEditorL(
       
   587         CIpsSetUiItem& aBaseItem,
       
   588         TIpsSetUiUpdateMode& aUpdateMode );
       
   589 
       
   590     /**
       
   591      * Create specific setting editor.
       
   592      *
       
   593      * @param aBaseItem Item to be edited through the UI.
       
   594      * @param aUpdateMode Mode of the editor.
       
   595      */
       
   596     void SettingCreateRadioButtonPageL(
       
   597         CIpsSetUiItem& aBaseItem,
       
   598         TIpsSetUiUpdateMode& aUpdateMode );
       
   599 
       
   600     /**
       
   601      * Create specific setting editor.
       
   602      *
       
   603      * @param aBaseItem Item to be edited through the UI.
       
   604      * @param aUpdateMode Mode of the editor.
       
   605      */
       
   606     void SettingCreateCheckboxPageL(
       
   607         CIpsSetUiItem& aBaseItem,
       
   608         TIpsSetUiUpdateMode& aUpdateMode );
       
   609 
       
   610     /**
       
   611      * Create specific setting editor.
       
   612      *
       
   613      * @param aBaseItem Item to be edited through the UI.
       
   614      * @param aUpdateMode Mode of the editor.
       
   615      */
       
   616     void SettingCreatePlainTextEditorPageL(
       
   617         CIpsSetUiItem& aBaseItem,
       
   618         TIpsSetUiUpdateMode& aUpdateMode );
       
   619 
       
   620     /**
       
   621      * Create specific setting editor.
       
   622      *
       
   623      * @param aBaseItem Item to be edited through the UI.
       
   624      * @param aUpdateMode Mode of the editor.
       
   625      */
       
   626     void SettingCreatePasswordTextEditorPageL(
       
   627         CIpsSetUiItem& aBaseItem,
       
   628         TIpsSetUiUpdateMode& aUpdateMode );
       
   629 
       
   630     /**
       
   631      * Create specific setting editor.
       
   632      *
       
   633      * @param aBaseItem Item to be edited through the UI.
       
   634      * @param aUpdateMode Mode of the editor.
       
   635      */
       
   636     void SettingCreatePlainNumberEditorPageL(
       
   637         CIpsSetUiItem& aBaseItem,
       
   638         TIpsSetUiUpdateMode& aUpdateMode );
       
   639 
       
   640     /**
       
   641      * Create specific setting editor.
       
   642      *
       
   643      * @param aBaseItem Item to be edited through the UI.
       
   644      * @param aUpdateMode Mode of the editor.
       
   645      */
       
   646     void SettingCreateScNumberEditorPageL(
       
   647         CIpsSetUiItem& aBaseItem,
       
   648         TIpsSetUiUpdateMode& aUpdateMode );
       
   649 
       
   650 
       
   651     /**
       
   652      * Gets default setting page values.
       
   653      *
       
   654      * @param aBase Item being edited.
       
   655      * @return Correct update mode.
       
   656      */
       
   657     TIpsSetUiUpdateMode DefineDefaultSettingPageL(
       
   658         const CIpsSetUiItem& aBase );
       
   659 
       
   660     /**
       
   661      * @param aButtonArray Radiobutton array to be filled.
       
   662      */
       
   663     void SettingCreateButtonArrayL(
       
   664         CIpsSetUiBaseItemArray& aButtonArray );
       
   665 
       
   666     /**
       
   667      * @param aButtonArray Checkbox array to be filled..
       
   668      */
       
   669     void SettingCreateCheckboxArrayL(
       
   670         CIpsSetUiBaseItemArray& aButtonArray );
       
   671 
       
   672     /**
       
   673      * Prepares setting page creation.
       
   674      *
       
   675      * @param aUpdateMode Updatemode for editor.
       
   676      * @param Item being edited.
       
   677      */
       
   678     void SettingPrepareAcquireL(
       
   679         TIpsSetUiUpdateMode& aUpdateMode,
       
   680         CIpsSetUiItem& aBaseItem );
       
   681 
       
   682     /**
       
   683      * @param aBaseItem Item being prepared.
       
   684      */
       
   685     void SettingPrepareAcquireRadioButtonPageL(
       
   686         CIpsSetUiItem& aBaseItem );
       
   687 
       
   688     /**
       
   689      * @param aBaseItem Item being prepared.
       
   690      */
       
   691     void SettingPrepareAcquireCheckboxPageL(
       
   692         CIpsSetUiItem& aBaseItem );
       
   693 
       
   694     /**
       
   695      * @param aBaseItem Item being prepared.
       
   696      */
       
   697     void SettingPrepareAcquireTextEditorPageL(
       
   698         CIpsSetUiItem& aBaseItem );
       
   699 
       
   700     /**
       
   701      * @param aBaseItem Item being prepared.
       
   702      */
       
   703     void SettingPrepareAcquireValueEditorPageL(
       
   704         CIpsSetUiItem& aBaseItem );
       
   705 
       
   706 
       
   707     /**
       
   708      * Initializes link array item.
       
   709      *
       
   710      * @param aBaseItem Item to be initialized.
       
   711      * @param aText Text data to be set to item.
       
   712      * @return KErrNone on success.
       
   713      */
       
   714     TInt InitArrayLink(
       
   715         CIpsSetUiItem& aBaseItem,
       
   716         const TDesC& aText );
       
   717 
       
   718     /**
       
   719      * Initializes radio button array.
       
   720      *
       
   721      * @param aBaseItem Item to be initialized.
       
   722      * @param aValue Numeric data to be set to item.
       
   723      * @param aText Text data to be set to item.
       
   724      * @return KErrNone on success.
       
   725      */
       
   726     TInt InitArrayRadioButton(
       
   727         CIpsSetUiItem& aBaseItem,
       
   728         const TInt aValue,
       
   729         const TDesC& aText );
       
   730 
       
   731     /**
       
   732      * Initializes checkbox array.
       
   733      *
       
   734      * @param aBaseItem Item to be initialized.
       
   735      * @param aValue Numeric data to be set to item.
       
   736      * @param aText Text data to be set to item.
       
   737      * @return KErrNone on success.
       
   738      */
       
   739     TInt InitArrayCheckBox(
       
   740         CIpsSetUiItem& aBaseItem,
       
   741         const TInt aValue,
       
   742         const TDesC& aText );
       
   743 
       
   744     /**
       
   745      * Initializes text item.
       
   746      *
       
   747      * @param aBaseItem Item to be initialized.
       
   748      * @param aText Text data to be set to item.
       
   749      * @return KErrNone on success.
       
   750      */
       
   751     TInt InitItemTextEdit(
       
   752         CIpsSetUiItem& aBaseItem,
       
   753         const TDesC& aText );
       
   754 
       
   755     /**
       
   756      * Initializes value item.
       
   757      *
       
   758      * @param aBaseItem Item to be initialized.
       
   759      * @param aValue Numeric data to be set to item.
       
   760      * @param aText Text data to be set to item.
       
   761      * @return KErrNone on success.
       
   762      */
       
   763     TInt InitItemNumberEdit(
       
   764         CIpsSetUiItem& aBaseItem,
       
   765         const TInt aValue,
       
   766         const TDesC& aText );
       
   767         
       
   768     /**
       
   769      * Prepares subarray event
       
   770      *
       
   771      * @param aBaseItem Item invoked the event.
       
   772      * @param aForward Type of the event.
       
   773      * @return Result of the handling.
       
   774      */
       
   775     TInt EventPrepareSubArrayL(
       
   776         CIpsSetUiItem& aBaseItem,
       
   777         const TBool aForward = ETrue );
       
   778 
       
   779     /**
       
   780      * Gets the previous stored value and removes it
       
   781      *
       
   782      * @param aRemove Removes the returned index from the array.
       
   783      * @return Last index
       
   784      */
       
   785     TInt SettingsLastItemIndex( const TBool aRemove = ETrue ) const;
       
   786 
       
   787     /**
       
   788      * Adds current itemindex to stack
       
   789      *
       
   790      * @param aSettingsLastItemIndex, new index
       
   791      */
       
   792     void SetSettingsLastItemIndexL( const TInt aLastItemIndex );
       
   793 
       
   794     /**
       
   795      * Returns current settings page as item.
       
   796      *
       
   797      * @param Remove from array.
       
   798      * @return Current setting page.
       
   799      */
       
   800     CIpsSetUiItem* CurrentSettingsPage(
       
   801         const TBool aRemove = EFalse );
       
   802 
       
   803     /**
       
   804      * @param aBaseItem Page to be set as active.
       
   805      */
       
   806     void SetCurrentSettingsPageL(
       
   807         CIpsSetUiItem& aBaseItem );
       
   808 
       
   809     /**
       
   810      * @param aBaseItem Item to be backed up before editing.
       
   811      */
       
   812     void BackupItemCreateLinkL(
       
   813         const CIpsSetUiItem& aBaseItem );
       
   814 
       
   815     /**
       
   816      * @param aBaseItem Item to be backed up before editing.     
       
   817      */
       
   818     void BackupItemCreateRadioL(
       
   819         const CIpsSetUiItem& aBaseItem );
       
   820 
       
   821     /**
       
   822      * @param aBaseItem Item to be backed up before editing.
       
   823      */
       
   824     void BackupItemCreateValueL(
       
   825         const CIpsSetUiItem& aBaseItem );
       
   826 
       
   827     /**
       
   828      * @param aBaseItem Item to be backed up before editing.     
       
   829      */
       
   830     void BackupItemCreateTextL(
       
   831         const CIpsSetUiItem& aBaseItem );
       
   832 
       
   833     /**
       
   834      * @param aBaseItem Item to be backed up before editing.     
       
   835      */
       
   836     void BackupItemCreateUndefinedL(
       
   837         const CIpsSetUiItem& aBaseItem );
       
   838 
       
   839     /**
       
   840      * Create backup item.
       
   841      *
       
   842      * @param aBaseItem Item being edited.
       
   843      * @return Backup item with client ownership.
       
   844      */
       
   845     virtual CIpsSetUiItem* CreateItemForBackupL(
       
   846         const CIpsSetUiItem& aBaseItem );
       
   847 
       
   848     /**
       
   849      * @return Result of the canceling.
       
   850      */
       
   851     TIpsSetUiPageResult HandleEditorCancelL();
       
   852 
       
   853     /**
       
   854      * @return Result of editor accept.
       
   855      */
       
   856     TIpsSetUiPageResult HandleEditorOk();
       
   857 
       
   858     /**
       
   859      * @return Result of editor invalid input.
       
   860      */
       
   861     TIpsSetUiPageResult HandleEditorDisapproved();
       
   862 
       
   863     /**
       
   864      * @return Text resource for MSK.
       
   865      */
       
   866     TInt GetResourceForMiddlekey();
       
   867     
       
   868     void UpdateTitlePaneTextL( TInt aId );
       
   869 
       
   870 private:  // Functions from base classes
       
   871 
       
   872     /**
       
   873      * Array changed event handling.
       
   874      *
       
   875      * @param aEvent Type of the event.
       
   876      * @return KErrNone, when handled properly.
       
   877      */
       
   878     TInt EventArrayChangedL(
       
   879         const TIpsSetUiArrayEvent aEvent );
       
   880 
       
   881     /**
       
   882      * Custom text line for item.
       
   883      *
       
   884      * @param aId Unique id of the item.
       
   885      * @param aString Textual string for listbox.
       
   886      * @return ETrue, when item is handled.
       
   887      */
       
   888     TBool EventCustomMdcaPoint(
       
   889         const TUid& aId,
       
   890         TPtr& aString ) const;
       
   891 
       
   892 // MEikListBoxObserver
       
   893 
       
   894      /**
       
   895       * Listbox event handler.
       
   896       *
       
   897       * @param aListBox that invoked the event.
       
   898       * @param aEventType Type of the event.
       
   899       */
       
   900      virtual void HandleListBoxEventL(
       
   901         CEikListBox* aListBox,
       
   902         TListBoxEvent aEventType );
       
   903 
       
   904 protected:  // Data
       
   905 
       
   906     // DIALOG REFERENCES
       
   907 
       
   908     /**
       
   909      * The listbox that is shown in view for user
       
   910      */
       
   911     CEikFormattedCellListBox& iListBox;
       
   912 
       
   913     /**
       
   914      * Used titlepane in settings dialog
       
   915      */
       
   916     CAknTitlePane&      iTitlePane;
       
   917 
       
   918     /**
       
   919      * Buttons used to show in the dialog
       
   920      * Owned.
       
   921      */
       
   922     CIpsSetUiCtrlSoftkey* iSoftkeys;
       
   923 
       
   924     /**
       
   925      * Temporary storage for settings page
       
   926      * Owned.
       
   927      */
       
   928     CAknSettingPage*        iSettingPage;
       
   929     
       
   930     /*
       
   931      * Title pane text for main menu view, currently
       
   932      * title for main menu is mailbox name
       
   933      */
       
   934     HBufC* iMainMBoxMenuTitleText;
       
   935 
       
   936 private:    // Data
       
   937 
       
   938     /**
       
   939      * Flags to control dialog behavior.
       
   940      */
       
   941     enum TIpsSetUiSettingsFlags
       
   942         {
       
   943         EIpsSetUiStartIssued = 0,
       
   944         EIpsSetUiRunningCustomPage,
       
   945         };
       
   946 
       
   947     // RESOURCES
       
   948 
       
   949 
       
   950     /**
       
   951      * Status flags
       
   952      */
       
   953     TUint64          iBaseDialogFlags;
       
   954 
       
   955     /**
       
   956      * Container for resource page ids
       
   957      * Owned.
       
   958      */
       
   959     CIpsSetUiCtrlPageResource* iSettingPageResources;
       
   960 
       
   961     /**
       
   962      * Container array for items to be edited
       
   963      * Owned.
       
   964      */
       
   965     CIpsSetUiBaseItemArray* iSettingsPageArray;
       
   966 
       
   967     // DIALOG
       
   968 
       
   969     /**
       
   970      * Pointer to scrollbar used in settings page
       
   971      * Owned.
       
   972      */
       
   973     CEikScrollBarFrame* iScrollBar;
       
   974 
       
   975     /**
       
   976      * Temporary place to store the previous titlepane text
       
   977      * Owned.
       
   978      */
       
   979     HBufC*              iOldTitleText;
       
   980 
       
   981     /**
       
   982      * Object for query dialog
       
   983      * Owned.
       
   984      */
       
   985     CAknQueryDialog*    iQueryDialog;
       
   986 
       
   987     // SETTING PAGE
       
   988 
       
   989     /**
       
   990      * Previous location of cursor
       
   991      * Owned.
       
   992      */
       
   993     CIpsSetUiIntArray*    iSettingsLastItemIndex;
       
   994 
       
   995     /**
       
   996      * Temporary value for setting page
       
   997      */
       
   998     TInt                    iSettingValue;
       
   999 
       
  1000     /**
       
  1001      * Temporary text for setting page
       
  1002      */
       
  1003     RBuf                    iSettingText;
       
  1004 
       
  1005     /**
       
  1006      * Temporary text for password setting page
       
  1007      * Owned.
       
  1008      */
       
  1009     TIpsSetUiPasswordText*      iNewPassword;
       
  1010 
       
  1011     /**
       
  1012      * Temporary text for password setting page
       
  1013      * Owned.
       
  1014      */
       
  1015     TIpsSetUiPasswordText*      iOldPassword;
       
  1016 
       
  1017     /**
       
  1018      * Temporary array for buttons
       
  1019      * Owned.
       
  1020      */
       
  1021     CDesCArrayFlat*         iButtonArray;
       
  1022 
       
  1023     /**
       
  1024      * Temporary array for checkboxes
       
  1025      * Owned.
       
  1026      */
       
  1027     CSelectionItemList*     iCheckboxArray;
       
  1028 
       
  1029     /**
       
  1030      * Array to temporary store the items to be edited
       
  1031      * Owned.
       
  1032      */
       
  1033     CIpsSetUiBaseItemArray*   iBackupArray;
       
  1034 
       
  1035     /**
       
  1036      * Index to focused list box item
       
  1037      */
       
  1038     TInt                    iCurrentItemIndex;
       
  1039 
       
  1040     /**
       
  1041      * Checks user input
       
  1042      * Owned.
       
  1043      */
       
  1044     CIpsSetUiApprover*      iItemApprover;
       
  1045     
       
  1046 
       
  1047     };
       
  1048 
       
  1049 #endif /* IPSSETUIBASEDIALOG_H */
       
  1050 
       
  1051 // End of File
       
  1052 
       
  1053