epoc32/include/iapprefs.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef IAPPrefs__
williamr@2
    17
#define IAPPrefs__
williamr@2
    18
williamr@2
    19
 
williamr@2
    20
williamr@2
    21
williamr@2
    22
#include <e32base.h>
williamr@2
    23
#include <msvapi.h>
williamr@2
    24
#include <msvuids.h>
williamr@2
    25
#include <cdbcols.h>
williamr@2
    26
williamr@2
    27
// Note: Version 1 = EPOC6.1
williamr@2
    28
//		 Version 2 = EPOC6.2 / Hurricane
williamr@2
    29
const TInt KImIAPPreferencesVersion = 2;	// identify which version of this class has been stored
williamr@2
    30
williamr@2
    31
// for builds which don't define it.
williamr@2
    32
/*
williamr@2
    33
enum TCommDbDialogPref
williamr@2
    34
	{
williamr@2
    35
	ECommDbDialogPrefUnknown =0,
williamr@2
    36
	ECommDbDialogPrefPrompt,
williamr@2
    37
	ECommDbDialogPrefWarn,
williamr@2
    38
	ECommDbDialogPrefDoNotPrompt
williamr@2
    39
	};
williamr@2
    40
*/
williamr@2
    41
williamr@2
    42
class TImIAPChoice
williamr@2
    43
/** Sets the connection dialog preference to be used with a particular IAP used 
williamr@2
    44
for an internet mail service.
williamr@2
    45
williamr@2
    46
The connection control component (GenConn) allows various options for whether 
williamr@2
    47
or not the user should be should be prompted with a dialog at connect time. 
williamr@2
    48
For example, a connection using the first choice GPRS IAP might not show a 
williamr@2
    49
dialog, but a second choice connection using GSM might bring up a warning. 
williamr@2
    50
@publishedAll
williamr@2
    51
@released
williamr@2
    52
*/
williamr@2
    53
	{
williamr@2
    54
	public:
williamr@2
    55
	/** The IAP identifier, as specified in the CommDb record for the IAP. */
williamr@2
    56
	TUint32	iIAP;
williamr@2
    57
	/** Preference for what type of dialog is shown before a connection is made using 
williamr@2
    58
	the specified IAP. */
williamr@2
    59
	TCommDbDialogPref iDialogPref;
williamr@2
    60
	};
williamr@2
    61
williamr@2
    62
class CImIAPPreferences : public CBase
williamr@2
    63
/** Encapsulates preferences relating to IAPs for an email service.
williamr@2
    64
williamr@2
    65
An IAP defines all of the variable factors that determine how an Internet 
williamr@2
    66
connection is made. These variable factors can include the bearer (CDMA, GSM 
williamr@2
    67
or GPRS), dial-in number. network login names and passwords. 
williamr@2
    68
williamr@2
    69
The Comms Database is capable of storing details of several IAPs, which can 
williamr@2
    70
then be used to initiate different types of connection. The database also 
williamr@2
    71
stores the preference order of the IAPs: this defines which IAP should be 
williamr@2
    72
used as the first choice, and also an optional second choice to be used if 
williamr@2
    73
the first choice is not available.
williamr@2
    74
williamr@2
    75
The CImIAPPreferences class associates a first choice, and optionally a second 
williamr@2
    76
choice IAP to use with a particular email service. The preference object is 
williamr@2
    77
stored in the service entry's message store.
williamr@2
    78
williamr@2
    79
For SMTP, if no object has been stored in the service, then the SMTP client 
williamr@2
    80
will attempt to use any default Internet settings in the Comms Database, or 
williamr@2
    81
will use the existing Internet connection if one does already exist. Note 
williamr@2
    82
that SMTP sessions will normally fail to send any email messages if the SMTP 
williamr@2
    83
session is not created using an IAP which the SMTP server does not accept.
williamr@2
    84
williamr@2
    85
Note that in Symbian OS v6.0 a single IAP was associated with an email service 
williamr@2
    86
entry through the iMtmData1 field. 
williamr@2
    87
@publishedAll
williamr@2
    88
@released
williamr@2
    89
*/
williamr@2
    90
	{
williamr@2
    91
	public:
williamr@2
    92
		IMPORT_C static CImIAPPreferences* NewLC();
williamr@2
    93
		IMPORT_C TInt Version() const;
williamr@2
    94
		IMPORT_C TInt NumberOfIAPs() const;
williamr@2
    95
		IMPORT_C TImIAPChoice IAPPreference(TInt aPreference) const;
williamr@2
    96
		IMPORT_C void AddIAPL(TImIAPChoice aIap, TInt aIndex=0);
williamr@2
    97
		IMPORT_C void RemoveIAPL(TInt aPreferenceNumber);
williamr@2
    98
		IMPORT_C TInt FindIAPL(TUint32 aIAP, TInt &aLocation) const;
williamr@2
    99
		IMPORT_C void ReplaceIAPL(TInt aPreferenceNumber,TImIAPChoice aIap);
williamr@2
   100
		IMPORT_C ~CImIAPPreferences();
williamr@2
   101
		IMPORT_C TBool SNAPDefined() const;
williamr@2
   102
		IMPORT_C TUint32 SNAPPreference() const;
williamr@2
   103
		IMPORT_C void SetSNAPL(TUint32 aSnap);
williamr@2
   104
		IMPORT_C void RemoveSNAP();
williamr@2
   105
		
williamr@2
   106
		void Reset();
williamr@2
   107
		
williamr@2
   108
		// class constants
williamr@2
   109
		/**
williamr@2
   110
		@deprecated 
williamr@2
   111
		*/
williamr@2
   112
		enum 
williamr@2
   113
			{
williamr@2
   114
			KSanityCheckOldWins = 0xEFBEADDE,
williamr@2
   115
			KSanityCheck = 0xDEADBEEF
williamr@2
   116
			};
williamr@2
   117
		/** ID of the stream used to store IAP preference information in a 
williamr@2
   118
		message store. */
williamr@2
   119
		const static TUid KUidMsgFileInternetAccessPreferences;
williamr@2
   120
	private:
williamr@2
   121
		CArrayFixFlat<TImIAPChoice>* iChoices;
williamr@2
   122
		TInt iVersion;
williamr@2
   123
		TUint32 iSnapId;
williamr@2
   124
	private:
williamr@2
   125
		CImIAPPreferences();
williamr@2
   126
		CImIAPPreferences(CImIAPPreferences& aOther); // not implemented
williamr@2
   127
		int operator=(CImIAPPreferences& aOther); // not implemented
williamr@2
   128
		void ConstructL();
williamr@2
   129
		void Panic(int err) const;
williamr@2
   130
	};
williamr@2
   131
williamr@2
   132
#endif