email/imum/Utils/Inc/IMSSettingsBaseUi.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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:  IMSSettingsBaseUI.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IMSSETTINGSBASEUI_H
       
    21 #define IMSSETTINGSBASEUI_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <coedef.h>                 // TKeyResponse
       
    26 #include <w32std.h>                 // TKeyEvent
       
    27 #include <msvapi.h>                 // CMsvSession
       
    28 #include <StringLoader.h>           // StringLoader
       
    29 #include "MuiuDynamicSettingsDialog.h"
       
    30 
       
    31 #include "IMSSettingsItemAccessPoint.h" // CIMSSettingsAccessPointItem
       
    32 #include "ImumMboxManager.h"     // CImumMboxManager
       
    33 #include "IMASPageIds.hrh"           // TIMASettigsId
       
    34 #include "IMSSettingsUi.h"
       
    35 
       
    36 // CONSTANTS
       
    37 // MACROS
       
    38 // DATA TYPES
       
    39 // FUNCTION PROTOTYPES
       
    40 // FORWARD DECLARATIONS
       
    41 class CIMSSettingsItemApprover;
       
    42 class CIMSSettingsNoteUi;
       
    43 class CImumMboxDefaultData;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *
       
    49 *  @lib
       
    50 *  @since S60 3.0
       
    51 */
       
    52 class CIMSSettingsBaseUI :
       
    53     public CMuiuDynamicSettingsDialog
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56 
       
    57         /**
       
    58         * Destructor
       
    59         * @since S60 3.0
       
    60         */
       
    61         virtual ~CIMSSettingsBaseUI();
       
    62 
       
    63     public:  // New virtual functions
       
    64 
       
    65         /**
       
    66         *
       
    67         * @since S60 3.0
       
    68         */
       
    69         virtual CMuiuSettingBase* GetUninitializedItem(
       
    70             const TUid& aId );
       
    71 
       
    72         /**
       
    73         *
       
    74         * @since S60 3.0
       
    75         */
       
    76         virtual void GetHelpContext( TCoeHelpContext& aContext ) const;
       
    77 
       
    78     public: // New functions
       
    79 
       
    80         /**
       
    81         *
       
    82         * @since S60 3.0
       
    83         */
       
    84         void DoQuitL();
       
    85 
       
    86         /**
       
    87         *
       
    88         * @since S60 3.0
       
    89         */
       
    90         TBool Flag( TUint aFlag );
       
    91 
       
    92         /**
       
    93         *
       
    94         * @since S60 3.0
       
    95         */
       
    96         void SetFlag( TUint aFlag );
       
    97 
       
    98         /**
       
    99         *
       
   100         * @since S60 3.0
       
   101         */
       
   102         void ClearFlag( TUint aFlag );
       
   103 
       
   104         /**
       
   105         *
       
   106         * @since S60 3.0
       
   107         */
       
   108         void ChangeFlag(
       
   109             TUint aFlag,
       
   110             TBool aNewState );
       
   111 
       
   112         /**
       
   113         *
       
   114         * @since S60 3.0
       
   115         */
       
   116         const CMuiuFlags& Flags();
       
   117 
       
   118         /**
       
   119         *
       
   120         * @since S60 3.0
       
   121         */
       
   122         TInt FindItem(
       
   123             CIMSSettingsAccessPointItem*& aItem,
       
   124             const TUid& aId );
       
   125 
       
   126         /**
       
   127         *
       
   128         * @since S60 3.0
       
   129         */
       
   130         TInt FindItem(
       
   131             CMuiuSettingsLinkExtended*& aItem,
       
   132             const TUid& aId );
       
   133 
       
   134         /**
       
   135         *
       
   136         * @since S60 3.0
       
   137         */
       
   138         CMuiuSettingBase* CreateItemForBackupL(
       
   139             CMuiuSettingBase& aBaseItem );
       
   140 
       
   141         /**
       
   142          * Returns the id of the editable mailbox
       
   143          *
       
   144          * @since S60 v3.2
       
   145          * @return Mailbox Id
       
   146          */
       
   147         virtual TMsvId CurrentMailboxId();
       
   148 
       
   149     public: // Functions from base classes
       
   150 
       
   151         TKeyResponse OfferKeyEventL(
       
   152             const TKeyEvent& aKeyEvent,
       
   153             TEventCode aType );
       
   154 
       
   155         void ProcessCommandL( TInt aCommandId );
       
   156 
       
   157         virtual TBool OkToExitL( const TInt aButtonId ) = 0;
       
   158 
       
   159         /**
       
   160         * Moves data from the UI to settings data object
       
   161         * @since S60 3.0
       
   162         */
       
   163         virtual void StoreSettingsToAccountL(
       
   164             CImumInSettingsData& aSettings ) = 0;
       
   165 
       
   166     protected:  // Constructors
       
   167 
       
   168         /**
       
   169         * Default constructor for classCIMSSettingsBaseUI
       
   170         * @since S60 3.0
       
   171         * @return, Constructed object
       
   172         */
       
   173         CIMSSettingsBaseUI(
       
   174             CIMSSettingsUi& aDialog,
       
   175             CImumInternalApiImpl& aEmailApi,
       
   176             CEikFormattedCellListBox& aListBox,
       
   177             CAknTitlePane& aTitlePane,
       
   178             CMuiuFlags& aFlags );
       
   179 
       
   180         /**
       
   181         * Symbian 2-phase constructor
       
   182         * @since S60 3.0
       
   183         */
       
   184         void BaseUiConstructL(
       
   185             CEikButtonGroupContainer& aSoftkeys,
       
   186             const TInt aSettingResourceId = NULL,
       
   187             const TBool aUpdateMSK = EFalse );
       
   188 
       
   189     protected:  // New virtual functions
       
   190 
       
   191         virtual TBool KeyPressSoftkey( const TInt aButton ) = 0;
       
   192         virtual TBool KeyPressOKButtonL( const TInt aButton ) = 0;
       
   193 
       
   194         /**
       
   195         *
       
   196         * @since S60 3.0
       
   197         */
       
   198         virtual CMuiuSettingBase* CreateCustomItemToArrayLC(
       
   199             const TUid& aId );
       
   200 
       
   201     protected:  // New functions
       
   202 
       
   203         /**
       
   204         *
       
   205         * @since S60 3.0
       
   206         */
       
   207         inline TUid ToUid( const TUint32 aId ) const;
       
   208 
       
   209 
       
   210         /**
       
   211         *
       
   212         * @since S60 3.0
       
   213         */
       
   214         inline TInt SafeStringLoad( const TInt aResource,
       
   215             					    HBufC*& aString ) const;
       
   216 
       
   217         /**
       
   218         *
       
   219         * @since S60 3.0
       
   220         */
       
   221         void HidePermanently( CMuiuSettingBase& aBase,
       
   222             				  const TBool aNewState );
       
   223 
       
   224         /**
       
   225         *
       
   226         * @since S60 3.0
       
   227         */
       
   228         void HidePermanently( const TUid& aId,
       
   229             				  const TBool aNewState );
       
   230 
       
   231         /**
       
   232         *
       
   233         * @since S60 3.0
       
   234         */
       
   235         void SetItemIapItemL(
       
   236             CIMSSettingsAccessPointItem& aIapItem );
       
   237 
       
   238         /**
       
   239         *
       
   240         * @since S60 3.0
       
   241         */
       
   242         void UpdateAccessPointItem( CMuiuSettingBase& aBaseItem );
       
   243 
       
   244         /**
       
   245         *
       
   246         * @since S60 3.0
       
   247         */
       
   248         void SetReadOnly(
       
   249             const TUid& aId,
       
   250             const TBool aNewState );
       
   251 
       
   252     protected:  // Functions from base classes
       
   253 
       
   254     private:  // New virtual functions
       
   255 
       
   256         virtual TBool EventHandlerL( const TInt aCommandId );
       
   257 
       
   258     private:  // New functions
       
   259 
       
   260         /**
       
   261         * Creates default data object and load the data from CenRep
       
   262         * @since S60 3.0
       
   263         * @return Default data -object
       
   264         */
       
   265         CImumMboxDefaultData* RestoreDefaultSettingsDataL();
       
   266 
       
   267     private:  // Functions from base classes
       
   268 
       
   269         // CMuiuDynamicSettingsDialog
       
   270         void HandleSettingPageEventL(
       
   271             CAknSettingPage* aSettingPage,
       
   272             TAknSettingPageEvent aEventType );
       
   273 
       
   274     public:     // Data
       
   275     protected:  // Data
       
   276 
       
   277         // Flags for the wizard
       
   278         CMuiuFlags&             iBaseUiFlags;
       
   279         // Dialog that owns the settings
       
   280         CIMSSettingsUi&         iDialog;
       
   281         // Reference to mailbox api
       
   282         CImumInternalApiImpl&       iMailboxApi;
       
   283         // Pointer to class that validates given item
       
   284         CIMSSettingsItemApprover* iItemApprover;
       
   285         // Class to handle notes in UI
       
   286         CIMSSettingsNoteUi*     iNoteUi;
       
   287         // Class to contain default settings data
       
   288         CImumMboxDefaultData*       iDefaultData;
       
   289 
       
   290     private:    // Data
       
   291     };
       
   292 
       
   293 #include "IMSSettingsBaseUi.inl"
       
   294 
       
   295 #endif      // IMSSETTINGSBASEUI_H
       
   296 
       
   297 // End of File