email/imum/Utils/Inc/ImumMboxDataExtension.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:  Defines an API to create and edit mailbox settings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CImumMboxDataExtension_H
       
    21 #define CImumMboxDataExtension_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32cmn.h>                               // TBuf
       
    26 #include <msvstd.h>
       
    27 #include <muiuflags.h>
       
    28 //#include "MuiuDynamicSettingItemBase.h"         // TMuiuSettingsText
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 enum TMailAoStates
       
    33     {
       
    34     EMailAoAlways = 0,
       
    35     EMailAoHomeOnly,
       
    36     EMailAoOff
       
    37     };
       
    38 
       
    39 enum TMailEmnStates
       
    40     {
       
    41     EMailEmnAutomatic = 0,
       
    42     EMailEmnHomeOnly,
       
    43     EMailEmnOff
       
    44     };
       
    45 
       
    46 enum TMailAoUpdateModes
       
    47     {
       
    48     EMailAoHeadersOnly = 0,
       
    49     EMailAoBody,
       
    50     EMailAoBodyAndAttas
       
    51     };
       
    52 
       
    53 // Flags to handle status of settings
       
    54 enum TIMASMailSettingsStatusFlags
       
    55     {
       
    56     EIMASStatusTempRcvPassword = 0,
       
    57     EIMASStatusTempSndPassword,
       
    58     EIMASStatusLastFlag
       
    59     };
       
    60     
       
    61 // Mail deletion setting mode
       
    62 enum TIMASMailDeletionMode
       
    63     {
       
    64     EIMASMailDeletionAlwaysAsk = 0,
       
    65     EIMASMailDeletionPhone,
       
    66     EIMASMailDeletionServer
       
    67     };
       
    68 
       
    69 // MACROS
       
    70 // DATA TYPES
       
    71 // FUNCTION PROTOTYPES
       
    72 // FORWARD DECLARATIONS
       
    73 // CLASS DECLARATION
       
    74 
       
    75 /**
       
    76 * Utility structure TAOInfo.
       
    77 * Contains info was last update successful ( TBool )
       
    78 * and the date and time of last successful update ( TTime )
       
    79 */
       
    80 struct TAOInfo
       
    81     {
       
    82     TBool iLastUpdateFailed;
       
    83     TTime iLastSuccessfulUpdate;
       
    84     TBool iUpdateSuccessfulWithCurSettings;
       
    85     };
       
    86 
       
    87 /**
       
    88 *  Settings extension to current mailbox settings
       
    89 *
       
    90 *  @lib Imum.lib
       
    91 *  @since S60 3.0
       
    92 */
       
    93 class CImumMboxDataExtension : public CBase
       
    94     {
       
    95     public: // Constructors and destructor
       
    96 
       
    97         /**
       
    98         * Creates mailbox extension object
       
    99         * @since S60 3.0
       
   100         */
       
   101         static CImumMboxDataExtension* NewLC();
       
   102 
       
   103         /**
       
   104         * Creates mailbox extension object
       
   105         * @since S60 3.0
       
   106         */
       
   107         static CImumMboxDataExtension* NewL();
       
   108 
       
   109         /**
       
   110         * Destructor
       
   111         * @since S60 3.0
       
   112         */
       
   113         virtual ~CImumMboxDataExtension();
       
   114 
       
   115     public: // New functions
       
   116 
       
   117         /**
       
   118         * Verifies the validy of the metadata in the settings
       
   119         * @since S60 3.0
       
   120         * @return ETrue if the settings are valid
       
   121         * @return EFalse if the settings are invalid
       
   122         */
       
   123         TBool IsSettingsValid() const;
       
   124 
       
   125         // COMMON
       
   126 
       
   127         /**
       
   128         * Retrieves the status flags of the settings
       
   129         * @since S60 3.0
       
   130         * @return Status flags
       
   131         */
       
   132         void SetStatusFlags( const TMuiuFlags& aStatusFlags );
       
   133 
       
   134         /**
       
   135         * Retrieves the status flags of the settings
       
   136         * @since S60 3.0
       
   137         * @return Status flags
       
   138         */
       
   139         const TMuiuFlags& StatusFlags() const;
       
   140 
       
   141         /**
       
   142         * Makes identical copy of settings
       
   143         * @since S60 3.0
       
   144         * @param aExtension, Setting to be copied
       
   145         */
       
   146         void CopyL(
       
   147             const CImumMboxDataExtension& aExtension );
       
   148 
       
   149         /**
       
   150         * Sets the id of the mailbox the setting is associated with
       
   151         * This is not exported
       
   152         * @since S60 3.0
       
   153         * @param aMailboxId, Mailbox, who owns the settings
       
   154         */
       
   155         void SetMailboxId(
       
   156             const TMsvId aMailboxId );
       
   157 
       
   158         /**
       
   159         * Returns the id of the owner of the setting
       
   160         * @since S60 3.0
       
   161         * @return Mailbox id
       
   162         */
       
   163         TMsvId MailboxId() const;
       
   164 
       
   165         /**
       
   166         * Set the account id of the base settings
       
   167         * This is not exported
       
   168         * @since S60 3.0
       
   169         * @param aAccountId, Sets value of iAccountId
       
   170         */
       
   171         void SetAccountId( const TUint32 aAccountId );
       
   172 
       
   173         /**
       
   174         * Get the account id of the base settings
       
   175         * @since S60 3.0
       
   176         * @return value of iAccountId
       
   177         */
       
   178         TUint32 AccountId() const;
       
   179 
       
   180         /**
       
   181         * Set the account id of the extended settings
       
   182         * This is not exported
       
   183         * @since S60 3.0
       
   184         * @param aExtensionId, Sets value of iExtensionId
       
   185         */
       
   186         void SetExtensionId( const TUint32 aExtensionId );
       
   187 
       
   188         /**
       
   189         * Get the account id of the extended settings
       
   190         * @since S60 3.0
       
   191         * @return value of iExtensionId
       
   192         */
       
   193         TUint32 ExtensionId() const;
       
   194 
       
   195         /**
       
   196         * Set method for member iProtocol
       
   197         * This is not exported
       
   198         * @since S60 3.0
       
   199         * @param aProtocol, Sets value of iProtocol
       
   200         */
       
   201         void SetProtocol( const TUid& aProtocol );
       
   202 
       
   203         /**
       
   204         * Get function for member iProtocol
       
   205         * @since S60 3.0
       
   206         * @return value of iProtocol
       
   207         */
       
   208         TUid Protocol() const;
       
   209 
       
   210         /**
       
   211         * Set method for member iEmailAddress
       
   212         * @since S60 3.0
       
   213         * @param aEmailAddress, Sets value of iEmailAddress
       
   214         */
       
   215         void SetEmailAddress( const TDesC& aEmailAddress );
       
   216 
       
   217         /**
       
   218         * Get function for member iEmailAddress
       
   219         * @since S60 3.0
       
   220         * @return value of iEmailAddress
       
   221         */
       
   222         const TDesC* EmailAddress() const;
       
   223 
       
   224         // EXTENDED MAIL SETTINGS
       
   225 
       
   226         /**
       
   227         * Sets the state of email notification -flag
       
   228         * @since S60 3.0
       
   229         */
       
   230         void SetEmailNotificationState(
       
   231             const TMailEmnStates aEmnState );
       
   232 
       
   233         /**
       
   234         * Fetches the state of email notification -flag
       
   235         * @since S60 3.0
       
   236         * @return ETrue or EFalse, according to flag state
       
   237         */
       
   238         TMailEmnStates EmailNotificationState() const;
       
   239 
       
   240         /**
       
   241         * A flag to
       
   242         * @since S60 3.0
       
   243         * @param aNewMailIndicators, Sets value of iNewMailIndicators
       
   244         */
       
   245         void SetNewMailIndicators(
       
   246             const TInt aNewState );
       
   247 
       
   248         /**
       
   249         *
       
   250         * @since S60 3.0
       
   251         * @return value of EMailNewIndicators
       
   252         */
       
   253         TBool NewMailIndicators() const;
       
   254 
       
   255         /**
       
   256         * Sets the state of hide messages -flag
       
   257         * @since S60 3.0
       
   258         * @param aNewState, The new state of the flag
       
   259         */
       
   260         void SetHideMsgs(
       
   261             const TBool aNewState );
       
   262 
       
   263         /**
       
   264         * Fetches the state of hide messages -flag
       
   265         * @since S60 3.0
       
   266         * @return ETrue or EFalse, according to flag state
       
   267         */
       
   268         TBool HideMsgs() const;
       
   269 
       
   270         /**
       
   271         * Sets the value of open html mail -setting
       
   272         * @since S60 3.0
       
   273         * @param aOpenHtmlMail, New value of the setting
       
   274         */
       
   275         void SetOpenHtmlMail(
       
   276             const TInt aOpenHtmlMail );
       
   277 
       
   278         /**
       
   279         * Fetches the state of open html mail -setting
       
   280         * @since S60 3.0
       
   281         * @return Setting value
       
   282         */
       
   283         TInt OpenHtmlMail() const;
       
   284 
       
   285         // ALWAYS ONLINE
       
   286 
       
   287         /**
       
   288         * Get function for member iVersion
       
   289         * @since S60 3.0
       
   290         * @return value of iVersion
       
   291         */
       
   292         TInt Version() const;
       
   293 
       
   294         /**
       
   295         * Set method for member iAlwaysOnlineState
       
   296         * @since S60 3.0
       
   297         * @param aAlwaysOnlineState, Sets value of iAlwaysOnlineState
       
   298         */
       
   299         void SetAlwaysOnlineState(
       
   300             const TMailAoStates aAlwaysOnlineState );
       
   301 
       
   302         /**
       
   303         * Get function for member iAlwaysOnlineState
       
   304         * @since S60 3.0
       
   305         * @return value of iAlwaysOnlineState
       
   306         */
       
   307         TMailAoStates AlwaysOnlineState() const;
       
   308 
       
   309         /**
       
   310         * Set method for member iSelectedWeekDays
       
   311         * @since S60 3.0
       
   312         * @param aSelectedWeekDays, Sets value of iSelectedWeekDays
       
   313         */
       
   314         void SetSelectedWeekDays(
       
   315             const TUint aSelectedWeekDays );
       
   316 
       
   317         /**
       
   318         * Get function for member iSelectedWeekDays
       
   319         * @since S60 3.0
       
   320         * @return value of iSelectedWeekDays
       
   321         */
       
   322         TUint SelectedWeekDays() const;
       
   323 
       
   324         /**
       
   325         * Set method for member iSelectedTimeStart
       
   326         * @since S60 3.0
       
   327         * @param aSelectedTimeStart, Sets value of iSelectedTimeStart
       
   328         */
       
   329         void SetSelectedTimeStart(
       
   330             const TTime aSelectedTimeStart );
       
   331 
       
   332         /**
       
   333         * Get function for member iSelectedTimeStart
       
   334         * @since S60 3.0
       
   335         * @return value of iSelectedTimeStart
       
   336         */
       
   337         TTime SelectedTimeStart() const;
       
   338 
       
   339         /**
       
   340         * Set method for member iSelectedTimeStop
       
   341         * @since S60 3.0
       
   342         * @param aSelectedTimeStop, Sets value of iSelectedTimeStop
       
   343         */
       
   344         void SetSelectedTimeStop(
       
   345             const TTime aSelectedTimeStop );
       
   346 
       
   347         /**
       
   348         * Get function for member iSelectedTimeStop
       
   349         * @since S60 3.0
       
   350         * @return value of iSelectedTimeStop
       
   351         */
       
   352         TTime SelectedTimeStop() const;
       
   353 
       
   354         /**
       
   355         * Set method for member iInboxRefreshTime
       
   356         * @since S60 3.0
       
   357         * @param aInboxRefreshTime, Sets value of iInboxRefreshTime
       
   358         */
       
   359         void SetInboxRefreshTime(
       
   360             const TInt aInboxRefreshTime );
       
   361 
       
   362         /**
       
   363         * Get function for member iInboxRefreshTime
       
   364         * @since S60 3.0
       
   365         * @return value of iInboxRefreshTime
       
   366         */
       
   367         TInt InboxRefreshTime() const;
       
   368 
       
   369         /**
       
   370         * Set method for member iUpdateMode
       
   371         * @since S60 3.0
       
   372         * @param aUpdateMode, Sets value of iUpdateMode
       
   373         */
       
   374         void SetUpdateMode(
       
   375             const TMailAoUpdateModes aUpdateMode );
       
   376 
       
   377         /**
       
   378         * Get function for member iUpdateMode
       
   379         * @since S60 3.0
       
   380         * @return value of iUpdateMode
       
   381         */
       
   382         TMailAoUpdateModes UpdateMode() const;
       
   383 
       
   384         /**
       
   385         * Set method for member iLastUpdateInfo
       
   386         * @since S60 3.0
       
   387         * @param aLastUpdateInfo, Sets value of iLastUpdateInfo
       
   388         */
       
   389         void SetLastUpdateInfo( const TAOInfo& aLastUpdateInfo );
       
   390 
       
   391         /**
       
   392         * Get function for member iLastUpdateInfo
       
   393         * @since S60 3.0
       
   394         * @return value of iLastUpdateInfo
       
   395         */
       
   396         TAOInfo LastUpdateInfo() const;
       
   397         
       
   398         /**
       
   399         * Set mail deletion setting mode
       
   400         * @since S60 3.2
       
   401         * @param aMailDeletion, Sets value of iMailDeletion
       
   402         */
       
   403         void SetMailDeletion( const TIMASMailDeletionMode aMailDeletion );
       
   404         
       
   405         /**
       
   406         * Get mail deletion setting mode
       
   407         * @since S60 3.2
       
   408         * @return value of iMailDeletion
       
   409         */
       
   410         TIMASMailDeletionMode MailDeletion() const;
       
   411         
       
   412         /**
       
   413         * Sets the predefinition status
       
   414         * @since S60 v3.2
       
   415         * @param aIsPredefined, Predefinition state
       
   416         */
       
   417         void SetIsPredefined( const TBool& aIsPredefined );
       
   418         
       
   419         /**
       
   420         * Gets the predefinition status
       
   421         * @since S60 v3.2
       
   422         * @return Predefinition status
       
   423         */
       
   424         TBool IsPredefined() const;
       
   425         
       
   426     public: // Functions from base classes
       
   427 
       
   428     protected:  // New virtual functions
       
   429     protected:  // New functions
       
   430     protected:  // Functions from base classes
       
   431 
       
   432     private:  // Constructors and destructor
       
   433 
       
   434         /**
       
   435         * ConstructL
       
   436         * @since S60 3.0
       
   437         */
       
   438         void ConstructL();
       
   439 
       
   440         /**
       
   441         * Default constructor
       
   442         * @since S60 3.0
       
   443         */
       
   444         CImumMboxDataExtension();
       
   445 
       
   446     private:  // New virtual functions
       
   447     private:  // New functions
       
   448     private:  // Functions from base classes
       
   449 
       
   450     public:     // Data
       
   451     protected:  // Data
       
   452     private:    // Data
       
   453 
       
   454         enum TMailExtensionFlags
       
   455             {
       
   456             EMailNewIndicators = 0,
       
   457             EMailNewNotifications,
       
   458             EMailHideMsgsOverLimit,
       
   459             EMailShowFieldCC,
       
   460             EMailShowFieldBCC,
       
   461             EMailShowFieldSubject,
       
   462             EMailIsPredefined,
       
   463             EMailLastFlag
       
   464             };
       
   465 
       
   466         // Common: Status flags of settings
       
   467         TMuiuFlags          iStatusFlags;
       
   468         // Common: Id of the mailbox this settings belongs
       
   469         TInt                iMailboxId;
       
   470         // Common: Account id of the base settings
       
   471         TUint32             iAccountId;
       
   472         // Common: Account id of the extended settings
       
   473         TUint32             iExtensionId;
       
   474         // Common: Protocol of the base settings
       
   475         TUid                iProtocol;
       
   476         // Extended: The setting flags
       
   477         TMuiuFlags          iFlags;
       
   478         // Extended:
       
   479         TInt                iOpenHtmlMail;
       
   480         // AO:
       
   481         TInt                iVersion;
       
   482         // AO:
       
   483         TMailAoStates       iAlwaysOnlineState;
       
   484         // AO: Selected weekdays: 0-6 = Monday-Sunday
       
   485         TUint               iSelectedWeekDays;
       
   486         // AO: Connection starting time
       
   487         TTime               iSelectedTimeStart;
       
   488         // AO: Connection ending time
       
   489         TTime               iSelectedTimeStop;
       
   490         // AO: Inbox refresh interval in minutes
       
   491         TInt                iInboxRefreshTime;
       
   492         // AO:
       
   493         TMailAoUpdateModes  iUpdateMode;
       
   494         // AO:
       
   495         TAOInfo             iLastUpdateInfo;
       
   496         // AO:
       
   497         TBuf<1600>* iEmailAddress; // Temporary
       
   498         // EMN:
       
   499         TMailEmnStates      iEmnState;
       
   500         // Common: mail deletion behaviour
       
   501         TIMASMailDeletionMode iMailDeletion;
       
   502 
       
   503     };
       
   504 
       
   505 #endif      // CImumMboxDataExtension_H
       
   506 
       
   507 // End of File