1.1 --- a/epoc32/include/cemailaccounts.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,628 +0,0 @@
1.4 -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __CEMAILACCOUNTS_H__
1.20 -#define __CEMAILACCOUNTS_H__
1.21 -
1.22 -
1.23 -#include <e32std.h>
1.24 -#include <e32base.h>
1.25 -#include <msvapi.h>
1.26 -
1.27 -
1.28 -class CImIAPPreferences;
1.29 -class CImPop3Settings;
1.30 -class CImImap4Settings;
1.31 -class CImSmtpSettings;
1.32 -class CRepository;
1.33 -class CImapSyncDownloadRules;
1.34 -class CImapTransportBufferSizes;
1.35 -class CImSmtpMobilitySettings;
1.36 -
1.37 -/**
1.38 -Maximum size of email account name
1.39 -
1.40 -@publishedAll
1.41 -@released
1.42 -*/
1.43 -const TInt KEmailAccountNameSize = 256;
1.44 -
1.45 -/**
1.46 -Maximum number of entries allowed in the IAP list for a SMTP mobility account
1.47 -
1.48 -@publishedPartner
1.49 -@released
1.50 -*/
1.51 -const TInt KMaxSmtpMobilityAccountIAPListEntries = 32;
1.52 -
1.53 -/**
1.54 -Identifier number for a POP email account.
1.55 -
1.56 -@publishedAll
1.57 -@released
1.58 -@see TPopAccount
1.59 -*/
1.60 -typedef TInt TPopAccountId;
1.61 -
1.62 -/**
1.63 -Identifier number for an IMAP email account.
1.64 -
1.65 -@publishedAll
1.66 -@released
1.67 -@see TImapAccount
1.68 -*/
1.69 -typedef TInt TImapAccountId;
1.70 -
1.71 -/**
1.72 -Identifier number for an SMTP email account.
1.73 -
1.74 -@publishedAll
1.75 -@released
1.76 -@see TSmtpAccount
1.77 -*/
1.78 -typedef TInt TSmtpAccountId;
1.79 -
1.80 -/**
1.81 -Identifier number for an SMTP moblity account.
1.82 -
1.83 -@publishedPartner
1.84 -@released
1.85 -*/
1.86 -typedef TInt TSmtpMobilityAccountId;
1.87 -
1.88 -/**
1.89 -Array of IAP values
1.90 -
1.91 -@publishedPartner
1.92 -@released
1.93 -*/
1.94 -typedef RArray<TUint32> RArrayIAP;
1.95 -
1.96 -/**
1.97 -Null or undefined SMTP account identifier
1.98 -
1.99 -@publishedPartner
1.100 -@released
1.101 -*/
1.102 -const TSmtpAccountId KNullSmtpAccountId = 0;
1.103 -
1.104 -/**
1.105 -POP account ID.
1.106 -
1.107 -Objects of this type identify POP email accounts.
1.108 -They are obtained when a POP account is created
1.109 -(CEmailAccounts::CreatePopAccountL()), or by
1.110 -querying for what POP accounts exist
1.111 -(CEmailAccounts::GetPopAccountL() and CEmailAccounts::GetPopAccountsL()).
1.112 -
1.113 -The object is then used as a handle to the account when getting
1.114 -the account settings, using CEmailAccounts::LoadPopSettingsL() and
1.115 -CEmailAccounts::LoadPopIapSettingsL().
1.116 -
1.117 -@publishedAll
1.118 -@released
1.119 -*/
1.120 -class TPopAccount
1.121 - {
1.122 -public:
1.123 - /** POP account identifier number.
1.124 -
1.125 - Each POP account stored on the phone has a different
1.126 - identifier number to distinguish it from other accounts.
1.127 - */
1.128 - TPopAccountId iPopAccountId;
1.129 -
1.130 - /** POP account name. */
1.131 - TBuf<KEmailAccountNameSize> iPopAccountName;
1.132 -
1.133 - /** Entry ID of the POP service for this account. */
1.134 - TMsvId iPopService;
1.135 -
1.136 - /** Entry ID of the related SMTP service for this account.
1.137 -
1.138 - This is set if an SMTP service has been created, using
1.139 - CEmailAccounts::CreateSmtpAccountL(), that specifies that
1.140 - it is related to this account. An SMTP service (which provides
1.141 - email sending functionality) is used in conjunction with
1.142 - a POP or IMAP service (which provide email retrieval).
1.143 - */
1.144 - TMsvId iSmtpService;
1.145 - };
1.146 -
1.147 -/**
1.148 -IMAP account ID.
1.149 -
1.150 -Objects of this type identify IMAP email accounts.
1.151 -They are obtained when a IMAP account is created
1.152 -(CEmailAccounts::CreateImapAccountL()), or by
1.153 -querying for what IMAP accounts exist
1.154 -(CEmailAccounts::GetImapAccountL() and CEmailAccounts::GetImapAccountsL()).
1.155 -
1.156 -The object is then used as a handle to the account when getting
1.157 -the account settings, using CEmailAccounts::LoadImapSettingsL() and
1.158 -CEmailAccounts::LoadImapIapSettingsL().
1.159 -
1.160 -@publishedAll
1.161 -@released
1.162 -*/
1.163 -class TImapAccount
1.164 - {
1.165 -public:
1.166 - /** IMAP account identifier number.
1.167 -
1.168 - Each IMAP account stored on the phone has a different
1.169 - identifier number to distinguish it from other accounts.
1.170 - */
1.171 - TImapAccountId iImapAccountId;
1.172 -
1.173 - /** IMAP account name */
1.174 - TBuf<KEmailAccountNameSize> iImapAccountName;
1.175 -
1.176 - /** Entry ID of the IMAP service for this account. */
1.177 - TMsvId iImapService;
1.178 -
1.179 - /** Entry ID of the related SMTP service for this account.
1.180 -
1.181 - This is set if an SMTP service has been created, using
1.182 - CEmailAccounts::CreateSmtpAccountL(), that specifies that
1.183 - it is related to this account. An SMTP service (which provides
1.184 - email sending functionality) is used in conjunction with
1.185 - a POP or IMAP service (which provide email retrieval).
1.186 - */
1.187 - TMsvId iSmtpService;
1.188 - };
1.189 -
1.190 -/**
1.191 -SMTP account ID.
1.192 -
1.193 -Objects of this type identify SMTP email accounts.
1.194 -They are obtained when a SMTP account is created
1.195 -(CEmailAccounts::CreateSmtpAccountL()), or by
1.196 -querying for what SMTP accounts exist
1.197 -(CEmailAccounts::GetSmtpAccountL() and CEmailAccounts::GetISmtpAccountsL()).
1.198 -
1.199 -The object is then used as a handle to the account when getting
1.200 -the account settings, using CEmailAccounts::LoadSmtpSettingsL() and
1.201 -CEmailAccounts::LoadSmtpIapSettingsL().
1.202 -
1.203 -@publishedAll
1.204 -@released
1.205 -*/
1.206 -class TSmtpAccount
1.207 - {
1.208 -public:
1.209 - /** SMTP account identifier number. */
1.210 - TSmtpAccountId iSmtpAccountId;
1.211 -
1.212 - /** SMTP account name */
1.213 - TBuf<KEmailAccountNameSize> iSmtpAccountName;
1.214 -
1.215 - /** Entry ID of the SMTP service for this account. */
1.216 - TMsvId iSmtpService;
1.217 -
1.218 - /** Entry ID of the related POP or IMAP service for this account.
1.219 -
1.220 - An SMTP service (which provides email sending functionality) is
1.221 - used in conjunction with a POP or IMAP service (which provide email retrieval).
1.222 - */
1.223 - TMsvId iRelatedService;
1.224 - };
1.225 -
1.226 -/**
1.227 -@publishedPartner
1.228 -@released
1.229 -*/
1.230 -class TSmtpMobilityAccount
1.231 - {
1.232 -public:
1.233 - /** SMTP mobility account identifier */
1.234 - TSmtpMobilityAccountId iAccountId;
1.235 -
1.236 - /** SMTP mobility account name */
1.237 - TBuf<KEmailAccountNameSize> iName;
1.238 -
1.239 - /** Parent SMTP account identifier */
1.240 - TSmtpAccountId iParentSmtpAccountId;
1.241 -
1.242 - /** Linked SMTP account identifier. Identifies the SMTP account whose
1.243 - settings will be used by this mobility account. If the mobility account
1.244 - is using its own settings, this will be set to KNullSmtpAccountId. */
1.245 - TSmtpAccountId iLinkedSmtpAccountId;
1.246 - };
1.247 -
1.248 -/**
1.249 -Creates, loads, saves and deletes email (IMAP, POP, and SMTP) accounts.
1.250 -
1.251 -An account encapsulates:
1.252 -
1.253 -- Settings for a messaging service. There is a different type of
1.254 - settings class for each of the email protocols (CImPop3Settings,
1.255 - CImImap4Settings, CImSmtpSettings).
1.256 -- IAP (Internet account) settings for accessing the service.
1.257 -
1.258 -The class has a family of functions for each protocol to create, get,
1.259 -and delete accounts:
1.260 -
1.261 -- Create\<protocol\>AccountL
1.262 -- Get\<protocol\>AccountL
1.263 -- Get\<protocol\>AccountsL
1.264 -- Delete\<protocol\>AccountL
1.265 -
1.266 -where \<protocol\> is either POP, IMAP, or SMTP.
1.267 -The Create and Get functions don't directly return settings
1.268 -objects, but only account identifiers.
1.269 -
1.270 -Account identifiers are passed to the following functions
1.271 -to save and load the service and IAP settings for that account:
1.272 -
1.273 -- Load\<protocol\>SettingsL
1.274 -- Save\<protocol\>SettingsL
1.275 -- Load\<protocol\>IapSettingsL
1.276 -- Save\<protocol\>IapSettingsL
1.277 -
1.278 -For SMTP only, there is a concept of a default account (as a client
1.279 -program may want to send an email, and not care which account is used.)
1.280 -SetDefaultSmtpAccountL(), DefaultSmtpAccountL() and DeleteDefaultSmtpAccountL()
1.281 -are used to handle this.
1.282 -
1.283 -Note that an account is associated with a service entry in the message store,
1.284 -but account information itself is stored in the central repository.
1.285 -
1.286 -@publishedAll
1.287 -@released
1.288 -*/
1.289 -class CEmailAccounts : public CBase, public MMsvSessionObserver
1.290 - {
1.291 -public:
1.292 -
1.293 - IMPORT_C static CEmailAccounts* NewL();
1.294 - IMPORT_C static CEmailAccounts* NewLC();
1.295 - IMPORT_C virtual ~CEmailAccounts();
1.296 -
1.297 - IMPORT_C TPopAccount CreatePopAccountL(const TDesC& aAccountName, const CImPop3Settings& aPopSettings,
1.298 - const CImIAPPreferences& aPopIAP, TBool aReadOnly);
1.299 -
1.300 - IMPORT_C TImapAccount CreateImapAccountL(const TDesC& aAccountName, const CImImap4Settings& aImapSettings,
1.301 - const CImIAPPreferences& aImapIAP, TBool aReadOnly);
1.302 -
1.303 - IMPORT_C TSmtpAccount CreateSmtpAccountL(TPopAccount& aPopAccount, const CImSmtpSettings& aSmtpSettings,
1.304 - const CImIAPPreferences& aSmtpIAP, TBool aReadOnly);
1.305 -
1.306 - IMPORT_C TSmtpAccount CreateSmtpAccountL(TImapAccount& aImapAccount, const CImSmtpSettings& aSmtpSettings,
1.307 - const CImIAPPreferences& aSmtpIAP, TBool aReadOnly);
1.308 -
1.309 - IMPORT_C TSmtpAccount CreateSmtpAccountL(const TDesC& aAccountName, const CImSmtpSettings& aSmtpSettings,
1.310 - const CImIAPPreferences& aSmtpIAP, TBool aReadOnly);
1.311 -
1.312 - IMPORT_C void GetPopAccountsL(RArray<TPopAccount>& aAccounts);
1.313 - IMPORT_C void GetPopAccountL(TMsvId aServiceId, TPopAccount& aAccount);
1.314 - IMPORT_C void DeletePopAccountL(const TPopAccount& aAccount);
1.315 -
1.316 - IMPORT_C void GetImapAccountsL(RArray<TImapAccount>& aAccounts);
1.317 - IMPORT_C void GetImapAccountL(TMsvId aServiceId, TImapAccount& aAccount);
1.318 - IMPORT_C void DeleteImapAccountL(const TImapAccount& aAccount);
1.319 -
1.320 - IMPORT_C void GetSmtpAccountsL(RArray<TSmtpAccount>& aAccounts);
1.321 - IMPORT_C void GetSmtpAccountL(TMsvId aServiceId, TSmtpAccount& aAccount);
1.322 - IMPORT_C void DeleteSmtpAccountL(const TSmtpAccount& aAccount);
1.323 - IMPORT_C void DeleteDefaultSmtpAccountL();
1.324 -
1.325 - IMPORT_C void PopulateDefaultPopSettingsL(CImPop3Settings& aPopSettings,
1.326 - CImIAPPreferences& aPopIap);
1.327 -
1.328 - IMPORT_C void PopulateDefaultImapSettingsL(CImImap4Settings& aImapSettings,
1.329 - CImIAPPreferences& aImapIap);
1.330 -
1.331 - IMPORT_C void PopulateDefaultSmtpSettingsL(CImSmtpSettings& aSmtpSettings,
1.332 - CImIAPPreferences& aSmtpIap);
1.333 -
1.334 - IMPORT_C TInt DefaultSmtpAccountL(TSmtpAccount& aAccount);
1.335 - IMPORT_C void SetDefaultSmtpAccountL(const TSmtpAccount& aAccount);
1.336 -
1.337 - IMPORT_C void LoadPopSettingsL(const TPopAccount& aAccount, CImPop3Settings& aPopSettings);
1.338 - IMPORT_C void LoadPopIapSettingsL(const TPopAccount& aAccount, CImIAPPreferences& aIAP);
1.339 -
1.340 - IMPORT_C void LoadImapSettingsL(const TImapAccount& aAccount, CImImap4Settings& aImapSettings);
1.341 - IMPORT_C void LoadImapIapSettingsL(const TImapAccount& aAccount, CImIAPPreferences& aIAP);
1.342 -
1.343 - IMPORT_C void LoadSmtpSettingsL(const TSmtpAccount& aAccount, CImSmtpSettings& aSmtpSettings);
1.344 - IMPORT_C void LoadSmtpIapSettingsL(const TSmtpAccount& aAccount, CImIAPPreferences& aIAP);
1.345 -
1.346 - IMPORT_C void SavePopSettingsL(const TPopAccount& aAccount, const CImPop3Settings& aPopSettings);
1.347 - IMPORT_C void SavePopIapSettingsL(const TPopAccount& aAccount, const CImIAPPreferences& aIAP);
1.348 -
1.349 - IMPORT_C void SaveImapSettingsL(const TImapAccount& aAccount, const CImImap4Settings& aImapSettings);
1.350 -
1.351 - IMPORT_C void SaveImapIapSettingsL(const TImapAccount& aAccount, const CImIAPPreferences& aIAP);
1.352 -
1.353 - IMPORT_C void SaveSmtpSettingsL(const TSmtpAccount& aAccount, const CImSmtpSettings& aSmtpSettings);
1.354 - IMPORT_C void SaveSmtpIapSettingsL(const TSmtpAccount& aAccount, const CImIAPPreferences& aIAP);
1.355 -
1.356 - IMPORT_C TBool IsAccountReadOnlyL(const TPopAccount& aAccount);
1.357 - IMPORT_C TBool IsAccountReadOnlyL(const TImapAccount& aAccount);
1.358 - IMPORT_C TBool IsAccountReadOnlyL(const TSmtpAccount& aAccount);
1.359 -
1.360 - // Published partner routines
1.361 - IMPORT_C TImapAccount CreateImapAccountL(const TDesC& aAccountName,
1.362 - const CImImap4Settings& aImapSettings, const CImIAPPreferences& aImapIAP,
1.363 - const CImapSyncDownloadRules& aSyncDownloadRules, TBool aReadOnly);
1.364 - IMPORT_C void LoadImapSyncDownloadRulesL(const TImapAccount& aAccount, CImapSyncDownloadRules& aRules);
1.365 - IMPORT_C void LoadImapTransportBufferSizesL(CImapTransportBufferSizes& aBufferSizes);
1.366 - IMPORT_C void SaveImapSyncDownloadRulesL(const TImapAccount& aAccount, const CImapSyncDownloadRules& aRules);
1.367 - IMPORT_C void SaveImapTransportBufferSizesL(const CImapTransportBufferSizes& aBufferSizes);
1.368 - IMPORT_C void DeleteImapTransportBufferSizesL();
1.369 -
1.370 - IMPORT_C void GetSmtpAccountL(TSmtpAccountId aAccountId, TSmtpAccount& aAccount);
1.371 -
1.372 - IMPORT_C TSmtpMobilityAccount CreateSmtpMobilityAccountL(const TDesC& aAccountName, const RArrayIAP& aIapList, const TSmtpAccount& aSmtpAccount, const CImSmtpMobilitySettings& aSettings, TBool aReadOnly);
1.373 - IMPORT_C TSmtpMobilityAccount CreateSmtpMobilityAccountL(const TDesC& aAccountName, const RArrayIAP& aIapList, const TSmtpAccount& aSmtpAccount, const TSmtpAccount& aLinkedSmtpAccount, TBool aReadOnly);
1.374 - IMPORT_C void GetSmtpMobilityAccountsL(const TSmtpAccount& aSmtpAccount, RArray<TSmtpMobilityAccount>& aAccounts);
1.375 - IMPORT_C void DeleteSmtpMobilityAccountL(const TSmtpMobilityAccount& aAccount);
1.376 -
1.377 - IMPORT_C void PopulateDefaultSmtpMobilitySettingsL(CImSmtpMobilitySettings& aSettings);
1.378 - IMPORT_C void LoadSmtpMobilitySettingsL(const TSmtpMobilityAccount& aAccount, CImSmtpMobilitySettings& aSettings);
1.379 - IMPORT_C void SaveSmtpMobilitySettingsL(const TSmtpMobilityAccount& aAccount, const CImSmtpMobilitySettings& aSettings);
1.380 -
1.381 - IMPORT_C void LoadSmtpMobilityAccountIapListL(const TSmtpMobilityAccount& aAccount, RArrayIAP& aIapList);
1.382 - IMPORT_C void SaveSmtpMobilityAccountIapListL(const TSmtpMobilityAccount& aAccount, const RArrayIAP& aIapList);
1.383 -
1.384 - IMPORT_C TBool IsAccountReadOnlyL(const TSmtpMobilityAccount& aAccount);
1.385 -
1.386 - // Internal routines
1.387 - IMPORT_C void GetSmtpMobilityAccountsL(RArray<TSmtpMobilityAccount>& aAccounts);
1.388 - IMPORT_C TBool LoadSmtpMobilitySettingsL(TSmtpAccountId& aSmtpAccountId, TUint32 aIap, CImSmtpMobilitySettings& aSettings);
1.389 -
1.390 -private:
1.391 - CEmailAccounts();
1.392 - void HandleSessionEventL(TMsvSessionEvent , TAny* , TAny* , TAny* );
1.393 - CMsvSession& SessionL();
1.394 - CRepository& PopRepositoryL();
1.395 - CRepository& ImapRepositoryL();
1.396 - CRepository& SmtpRepositoryL();
1.397 -
1.398 - TMsvId CreateEmailServiceL(CMsvEntry& aMsvEntry, const TDesC& aAccountName, TUid aMTMType, TBool aVisible);
1.399 - void SetRelatedIdL(CMsvEntry& aMsvEntry, TMsvId aId, TMsvId aRelatedId);
1.400 - void SetEntryDetailsL(TMsvId aId, const TDesC& aAccountName);
1.401 - void UnSetInPreparationFlagsL(CMsvEntry& aMsvEntry, TMsvId aId, TInt aAccountId);
1.402 - void DeleteServiceEntryL(CMsvEntry& aMsvEntry, TMsvId aId);
1.403 -
1.404 - TUint GetNextEmptyAccountSlotL(CRepository& aRepository);
1.405 - TUint32 FindEmailAccountL(TMsvId aService, CRepository& aRepository);
1.406 -
1.407 - void LoadIAPPrefSettingsL(TUint32 aAccountId, CImIAPPreferences& aIAP, CRepository& aRepository);
1.408 - void DoLoadPopSettingsL(TUint32 aAccountId, CImPop3Settings& aPopSettings);
1.409 - void DoLoadImapSettingsL(TUint32 aAccountId, CImImap4Settings& aImapSettings);
1.410 - void DoLoadSmtpSettingsL(TUint32 aAccountId, CImSmtpSettings& aSmtpSettings);
1.411 -
1.412 - void SaveIAPPrefSettingsL(TUint32 aAccountId, const CImIAPPreferences& aIAP, CRepository& aRepository);
1.413 - void DoSavePopSettingsL(TUint32 aAccountId, const CImPop3Settings& aPopSettings);
1.414 - void DoSaveSmtpSettingsL(TUint32 aAccountId, const CImSmtpSettings& aSmtpSettings);
1.415 - void DoSaveImapSettingsL(TUint32 aAccountId, const CImImap4Settings& aImapSettings);
1.416 - void DoSaveImapSyncDownloadRulesL(TUint32 aAccountId, const CImapSyncDownloadRules& aRules, CRepository& aRepository);
1.417 -
1.418 - TImapAccount CreateImapAccountL(const TDesC& aAccountName, const CImImap4Settings& aImapSettings,
1.419 - const CImIAPPreferences& aImapIAP, const CImapSyncDownloadRules* aSyncDownloadRules, TBool aReadOnly);
1.420 -
1.421 - TUint32 DoCreatePopAccountL(const TDesC& aAccountName, const CImPop3Settings& aPopSettings,
1.422 - const CImIAPPreferences& aPopIAP, TMsvId aPopService, TMsvId aRelatedService, TBool aReadOnly);
1.423 - TUint32 DoCreateImapAccountL(const TDesC& aAccountName, const CImImap4Settings& aImapSettings,
1.424 - const CImIAPPreferences& aImapIAP, const CImapSyncDownloadRules* aSyncDownloadRules, TMsvId aImapService,
1.425 - TMsvId aRelatedService, TBool aReadOnly);
1.426 - TUint32 DoCreateSmtpAccountL(TPopAccount& aPopAccount, const CImSmtpSettings& aSmtpSettings,
1.427 - const CImIAPPreferences& aSmtpIAP, TMsvId aSmtpService, CMsvEntry& aMsvEntry, TUint32& aPopAccountId, TBool aReadOnly);
1.428 - TUint32 DoCreateSmtpAccountL(TImapAccount& aImapAccount, const CImSmtpSettings& aSmtpSettings,
1.429 - const CImIAPPreferences& aSmtpIAP, TMsvId aSmtpService, CMsvEntry& aMsvEntry, TUint32& aImapAccountId, TBool aReadOnly);
1.430 - TUint32 DoCreateSmtpAccountL(const TDesC& aAccountName, const CImSmtpSettings& aSmtpSettings,
1.431 - const CImIAPPreferences& aSmtpIAP, TMsvId aSmtpService, TMsvId aRelatedService, TBool aReadOnly);
1.432 -
1.433 - void DeleteIAPPrefSettingsL(TUint32 aAccountId, CRepository& aRepository);
1.434 - void DeletePopSettings(TUint32 aAccountId, CRepository& aRepository);
1.435 - void DeleteSmtpSettings(TUint32 aAccountId, CRepository& aRepository);
1.436 - void DeleteImapSettings(TUint32 aAccountId, CRepository& aRepository);
1.437 - void DeleteImapSyncDownloadRulesL(TUint32 aAccountId, CRepository& aRepository);
1.438 -
1.439 - void GetEmailServicesL(CMsvEntrySelection& aServices, TUid aMTMType, CMsvEntry& aMsvEntry);
1.440 -
1.441 - TBool IsAsciiPrintable(const TDesC16& aText);
1.442 - TBool IsAsciiPrintable(const TDesC8& aText);
1.443 - TBool IsUnicodePrintable(const TDesC16& aText);
1.444 -
1.445 - TSmtpMobilityAccount DoCreateSmtpMobilityAccountL(const TDesC& aAccountName, const RArrayIAP& aIapList, const CImSmtpMobilitySettings& aSettings, const TSmtpAccount& aSmtpAccount, TSmtpAccountId aLinkedSmtpAccountId, TBool aReadOnly);
1.446 - void AddMobilityAccountToSmtpAccountL(const TSmtpAccount& aSmtpAccount, const RArrayIAP& aIapList, TUint32 aMobAccRepId, CRepository& aRepository);
1.447 - void AddLinkToMobilityAccountL(TSmtpAccountId aLinkedSmtpAccountId, TUint32 aMobAccRepId, CRepository& aRepository);
1.448 - TInt FindIapListEntryInSmtpMobilityAccountListL(const RArrayIAP& aIapList, CRepository& aRepository, TUint32 aSmtpAccRepId, TInt aNumEntries, TInt aIgnorePos);
1.449 - TInt FindAccountIdInSmtpMobilityAccountListL(TUint32 aMobAccRepId, CRepository& aRepository, TUint32 aSmtpAccRepId, TInt aNumEntries);
1.450 - void GetSmtpAccountInfoForMobilityAccountL(TUint32 aMobAccRepId, CRepository& aRepository, TUint32& aSmtpAccRepId, TInt& aPos);
1.451 - void DeleteAllOwnedMobilityAccountsL(TUint32 aSmtpAccRepId, CRepository& aRepository);
1.452 - void DeleteAllLinkedMobilityAccountsL(TUint32 aLinkedSmtpAccRepId, CRepository& aRepository);
1.453 - void DeleteSmtpMobilityAccountListEntryL(TUint32 aMobAccRepId, CRepository& aRepository, TUint32 aSmtpAccRepId);
1.454 - void DeleteSmtpMobilityAccountFromLinkedSmtpAccountL(TUint32 aMobAccRepId, CRepository& aRepository);
1.455 - TBool IsSmtpTypeAccountReadOnlyL(TUint32 aAccRepId);
1.456 - TBool IsSmtpMobilityAccount(CRepository& aRepository, TUint32 aAccRepId);
1.457 -
1.458 -private:
1.459 - enum TEmailSettingTypes
1.460 - {
1.461 - // Partial CenRep Id for service settings
1.462 - EServiceSettingType = 0x00000000,
1.463 - // Partial CenRep Id for IAP Prefs
1.464 - EIAPPrefSettingType = 0x00010000,
1.465 - // CenRep mask for email accounts
1.466 - EAccountMask = 0x800FFFFF
1.467 - };
1.468 -
1.469 - enum TPOPServiceSettingsCenRepId
1.470 - {
1.471 - EPOPServiceId = 0x00000000,
1.472 - EPOPAccountNameId = 0x00000001,
1.473 - EPOPRelatedSMTPServiceId = 0x00000002,
1.474 - EPOPSettingsVersionId = 0x00000003,
1.475 - EPOPServerAddressId = 0x00000004,
1.476 - EPOPPortNumberId = 0x00000005,
1.477 - EPOPFlagsId = 0x00000006,
1.478 - EPOPLoginNameId = 0x00000007,
1.479 - EPOPPasswordId = 0x00000008,
1.480 - EPOPMaxEmailSizeId = 0x00000009,
1.481 - EPOPGetEmailOptionsId = 0x0000000A,
1.482 - EPOPInboxSynchronisationLimitId = 0x0000000B,
1.483 - EPOPPopulationLimitId = 0x0000000C,
1.484 - EPOPReadOnlyAccountId = 0x0000000D,
1.485 - EPOPTlsSslDomainId = 0x0000000F
1.486 - };
1.487 -
1.488 - enum TIMAPServiceSettingsCenRepId
1.489 - {
1.490 - EIMAPServiceId = 0x00000000,
1.491 - EIMAPAccountNameId = 0x00000001,
1.492 - EIMAPRelatedSMTPServiceId = 0x00000002,
1.493 - EIMAPSettingsVersionId = 0x00000003,
1.494 - EIMAPServerAddressId = 0x00000004,
1.495 - EIMAPPortNumberId = 0x00000005,
1.496 - EIMAPFlagsId = 0x00000006,
1.497 - EIMAPLoginNameId = 0x00000007,
1.498 - EIMAPPasswordId = 0x00000008,
1.499 - EIMAPFolderPathId = 0x00000009,
1.500 - EIMAPPathSeparatorId = 0x0000000A,
1.501 - EIMAPSynchronisationStrategyId = 0x0000000B,
1.502 - EIMAPSubscriptionStrategyId = 0x0000000C,
1.503 - EIMAPMaxEmailSizeId = 0x0000000D,
1.504 - EIMAPGetMailOptionsId = 0x0000000E,
1.505 - EIMAPInboxSynchronisationLimitId= 0x0000000F,
1.506 - EIMAPMailboxSynchronisationLimitId= 0x00000010,
1.507 - EIMAPTlsSslDomainId = 0x00000012,
1.508 - EIMAPSyncRateId = 0x00000020,
1.509 - EIMAPFetchSizeId = 0x00000030,
1.510 - EIMAPIdleTimeoutId = 0x00000040,
1.511 - EPartialMailOptionsId = 0x00000050,
1.512 - EBodyTextSizeLimitId = 0x00000060,
1.513 - EAttachmentSizeLimitId = 0x00000070,
1.514 - EIMAPSearchStringId = 0x00000080,
1.515 - EIMAPReadOnlyAccountId = 0x00000090,
1.516 - // 0x00001000 - 0x00002FFF reserved for sync download rules
1.517 - // 0x00010000 - 0x00014FFF reserved for IAP/SNAP preferences
1.518 - };
1.519 -
1.520 - enum TIMAPSyncDownloadRulesCenRepInfo
1.521 - {
1.522 - EIMAPSyncDownloadRulesVersionId = 0x00001000,
1.523 - EIMAPNumInboxSyncDownloadRulesId = 0x00001001,
1.524 - EIMAPNumFolderSyncDownloadRulesId = 0x00001002,
1.525 -
1.526 - EIMAPInboxSyncDownloadRulesBearerTypesId = 0x00001010,
1.527 - EIMAPInboxSyncDownloadRulesMailOptionsId = 0x00001011,
1.528 - EIMAPInboxSyncDownloadRulesTotalSizeLimitId = 0x00001012,
1.529 - EIMAPInboxSyncDownloadRulesBodyTextSizeLimitId = 0x00001013,
1.530 - EIMAPInboxSyncDownloadRulesAttachmentSizeLimitId = 0x00001014,
1.531 - EIMAPInboxSyncDownloadRulesGetMailBodyPartsId = 0x00001015,
1.532 - EIMAPInboxSyncDownloadRulesMaxEmailSizeId = 0x00001016,
1.533 -
1.534 - EIMAPFolderSyncDownloadRulesBearerTypesId = 0x00001030,
1.535 - EIMAPFolderSyncDownloadRulesMailOptionsId = 0x00001031,
1.536 - EIMAPFolderSyncDownloadRulesTotalSizeLimitId = 0x00001032,
1.537 - EIMAPFolderSyncDownloadRulesBodyTextSizeLimitId = 0x00001033,
1.538 - EIMAPFolderSyncDownloadRulesAttachmentSizeLimitId = 0x00001034,
1.539 - EIMAPFolderSyncDownloadRulesGetMailBodyPartsId = 0x00001035,
1.540 - EIMAPFolderSyncDownloadRulesMaxEmailSizeId = 0x00001036,
1.541 -
1.542 - // Offset between sets of rules
1.543 - EIMAPSyncDownloadRulesOffset = 0x40
1.544 - };
1.545 -
1.546 - enum TIAPPreferencesCenRepId
1.547 - {
1.548 - // single settings
1.549 - EIAPPrefVersion = 0x00010000,
1.550 - EIAPChoicesCount = 0x00010001,
1.551 -
1.552 - // List of settings
1.553 - EIAPListIDs = 0x00011000,
1.554 - EIAPListDialogPrefs = 0x00012000,
1.555 - // EIAPSnapId placed here is a deviation from Design doc. Remove comment after a decision is made
1.556 - EIAPSnapId = 0x00014000 // The same value is to be used in all account types
1.557 - };
1.558 -
1.559 - enum TIMAPTransportBufferSizesCenRepInfo
1.560 - {
1.561 - EIMAPTransportBufferSizesVersionId = 0x80000100,
1.562 - EIMAPNumTransportBufferSizesId = 0x80000101,
1.563 -
1.564 - EIMAPTransportBufferSizesBearerTypesId = 0x80000110,
1.565 - EIMAPTransportBufferSizesFetchRequestSizeId = 0x80000111,
1.566 - EIMAPTransportBufferSizesMaxOutstandingFetchResponsesId = 0x80000112,
1.567 -
1.568 - // Offset between entries
1.569 - EIMAPTransportBufferSizesOffset = 0x20
1.570 - };
1.571 -
1.572 - enum TSMTPServiceSettingsCenRepId
1.573 - {
1.574 - ESMTPServiceId = 0x00000000,
1.575 - ESMTPAccountNameId = 0x00000001,
1.576 - ESMTPSettingsVersionId = 0x00000002,
1.577 - ESMTPServerAddressId = 0x00000003,
1.578 - ESMTPPortNumberId = 0x00000004,
1.579 - ESMTPFlagsId = 0x00000005,
1.580 - ESMTPEmailAliasId = 0x00000006,
1.581 - ESMTPEmailAddressId = 0x00000007,
1.582 - ESMTPReplyToAddressId = 0x00000008,
1.583 - ESMTPReceiptAddressId = 0x00000009,
1.584 - ESMTPBodyEncodingId = 0x0000000A,
1.585 - ESMTPDefaultMsgCharSetId = 0x0000000B,
1.586 - ESMTPSendCopyToSelfId = 0x0000000C,
1.587 - ESMTPSendMessageOptionId = 0x0000000D,
1.588 - ESMTPLoginNameId = 0x0000000E,
1.589 - ESMTPPasswordId = 0x0000000F,
1.590 - ESMTPRelatedServiceId = 0x00000010,
1.591 - ESMTPIncludeToCcId = 0x00000011,
1.592 - ESMTPReadOnlyAccountId = 0x00000012,
1.593 - ESMTPParentAccountId = 0x00000013,
1.594 - ESMTPTlsSslDomainId = 0x00000014,
1.595 - ESMTPLinkedAccountId = 0x00000015
1.596 - };
1.597 -
1.598 - enum TSMTPLinkedMobilityAccountListCenRepInfo
1.599 - {
1.600 - ESMTPLinkedMobilityAccountListVersionId = 0x00015000,
1.601 - ESMTPLinkedMobilityAccountListNumEntriesId = 0x00015001,
1.602 - ESMTPLinkedMobilityAccountListEntryId = 0x00015010,
1.603 -
1.604 - // Maximum number of list entries
1.605 - ESMTPLinkedMobilityAccountListMaxEntries = 2048
1.606 - };
1.607 -
1.608 - enum TSMTPMobilityAccountListCenRepInfo
1.609 - {
1.610 - ESMTPMobilityAccountListVersionId = 0x00016000,
1.611 - ESMTPMobilityAccountListNumEntriesId = 0x00016001,
1.612 -
1.613 - ESMTPMobilityAccountListAccountId = 0x00016010,
1.614 - ESMTPMobilityAccountListNumIapsId = 0x00016011,
1.615 - ESMTPMobilityAccountListIapId = 0x00016020,
1.616 -
1.617 - // Offset between entries
1.618 - ESMTPMobilityAccountListOffset = 0x40,
1.619 -
1.620 - // Maximum number of list entries
1.621 - ESMTPMobilityAccountMaxEntries = 32
1.622 - };
1.623 -
1.624 -private:
1.625 - CMsvSession* iMsvSession;
1.626 - CRepository* iPOPRepository;
1.627 - CRepository* iSMTPRepository;
1.628 - CRepository* iIMAPRepository;
1.629 - };
1.630 -
1.631 -#endif // __CEMAILACCOUNTS_H__