ipsservices/ipssossettings/inc/ipssetdataextension.h
changeset 0 8466d47a6819
child 4 e7aa27f58ae1
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:  Defines an API to create and edit mailbox settings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IPSSETDATAEXTENSION_H
       
    21 #define IPSSETDATAEXTENSION_H
       
    22 
       
    23 #include <msvstd.h>
       
    24 
       
    25 #include "ipssetutilsconsts.h"
       
    26 
       
    27 /**
       
    28  * Settings extension to current mailbox settings
       
    29  *
       
    30  * @since FS v1.0
       
    31  * @lib IpsSosSettings.lib
       
    32  */
       
    33 class CIpsSetDataExtension : public CBase
       
    34     {
       
    35 public: // Constructors and destructor
       
    36 
       
    37     /**
       
    38      * Creates mailbox extension object
       
    39      */
       
    40     IMPORT_C static CIpsSetDataExtension* NewLC();
       
    41 
       
    42     /**
       
    43      * Creates mailbox extension object
       
    44      */
       
    45     IMPORT_C static CIpsSetDataExtension* NewL();
       
    46 
       
    47     /**
       
    48      * Destructor
       
    49      */
       
    50     virtual ~CIpsSetDataExtension();
       
    51 
       
    52 public: // New functions
       
    53 
       
    54     /**
       
    55      * Verifies the validy of the metadata in the settings
       
    56      * @return ETrue if the settings are valid
       
    57      * @return EFalse if the settings are invalid
       
    58      */
       
    59     IMPORT_C TBool IsSettingsValid() const;
       
    60 
       
    61     // COMMON
       
    62 
       
    63     /**
       
    64      * Retrieves the status flags of the settings
       
    65      * @return Status flags
       
    66      */
       
    67     IMPORT_C void SetStatusFlags( const TUint64 aStatusFlags );
       
    68 
       
    69     /**
       
    70      * Retrieves the status flags of the settings
       
    71      * @return Status flags
       
    72      */
       
    73     IMPORT_C TUint64 StatusFlags() const;
       
    74 
       
    75     /**
       
    76      * Makes identical copy of settings
       
    77      * @param aExtension, Setting to be copied
       
    78      */
       
    79     IMPORT_C void CopyL(
       
    80         const CIpsSetDataExtension& aExtension );
       
    81 
       
    82     /**
       
    83      * Sets the id of the mailbox the setting is associated with
       
    84      * This is not exported
       
    85      * @param aMailboxId, Mailbox, who owns the settings
       
    86      */
       
    87     IMPORT_C void SetMailboxId(
       
    88         const TMsvId aMailboxId );
       
    89 
       
    90     /**
       
    91      * Returns the id of the owner of the setting
       
    92      * @return Mailbox id
       
    93      */
       
    94     IMPORT_C TMsvId MailboxId() const;
       
    95 
       
    96     /**
       
    97      * Set the account id of the base settings
       
    98      * This is not exported
       
    99      * @param aAccountId, Sets value of iAccountId
       
   100      */
       
   101     IMPORT_C void SetAccountId( const TUint32 aAccountId );
       
   102 
       
   103     /**
       
   104      * Get the account id of the base settings
       
   105      * @return value of iAccountId
       
   106      */
       
   107     IMPORT_C TUint32 AccountId() const;
       
   108 
       
   109     /**
       
   110      * Set the account id of the extended settings
       
   111      * This is not exported
       
   112      * @param aExtensionId, Sets value of iExtensionId
       
   113      */
       
   114     IMPORT_C void SetExtensionId( const TUint32 aExtensionId );
       
   115 
       
   116     /**
       
   117      * Get the account id of the extended settings
       
   118      * @return value of iExtensionId
       
   119      */
       
   120     IMPORT_C TUint32 ExtensionId() const;
       
   121 
       
   122     /**
       
   123      * Set method for member iProtocol
       
   124      * This is not exported
       
   125      * @param aProtocol, Sets value of iProtocol
       
   126      */
       
   127     IMPORT_C void SetProtocol( const TUid& aProtocol );
       
   128 
       
   129     /**
       
   130      * Get function for member iProtocol
       
   131      * @return value of iProtocol
       
   132      */
       
   133     IMPORT_C TUid Protocol() const;
       
   134 
       
   135     /**
       
   136      * Set method for member iEmailAddress
       
   137      * @param aEmailAddress, Sets value of iEmailAddress
       
   138      */
       
   139     IMPORT_C void SetEmailAddress( const TDesC& aEmailAddress );
       
   140 
       
   141     /**
       
   142      * Get function for member iEmailAddress
       
   143      * @return value of iEmailAddress
       
   144      */
       
   145     IMPORT_C const TDesC& EmailAddress() const;
       
   146 
       
   147     // EXTENDED MAIL SETTINGS
       
   148 
       
   149     /**
       
   150      * Sets the state of email notification -flag
       
   151      */
       
   152     IMPORT_C void SetEmailNotificationState(
       
   153         const TIpsSetDataEmnStates aEmnState );
       
   154 
       
   155     /**
       
   156      * Fetches the state of email notification -flag
       
   157      * @return ETrue or EFalse, according to flag state
       
   158      */
       
   159     IMPORT_C TIpsSetDataEmnStates EmailNotificationState() const;
       
   160 
       
   161     /**
       
   162      * A flag to
       
   163      * @param aNewMailIndicators, Sets value of iNewMailIndicators
       
   164      */
       
   165     IMPORT_C void SetNewMailIndicators(
       
   166         const TBool aNewState );
       
   167 
       
   168     /**
       
   169      *
       
   170      * @return value of EMailNewIndicators
       
   171      */
       
   172     IMPORT_C TBool NewMailIndicators() const;
       
   173 
       
   174     /**
       
   175      * Sets the state of hide messages -flag
       
   176      * @param aNewState, The new state of the flag
       
   177      */
       
   178     IMPORT_C void SetHideMsgs(
       
   179         const TBool aNewState );
       
   180 
       
   181     /**
       
   182      * Fetches the state of hide messages -flag
       
   183      * @return ETrue or EFalse, according to flag state
       
   184      */
       
   185     IMPORT_C TBool HideMsgs() const;
       
   186 
       
   187     /**
       
   188      * Sets the value of open html mail -setting
       
   189      * @param aOpenHtmlMail, New value of the setting
       
   190      */
       
   191     IMPORT_C void SetOpenHtmlMail(
       
   192         const TInt aOpenHtmlMail );
       
   193 
       
   194     /**
       
   195      * Fetches the state of open html mail -setting
       
   196      * @return Setting value
       
   197      */
       
   198     IMPORT_C TInt OpenHtmlMail() const;
       
   199 
       
   200     // ALWAYS ONLINE
       
   201 
       
   202     /**
       
   203      * Get function for member iVersion
       
   204      * @return value of iVersion
       
   205      */
       
   206     IMPORT_C TInt Version() const;
       
   207 
       
   208     /**
       
   209      * Set method for member iAlwaysOnlineState
       
   210      * @param aAlwaysOnlineState, Sets value of iAlwaysOnlineState
       
   211      */
       
   212     IMPORT_C void SetAlwaysOnlineState(
       
   213         const TIpsSetDataAoStates aAlwaysOnlineState,
       
   214         TBool aIgnoreStateFlag=EFalse );
       
   215 
       
   216     /**
       
   217      * Get function for member iAlwaysOnlineState
       
   218      * @return value of iAlwaysOnlineState
       
   219      */
       
   220     IMPORT_C TIpsSetDataAoStates AlwaysOnlineState() const;
       
   221 
       
   222     /**
       
   223      * Set method for member iSelectedWeekDays
       
   224      * @param aSelectedWeekDays, Sets value of iSelectedWeekDays
       
   225      */
       
   226     IMPORT_C void SetSelectedWeekDays(
       
   227         const TUint aSelectedWeekDays );
       
   228 
       
   229     /**
       
   230      * Get function for member iSelectedWeekDays
       
   231      * @return value of iSelectedWeekDays
       
   232      */
       
   233     IMPORT_C TUint SelectedWeekDays() const;
       
   234 
       
   235     /**
       
   236      * Set method for member iSelectedTimeStart
       
   237      * @param aSelectedTimeStart, Sets value of iSelectedTimeStart
       
   238      */
       
   239     IMPORT_C void SetSelectedTimeStart(
       
   240         const TTime aSelectedTimeStart );
       
   241 
       
   242     /**
       
   243      * Get function for member iSelectedTimeStart
       
   244      * @return value of iSelectedTimeStart
       
   245      */
       
   246     IMPORT_C TTime SelectedTimeStart() const;
       
   247 
       
   248     /**
       
   249      * Set method for member iSelectedTimeStop
       
   250      * @param aSelectedTimeStop, Sets value of iSelectedTimeStop
       
   251      */
       
   252     IMPORT_C void SetSelectedTimeStop(
       
   253         const TTime aSelectedTimeStop );
       
   254 
       
   255     /**
       
   256      * Get function for member iSelectedTimeStop
       
   257      * @return value of iSelectedTimeStop
       
   258      */
       
   259     IMPORT_C TTime SelectedTimeStop() const;
       
   260 
       
   261     /**
       
   262      * Set method for member iInboxRefreshTime
       
   263      * @param aInboxRefreshTime, Sets value of iInboxRefreshTime
       
   264      */
       
   265     IMPORT_C void SetInboxRefreshTime(
       
   266         const TInt aInboxRefreshTime );
       
   267 
       
   268     /**
       
   269      * Get function for member iInboxRefreshTime
       
   270      * @return value of iInboxRefreshTime
       
   271      */
       
   272     IMPORT_C TInt InboxRefreshTime() const;
       
   273 
       
   274     /**
       
   275      * Set method for member iUpdateMode
       
   276      * @param aUpdateMode, Sets value of iUpdateMode
       
   277      */
       
   278     IMPORT_C void SetUpdateMode(
       
   279         const TIpsSetDataAoUpdateModes aUpdateMode );
       
   280 
       
   281     /**
       
   282      * Get function for member iUpdateMode
       
   283      * @return value of iUpdateMode
       
   284      */
       
   285     IMPORT_C TIpsSetDataAoUpdateModes UpdateMode() const;
       
   286 
       
   287     /**
       
   288      * Set method for member iLastUpdateInfo
       
   289      * @param aLastUpdateInfo, Sets value of iLastUpdateInfo
       
   290      */
       
   291     IMPORT_C void SetLastUpdateInfo( const TAOInfo& aLastUpdateInfo );
       
   292 
       
   293     /**
       
   294      * Get function for member iLastUpdateInfo
       
   295      * @return value of iLastUpdateInfo
       
   296      */
       
   297     IMPORT_C TAOInfo LastUpdateInfo() const;
       
   298 
       
   299     /**
       
   300       *
       
   301       *
       
   302       * @param
       
   303       * @return
       
   304       */
       
   305     IMPORT_C void SetOutgoingLogin( const TInt aOutgoingLogin );
       
   306 
       
   307     /**
       
   308       *
       
   309       *
       
   310       * @param
       
   311       * @return
       
   312       */
       
   313     IMPORT_C TInt OutgoingLogin() const;
       
   314         
       
   315     /**
       
   316     *
       
   317     */
       
   318     IMPORT_C void SetRoamHomeOnlyFlag( TBool aTrue );
       
   319         
       
   320     /**
       
   321     *
       
   322     */
       
   323     IMPORT_C TBool RoamHomeOnlyFlag();
       
   324         
       
   325 
       
   326     /**
       
   327     *
       
   328     */
       
   329     IMPORT_C void SetLastModified( TTime aTime );
       
   330 
       
   331     /**
       
   332     *
       
   333     */    
       
   334     IMPORT_C TTime LastModified() const;
       
   335     
       
   336     /**
       
   337     *
       
   338     */    
       
   339     IMPORT_C void SetSyncStatus( TInt aLastSyncStatus );
       
   340     
       
   341     /**
       
   342     *
       
   343     */
       
   344     IMPORT_C TInt LastSyncStatus() const;
       
   345     
       
   346     /**
       
   347     *
       
   348     */
       
   349     IMPORT_C void SetEmnReceivedButNotSyncedFlag( TBool aFlag );
       
   350     
       
   351     /**
       
   352     *
       
   353     */
       
   354     IMPORT_C TBool EmnReceivedButNotSyncedFlag() const;
       
   355 
       
   356     /**
       
   357     *
       
   358     */
       
   359     IMPORT_C void PopulateDefaults();
       
   360     
       
   361 //<cmail>  
       
   362     /**
       
   363     * Set method for member iHiddenData 
       
   364     * @param ETrue if username, servers etc. are hidden
       
   365     */
       
   366     IMPORT_C void SetDataHidden( const TBool aIsHidden );
       
   367     
       
   368     /**
       
   369     * Get method for member iHiddenData 
       
   370     * @return value of iLastUpdateInfo
       
   371     */
       
   372     IMPORT_C TBool DataHidden() const;
       
   373     
       
   374     /**
       
   375      * Sets a flag when mailbox receives it's first OMA EMN.
       
   376      * (email notification)
       
   377      */
       
   378     IMPORT_C void SetFirstEmnReceived( TBool aValue );
       
   379     
       
   380     /**
       
   381      * Returns flag which indicates has mailbox received 
       
   382      * it's first OMA EMN. 
       
   383      */
       
   384     IMPORT_C TBool FirstEmnReceived() const;
       
   385     
       
   386 private:  // Constructors and destructor
       
   387 
       
   388     /**
       
   389      * ConstructL
       
   390      */
       
   391     void ConstructL();
       
   392 
       
   393     /**
       
   394      * Default constructor
       
   395      */
       
   396     CIpsSetDataExtension();
       
   397 
       
   398 private:    // Data
       
   399 
       
   400     /**
       
   401      * Flags for storing.
       
   402      */
       
   403     /*enum TMailExtensionFlags
       
   404         {
       
   405         EMailNewIndicators      = 0x01,
       
   406         EMailNewNotifications   = 0x02,
       
   407         EMailHideMsgsOverLimit  = 0x04,
       
   408         EMailShowFieldCC        = 0x08,
       
   409         EMailShowFieldBCC       = 0x10,
       
   410         EMailShowFieldSubject   = 0x20,
       
   411         EMailRoamHomeOnly       = 0x40
       
   412         };*/
       
   413 
       
   414     /**
       
   415      * Common: Id of the mailbox this settings belongs
       
   416      */
       
   417     TInt                iMailboxId;
       
   418     /**
       
   419      * Common: Account id of the base settings
       
   420      */
       
   421     TUint32             iAccountId;
       
   422     /**
       
   423      * Common: Account id of the extended settings
       
   424      */
       
   425     TUint32             iExtensionId;
       
   426     /**
       
   427      * Common: Protocol of the base settings
       
   428      */
       
   429     TUid                iProtocol;
       
   430     /**
       
   431      * Extended: HTML mail opening mode.
       
   432      */
       
   433     TInt                iOpenHtmlMail;
       
   434     /**
       
   435      * AO: Settings version.
       
   436      */
       
   437     TInt                iVersion;
       
   438     /**
       
   439      * AO:
       
   440      */
       
   441     TIpsSetDataAoStates       iAlwaysOnlineState;
       
   442     /**
       
   443      * AO: Selected weekdays: 0-6 = Monday-Sunday
       
   444      */
       
   445     TUint               iSelectedWeekDays;
       
   446     /**
       
   447      * AO: Connection starting time
       
   448      */
       
   449     TTime               iSelectedTimeStart;
       
   450     /**
       
   451      * AO: Connection ending time
       
   452      */
       
   453     TTime               iSelectedTimeStop;
       
   454     /**
       
   455      * AO: Inbox refresh interval in minutes
       
   456      */
       
   457     TInt                iInboxRefreshTime;
       
   458     /**
       
   459      * AO: Mail update mode.
       
   460      */
       
   461     TIpsSetDataAoUpdateModes iUpdateMode;
       
   462     /**
       
   463      * AO: Email address for Always Online.
       
   464      */
       
   465     RBuf                iEmailAddress;
       
   466     /**
       
   467      * EMN: Emn states
       
   468      */
       
   469     TIpsSetDataEmnStates iEmnState;
       
   470             
       
   471     TBool               iRoamHomeOnly;
       
   472     TBool               iHideMessages;
       
   473     TBool               iNewMailIndicators;
       
   474     
       
   475 //<cmail>    
       
   476     /**
       
   477      * User name and server addresses are hidden from the user
       
   478      */
       
   479     TBool               iHiddenData;
       
   480 //</cmail>    
       
   481     
       
   482     /**
       
   483      * AO: Last update status.
       
   484      */
       
   485     TAOInfo             iLastUpdateInfo;
       
   486     /**
       
   487      * Method to make outgoing login
       
   488      */
       
   489     TInt                iOutgoingLogin;
       
   490     /**
       
   491     * Timestamp to indicate last modification timevoid SetLastModified()
       
   492     */
       
   493     TTime               iLastModified;
       
   494     
       
   495     TInt                iSyncStatus;
       
   496     
       
   497     TBool               iEmnReceivedButNotSyncedFlag;
       
   498     
       
   499     /**
       
   500      * Common: Status flags of settings
       
   501      */
       
   502     TUint64             iStatusFlags;
       
   503     
       
   504     TBool               iFirstEMNReceived;
       
   505     
       
   506 
       
   507     };
       
   508 
       
   509 #endif      // IPSSETDATAEXTENSION_H
       
   510 
       
   511 // End of File