1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
27 // Note: Version 1 = EPOC6.1
28 // Version 2 = EPOC6.2 / Hurricane
29 const TInt KImIAPPreferencesVersion = 2; // identify which version of this class has been stored
31 // for builds which don't define it.
33 enum TCommDbDialogPref
35 ECommDbDialogPrefUnknown =0,
36 ECommDbDialogPrefPrompt,
37 ECommDbDialogPrefWarn,
38 ECommDbDialogPrefDoNotPrompt
43 /** Sets the connection dialog preference to be used with a particular IAP used
44 for an internet mail service.
46 The connection control component (GenConn) allows various options for whether
47 or not the user should be should be prompted with a dialog at connect time.
48 For example, a connection using the first choice GPRS IAP might not show a
49 dialog, but a second choice connection using GSM might bring up a warning.
55 /** The IAP identifier, as specified in the CommDb record for the IAP. */
57 /** Preference for what type of dialog is shown before a connection is made using
59 TCommDbDialogPref iDialogPref;
62 class CImIAPPreferences : public CBase
63 /** Encapsulates preferences relating to IAPs for an email service.
65 An IAP defines all of the variable factors that determine how an Internet
66 connection is made. These variable factors can include the bearer (CDMA, GSM
67 or GPRS), dial-in number. network login names and passwords.
69 The Comms Database is capable of storing details of several IAPs, which can
70 then be used to initiate different types of connection. The database also
71 stores the preference order of the IAPs: this defines which IAP should be
72 used as the first choice, and also an optional second choice to be used if
73 the first choice is not available.
75 The CImIAPPreferences class associates a first choice, and optionally a second
76 choice IAP to use with a particular email service. The preference object is
77 stored in the service entry's message store.
79 For SMTP, if no object has been stored in the service, then the SMTP client
80 will attempt to use any default Internet settings in the Comms Database, or
81 will use the existing Internet connection if one does already exist. Note
82 that SMTP sessions will normally fail to send any email messages if the SMTP
83 session is not created using an IAP which the SMTP server does not accept.
85 Note that in Symbian OS v6.0 a single IAP was associated with an email service
86 entry through the iMtmData1 field.
92 IMPORT_C static CImIAPPreferences* NewLC();
93 IMPORT_C TInt Version() const;
94 IMPORT_C TInt NumberOfIAPs() const;
95 IMPORT_C TImIAPChoice IAPPreference(TInt aPreference) const;
96 IMPORT_C void AddIAPL(TImIAPChoice aIap, TInt aIndex=0);
97 IMPORT_C void RemoveIAPL(TInt aPreferenceNumber);
98 IMPORT_C TInt FindIAPL(TUint32 aIAP, TInt &aLocation) const;
99 IMPORT_C void ReplaceIAPL(TInt aPreferenceNumber,TImIAPChoice aIap);
100 IMPORT_C ~CImIAPPreferences();
101 IMPORT_C TBool SNAPDefined() const;
102 IMPORT_C TUint32 SNAPPreference() const;
103 IMPORT_C void SetSNAPL(TUint32 aSnap);
104 IMPORT_C void RemoveSNAP();
114 KSanityCheckOldWins = 0xEFBEADDE,
115 KSanityCheck = 0xDEADBEEF
117 /** ID of the stream used to store IAP preference information in a
119 const static TUid KUidMsgFileInternetAccessPreferences;
121 CArrayFixFlat<TImIAPChoice>* iChoices;
126 CImIAPPreferences(CImIAPPreferences& aOther); // not implemented
127 int operator=(CImIAPPreferences& aOther); // not implemented
129 void Panic(int err) const;