ipsservices/ipssossettings/inc/ipssetdatastorer.h
changeset 0 8466d47a6819
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 IPSSETDATASTORER_H
       
    21 #define IPSSETDATASTORER_H
       
    22 
       
    23 #include <msvstd.h>             // TMsvId
       
    24 
       
    25 class CRepository;
       
    26 class CIpsSetDataExtension;
       
    27 class CIpsSetDataCtrlCenrep;
       
    28 class CEmailAccounts;
       
    29 class CImImap4Settings;
       
    30 class CImPop3Settings;
       
    31 class CImSmtpSettings;
       
    32 
       
    33 /**
       
    34  * Storer parameters.
       
    35  *
       
    36  * @since FS v1.0
       
    37  * @lib IpsSosSettings.lib
       
    38  */
       
    39 class TIpsSetDataStorerParams
       
    40     {
       
    41 public: 
       
    42     TIpsSetDataStorerParams(
       
    43         const TUint32& aAccountId,
       
    44         const TUid& aMtmId );
       
    45         
       
    46     TUint32 AccountId() const;
       
    47     TUid MtmId() const;
       
    48 
       
    49 private:
       
    50     TUint32 iAccountId;
       
    51     TUid    iMtmId;
       
    52     };
       
    53 
       
    54 /**
       
    55  * Class which stores the data to Central Repository.
       
    56  *
       
    57  * @since FS v1.0
       
    58  * @lib IpsSosSettings.lib
       
    59  */
       
    60 class CIpsSetDataStorer : public CBase
       
    61     {
       
    62 public:
       
    63 
       
    64     /**
       
    65      * Destructor
       
    66      */
       
    67     virtual ~CIpsSetDataStorer();
       
    68 
       
    69     /**
       
    70      * Creates the settings storer object
       
    71      */
       
    72     static CIpsSetDataStorer* NewL();
       
    73 
       
    74     /**
       
    75      * Creates the settings storer object
       
    76      */
       
    77     static CIpsSetDataStorer* NewLC();
       
    78 
       
    79 public: 
       
    80 
       
    81     /**
       
    82      * Creates settings to store.
       
    83      *
       
    84      * @param aMailboxId Receiving mailbox ID.
       
    85      * @param aAccountId Id of the account to be used.
       
    86      * @param aProtocol Protocol of the settings.
       
    87      * @param aExtendedMailSettings Extended email settings object.
       
    88      */
       
    89     TInt CreateExtendedSettings(
       
    90         const TMsvId aMailboxId,
       
    91         const TUint32 aAccountId,
       
    92         const TUid& aProtocol,
       
    93         CIpsSetDataExtension& aExtendedMailSettings,
       
    94         const TBool aPopulateDefaults = ETrue );
       
    95 
       
    96     /**
       
    97      * Deletes extended settings.
       
    98      */
       
    99     TInt DeleteExtendedSettingsL(
       
   100         const TMsvEntry& aMailbox );
       
   101 
       
   102     /**
       
   103      * Deletes extended settings.
       
   104      *
       
   105      * @param aAccountId Id of the account to be used
       
   106      * @param aMtmId Current receiving MTM ID.
       
   107      * @return KErrNone if deleted successfully, else system wide error code.
       
   108      */
       
   109     TInt DeleteExtendedSettingsL(
       
   110         const TUint32 aAccountId,
       
   111         const TUid& aMtmId );
       
   112 
       
   113     /**
       
   114      * Saves the Extended settings to the Central Repository
       
   115      *
       
   116      * @param aExtendedMailSettings Extended email settings object.
       
   117      * @return KErrNone, if saving has been successful
       
   118      */
       
   119     TInt SaveExtendedSettings(
       
   120         const CIpsSetDataExtension& aExtendedMailSettings );
       
   121 
       
   122     /**
       
   123      * Saves the protocol related settings to Central Repository.
       
   124      *
       
   125      * @param aAccountId Id of the account to be used
       
   126      * @param aImap4Settings Imap4 setting object.
       
   127      */
       
   128     TInt SaveImap4Settings(
       
   129         const TUint32 aAccountId,
       
   130         const CImImap4Settings& aImap4Settings );
       
   131 
       
   132     /**
       
   133      * Saves the protocol related settings to Central Repository.
       
   134      *
       
   135      * @param aAccountId Id of the account to be used
       
   136      * @param aPop3Settings Pop3 setting object.
       
   137      */
       
   138     TInt SavePop3Settings(
       
   139         const TUint32 aAccountId,
       
   140         const CImPop3Settings& aPop3Settings );
       
   141 
       
   142     /**
       
   143      * Saves the protocol related settings to Central Repository.
       
   144      *
       
   145      * @param aAccountId Id of the account to be used
       
   146      * @param aSmtpSettings Smtp setting object.
       
   147      */
       
   148     TInt SaveSmtpSettings(
       
   149         const TUint32 aAccountId,
       
   150         const CImSmtpSettings& aSmtpSettings );
       
   151 
       
   152     /**
       
   153      * Loads the Extended settings from the Central Repository
       
   154      *
       
   155      * @param aParams Id of the account to be used
       
   156      * @param aExtendedSettings Settings object
       
   157      * @return KErrNone, if loading has been successful
       
   158      */
       
   159     TInt LoadExtendedSettings(
       
   160         const TIpsSetDataStorerParams& aParams,
       
   161         CIpsSetDataExtension& aExtendedMailSettings );
       
   162 
       
   163     /**
       
   164      * Loads protocol spesific settings from Central Repository.
       
   165      *
       
   166      * @param aAccountId Id of the account to be used
       
   167      * @param aImap4Settings Imap4 setting object.
       
   168      */
       
   169     TInt LoadImap4Settings(
       
   170         const TUint32 aAccountId,
       
   171         CImImap4Settings& aImap4Settings );
       
   172 
       
   173     /**
       
   174      * Loads protocol spesific settings from Central Repository.
       
   175      *
       
   176      * @param aAccountId Id of the account to be used
       
   177      * @param aPop3Settings Pop3 setting object.
       
   178      */
       
   179     TInt LoadPop3Settings(
       
   180         const TUint32 aAccountId,
       
   181         CImPop3Settings& aPop3Settings );
       
   182 
       
   183     /**
       
   184      * Loads protocol spesific settings from Central Repository.
       
   185      *
       
   186      * @param aAccountId Id of the account to be used
       
   187      * @param aSmtpSettings Smtp setting object.
       
   188      */
       
   189     TInt LoadSmtpSettings(
       
   190         const TUint32 aAccountId,
       
   191         CImSmtpSettings& aSmtpSettings );
       
   192     
       
   193     /**
       
   194      * Saves the Extended settings to the Central Repository
       
   195      *
       
   196      * @param aExtendedSettings, Settings object
       
   197      * @return KErrNone, if saving has been successful
       
   198      */
       
   199     void SaveExtendedSettingsL(
       
   200         const CIpsSetDataExtension& aExtendedMailSettings );
       
   201 
       
   202     /**
       
   203      * Loads the Extended settings from the Central Repository
       
   204      *
       
   205      * @param aAccountId Id of the account to be used
       
   206      * @param aMtmId Current receiving MTM ID.
       
   207      * @param aExtendedSettings Settings object
       
   208      */
       
   209     void LoadExtendedSettingsL(
       
   210         const TUint32 aAccountId,
       
   211         const TUid& aMtmId,
       
   212         CIpsSetDataExtension& aExtendedMailSettings );
       
   213         
       
   214     
       
   215     /**
       
   216      * @return Symbian settings API.
       
   217      */
       
   218     CEmailAccounts* AccountsL();
       
   219 
       
   220 private: 
       
   221 
       
   222     /**
       
   223      * Default constructor
       
   224      */
       
   225     CIpsSetDataStorer();
       
   226 
       
   227     /**
       
   228      * ConstructL
       
   229      */
       
   230     void ConstructL();
       
   231 
       
   232 private: 
       
   233 
       
   234     /**
       
   235      * Create extended settings to Central Repository.
       
   236      *
       
   237      * @param aExtendedMailSettings Extended email settings object.
       
   238      */
       
   239     void CreateExtendedSettingsL(
       
   240         const CIpsSetDataExtension& aExtendedMailSettings );
       
   241 
       
   242     /**
       
   243      * 
       
   244      *
       
   245      */
       
   246     TInt SolveOutgoingLoginMethodL(
       
   247         const TUint32 aAccountId,
       
   248         const TUid& aMtmId );
       
   249 
       
   250 
       
   251 public:
       
   252 
       
   253     /**
       
   254      * Extended settings key collection.
       
   255      */
       
   256     enum TIpsSetDataCommonSettings
       
   257         {
       
   258         EIpsSetDataCommonSetStatusFlagsH = 0x00,
       
   259         EIpsSetDataCommonSetStatusFlagsL,
       
   260         EIpsSetDataCommonSetMailboxId,
       
   261         EIpsSetDataCommonSetAccountId,
       
   262         EIpsSetDataCommonSetExtensionId,
       
   263         EIpsSetDataCommonSetProtocol,
       
   264         EIpsSetDataCommonSetEmailAddress,
       
   265         EIpsSetDataExtSetEmailNotif,
       
   266         EIpsSetDataExtSetIndicators,
       
   267         EIpsSetDataExtSetHideMsgs,
       
   268         EIpsSetDataExtSetOpenHtmlMail,
       
   269         EIpsSetDataAoVersion,
       
   270         EIpsSetDataAoOnlineState,
       
   271         EIpsSetDataAoWeekDays,
       
   272         EIpsSetDataAoTimeStartH,
       
   273         EIpsSetDataAoTimeStartL,
       
   274         EIpsSetDataAoTimeStopH,
       
   275         EIpsSetDataAoTimeStopL,
       
   276         EIpsSetDataAoInboxRefreshTime,
       
   277         EIpsSetDataAoUpdateMode,
       
   278         EIpsSetDataAoLastSuccessfulUpdateH,
       
   279         EIpsSetDataAoLastSuccessfulUpdateL,
       
   280         EIpsSetDataAoLastUpdateFailed,
       
   281         EIpsSetDataAoUpdateSuccessfulWithCurSettings,
       
   282         /* Move the own settings somewhere very far away in the key space */
       
   283         EIpsSetDataFsOutgoingLogin      = 0xFA ,
       
   284         EIpsSetDataLastModifiedH,
       
   285         EIpsSetDataLastModifiedL,
       
   286         EIpsSetDataLastSyncStatus,
       
   287         //<cmail>        
       
   288         EIpsSetDataHideUserNameAndAddress,
       
   289         //</cmail>
       
   290         EIpsSetDateEmnReceivedButNotSyncedFlag,
       
   291 		EIpsSetDataFirstEMNReceivedFlag,
       
   292         EIpsSetDataKeyLast
       
   293         };
       
   294 
       
   295 private:
       
   296     /**
       
   297      * Repository for smtp settings
       
   298      * Owned.
       
   299      */
       
   300     CRepository*    iCenRepSmtp;
       
   301 
       
   302     /**
       
   303      * Repository for extended mail settings
       
   304      * Owned.
       
   305      */
       
   306     CRepository*    iCenRepExtMail;
       
   307 
       
   308     /**
       
   309      * Repository for always online settings
       
   310      * Owned.
       
   311      */
       
   312     CRepository*    iCenRepAlwaysOnline;
       
   313 
       
   314     /**
       
   315      * Repository for default settings data
       
   316      * Owned.
       
   317      */
       
   318     CRepository*    iCenRepDefaultData;
       
   319 
       
   320     /**
       
   321      * Pointer to accounts handler
       
   322      * Owned.
       
   323      */
       
   324     CEmailAccounts* iAccounts;
       
   325 
       
   326     /**
       
   327      * Class to handle Central Repository operations
       
   328      * Owned.
       
   329      */
       
   330     CIpsSetDataCtrlCenrep* iCenRepControl;
       
   331 
       
   332     };
       
   333 
       
   334 #endif      // IPSSETDATASTORER_H
       
   335 
       
   336 // End of File