epoc32/include/app/pop3set.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 1998-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@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.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
#if !defined (__POP3SET_H__)
williamr@2
    17
#define __POP3SET_H__
williamr@2
    18
williamr@2
    19
 
williamr@2
    20
williamr@2
    21
williamr@2
    22
#include <msvuids.h>
williamr@2
    23
#include <miutset.h>
williamr@2
    24
#include <miut_err.h>
williamr@2
    25
williamr@2
    26
williamr@2
    27
williamr@2
    28
/** Default POP3 server port number. */
williamr@2
    29
const TUint32 KPOP3DefaultPortNumber = 110;
williamr@2
    30
williamr@2
    31
/** @deprecated */
williamr@2
    32
const TInt32 KImPop3SynchroniseAll	 = -1;
williamr@2
    33
williamr@2
    34
/** @deprecated */
williamr@2
    35
const TInt32 KImPop3SynchroniseNone	 = 0;
williamr@2
    36
williamr@2
    37
/**
williamr@2
    38
Specifies which parts of a POP3 message to download. Used when configuring the
williamr@2
    39
POP3 service settings.
williamr@2
    40
williamr@2
    41
@see
williamr@2
    42
CImPop3Settings 
williamr@2
    43
williamr@2
    44
@publishedAll
williamr@2
    45
@released
williamr@2
    46
*/
williamr@2
    47
enum TPop3GetMailOptions
williamr@2
    48
	{
williamr@2
    49
	/** Message headers only. */
williamr@2
    50
	EGetPop3EmailHeaders,
williamr@2
    51
	/** Complete message. */
williamr@2
    52
	EGetPop3EmailMessages
williamr@2
    53
	};			   
williamr@2
    54
williamr@2
    55
williamr@2
    56
class TPop3Progress
williamr@2
    57
/**
williamr@2
    58
Progress information for a POP3 operation. 
williamr@2
    59
williamr@2
    60
@publishedAll
williamr@2
    61
@released
williamr@2
    62
*/
williamr@2
    63
	{
williamr@2
    64
public:
williamr@2
    65
	IMPORT_C TInt ConnectionState() const;
williamr@2
    66
	IMPORT_C TInt ConnectionIAP() const;
williamr@2
    67
williamr@2
    68
public:
williamr@2
    69
	/** Defines types of POP3 operations. */
williamr@2
    70
	enum TPop3ProgressType 
williamr@2
    71
		{
williamr@2
    72
	/** Refreshing view of remote mail box. */
williamr@2
    73
		EPopRefreshing,
williamr@2
    74
	/** Copying messages. */
williamr@2
    75
		EPopCopying,
williamr@2
    76
	/** Deleting messages. */
williamr@2
    77
		EPopDeleting,
williamr@2
    78
	/** Connecting to remote mail box. */
williamr@2
    79
		EPopConnecting,
williamr@2
    80
	/** Internal reorganisation. */
williamr@2
    81
		EPopTidying,
williamr@2
    82
	/** Connected to remote mail box and no current operations. */
williamr@2
    83
		EPopConnectedAndIdle,
williamr@2
    84
	/** Disconnecting from remote mail box. */
williamr@2
    85
		EPopDisconnecting,
williamr@2
    86
	/** Disconnected from remote mail box. */
williamr@2
    87
		EPopDisconnected,
williamr@2
    88
	/** Moving messages. */
williamr@2
    89
		EPopMoving,
williamr@2
    90
	/** Copying new messages. */
williamr@2
    91
		EPopCopyNewMail,
williamr@2
    92
	/** Moving new messages. */
williamr@2
    93
		EPopMoveNewMail,
williamr@2
    94
	/** Copying a selection of messages. */
williamr@2
    95
		EPopCopyMailSelection,
williamr@2
    96
	/** Moving a selection of messages. */
williamr@2
    97
		EPopMoveMailSelection,
williamr@2
    98
	/** Copying all messages. */
williamr@2
    99
		EPopCopyAllMail,
williamr@2
   100
	/** Moving all messages. */
williamr@2
   101
		EPopMoveAllMail,
williamr@2
   102
	/** Populating view of remote mail box. */
williamr@2
   103
		EPopPopulating,
williamr@2
   104
	/** Cancelling all off-line operations. */
williamr@2
   105
		EPopCancellingOfflineOps,
williamr@2
   106
	/** Populating mailbox with top command */
williamr@2
   107
		EPopTopPopulating,
williamr@2
   108
	/** Defines the maximum value for this enumeration. */
williamr@2
   109
		EPopMaxProgressValue=EPopTopPopulating
williamr@2
   110
		};
williamr@2
   111
williamr@2
   112
	/** Type of operation for which progress is being reported. */
williamr@2
   113
	TPop3ProgressType	iPop3Progress;	// holds the progress for a 'super operation'
williamr@2
   114
	/** When in the EPopConnecting state, this member holds the connection 
williamr@2
   115
	stage. Otherwise it holds the total number of messages for the operation. */
williamr@2
   116
	TInt				iTotalMsgs;
williamr@2
   117
	/** Remaining number of messages to process. */
williamr@2
   118
	TInt				iMsgsToProcess;
williamr@2
   119
	/** Number of bytes processed by the operation. */
williamr@2
   120
	TInt				iBytesDone;
williamr@2
   121
	/** When in the EPopConnecting state, this member holds the connection 
williamr@2
   122
	iap value. Otherwise it holds the total number of bytes to progress for the
williamr@2
   123
	operation. */
williamr@2
   124
	TInt				iTotalBytes;
williamr@2
   125
	/** Operation error code. */
williamr@2
   126
	TInt				iErrorCode; // client side needs to be informed of an error
williamr@2
   127
	/** Type of the sub-operation, where a nested operations is occurring. */
williamr@2
   128
	TPop3ProgressType	iPop3SubStateProgress; // holds the progress for the substate of the 'super operation'
williamr@2
   129
	/** Service performing the operation. */
williamr@2
   130
	TMsvId				iServiceId;
williamr@2
   131
	/** The total size of messages to be downloaded. */
williamr@2
   132
	TInt				iTotalSize; // The total size of messages to be downloaded.
williamr@2
   133
	};
williamr@2
   134
williamr@2
   135
williamr@2
   136
class TImPop3GetMailInfo
williamr@2
   137
/**
williamr@2
   138
Use to specify the maximum message size and the destination folder ID for
williamr@2
   139
certain POP3 operations.
williamr@2
   140
williamr@2
   141
@see
williamr@2
   142
CPop3ClientMtm
williamr@2
   143
williamr@2
   144
@publishedAll
williamr@2
   145
@released
williamr@2
   146
*/
williamr@2
   147
	{
williamr@2
   148
public:
williamr@2
   149
	/** Maximum message size for the operation. */
williamr@2
   150
	TInt32		iMaxEmailSize;
williamr@2
   151
	/** ID of the destination folder for the operation. */
williamr@2
   152
	TMsvId		iDestinationFolder;
williamr@2
   153
	};
williamr@2
   154
williamr@2
   155
class TImPop3PopulateOptions
williamr@2
   156
/**
williamr@2
   157
Use to specify the population limit for the POP3 top command
williamr@2
   158
williamr@2
   159
@see
williamr@2
   160
CPop3ClientMtm
williamr@2
   161
williamr@2
   162
@publishedAll
williamr@2
   163
@released
williamr@2
   164
*/
williamr@2
   165
	{
williamr@2
   166
private:
williamr@2
   167
	/** Version of this GetMailInfo class, breaks coding standard by putting a private member at 
williamr@2
   168
	    the beginning to enable unpacking code to check the version before unpacking the rest of the class */
williamr@2
   169
	TInt32	iVersion;
williamr@2
   170
williamr@2
   171
public:
williamr@2
   172
	IMPORT_C TImPop3PopulateOptions();
williamr@2
   173
	IMPORT_C static void UnpackL(const TDesC8& aDesc, TImPop3PopulateOptions &aUnpackTo);
williamr@2
   174
williamr@2
   175
	IMPORT_C TInt MaxEmailSize();
williamr@2
   176
	IMPORT_C void SetMaxEmailSize(TInt aMaxEmailSize);
williamr@2
   177
	IMPORT_C TInt PopulationLimit();
williamr@2
   178
	IMPORT_C void SetPopulationLimit(TInt aPopulationLimit);
williamr@2
   179
	
williamr@2
   180
private:
williamr@2
   181
	/** Maximum message size for the operation. */
williamr@2
   182
	TInt32		iMaxEmailSize;
williamr@2
   183
	/** Population limit for Populate operation, set to -1 for total populate */
williamr@2
   184
	TInt32		iPopulationLimit;
williamr@2
   185
	/** Construction utility function */
williamr@2
   186
	};
williamr@2
   187
williamr@2
   188
williamr@2
   189
class CImPop3Settings : public CImBaseEmailSettings
williamr@2
   190
/**
williamr@2
   191
Run-time configuration settings for POP3.
williamr@2
   192
williamr@2
   193
Messaging clients should use an instance of this class to specify
williamr@2
   194
and retrieve configuration settings that are used by the POP3 service when
williamr@2
   195
executing email operations.  
williamr@2
   196
williamr@2
   197
Service settings such as the user name and password, whether to authenticate
williamr@2
   198
using APOP or plain text, the maximum size of an email to download, and the
williamr@2
   199
maximum number of messages to synchronise can be specified using this class.
williamr@2
   200
Storing and restoring from the message store is also supported.
williamr@2
   201
williamr@2
   202
To use this class to change a setting:
williamr@2
   203
1) Set the current context to the POP3 service entry using CMsvStore.
williamr@2
   204
2) Create an instance of CImPop3Settings and put it on the cleanup stack.
williamr@2
   205
3) Retrieve the existing settings by calling CImPop3Settings::RestoreL().
williamr@2
   206
4) Change the inbox synchronisation limit setting by calling CImPop3Settings::SetInboxSynchronisationLimit().
williamr@2
   207
5) Save the new settings by calling CImPop3Settings::StoreL().
williamr@2
   208
6) Pop and destroy the CImPop3Settings instance.
williamr@2
   209
williamr@2
   210
@see CMsvStore
williamr@2
   211
@publishedAll
williamr@2
   212
@released
williamr@2
   213
*/
williamr@2
   214
	{
williamr@2
   215
public:
williamr@2
   216
	IMPORT_C CImPop3Settings();
williamr@2
   217
	IMPORT_C virtual ~CImPop3Settings();
williamr@2
   218
	IMPORT_C void Reset();
williamr@2
   219
	IMPORT_C const TPtrC8 LoginName() const;
williamr@2
   220
	IMPORT_C void SetLoginNameL(const TDesC8&);
williamr@2
   221
	IMPORT_C const TPtrC8 Password() const;
williamr@2
   222
	IMPORT_C void SetPasswordL(const TDesC8&);
williamr@2
   223
	IMPORT_C TBool AutoSendOnConnect() const;
williamr@2
   224
	IMPORT_C void SetAutoSendOnConnect(TBool aFlag);
williamr@2
   225
	IMPORT_C TBool Apop() const;
williamr@2
   226
	IMPORT_C void SetApop(TBool aFlag);
williamr@2
   227
	IMPORT_C TBool DisconnectedUserMode() const;
williamr@2
   228
	IMPORT_C void SetDisconnectedUserMode(TBool aFlag);
williamr@2
   229
	IMPORT_C TBool DeleteEmailsWhenDisconnecting() const;
williamr@2
   230
	IMPORT_C void SetDeleteEmailsWhenDisconnecting(TBool aFlag);
williamr@2
   231
	IMPORT_C TBool AcknowledgeReceipts() const;
williamr@2
   232
	IMPORT_C void SetAcknowledgeReceipts(TBool aFlag);
williamr@2
   233
	IMPORT_C TInt MaxEmailSize() const;
williamr@2
   234
	IMPORT_C void SetMaxEmailSize(const TInt aMaxEmailSize);
williamr@2
   235
	IMPORT_C TPop3GetMailOptions GetMailOptions() const;
williamr@2
   236
	IMPORT_C void SetGetMailOptions(TPop3GetMailOptions aGetMailOptions);
williamr@2
   237
	IMPORT_C CImPop3Settings& CopyL(const CImPop3Settings& aCImPop3Settings);
williamr@2
   238
	IMPORT_C TBool operator==(const CImPop3Settings& aCImPop3Settings) const;
williamr@2
   239
	IMPORT_C TInt32 InboxSynchronisationLimit() const;
williamr@2
   240
	IMPORT_C void SetInboxSynchronisationLimit(const TInt32 aInboxSyncLimit);
williamr@2
   241
	IMPORT_C TInt32 PopulationLimit() const;
williamr@2
   242
	IMPORT_C void SetPopulationLimitL(const TInt32 aPopulationLimit);
williamr@2
   243
	IMPORT_C void SetTlsSslDomainL(const TDesC8& aDomainName);
williamr@2
   244
	IMPORT_C TPtrC8 TlsSslDomain() const;
williamr@4
   245
#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
williamr@4
   246
	IMPORT_C void SetPOP3Auth(TBool aFlag);
williamr@4
   247
	IMPORT_C TBool POP3Auth() const;
williamr@4
   248
	IMPORT_C void SetFallBack(TBool aFlag);
williamr@4
   249
	IMPORT_C TBool FallBack() const;
williamr@4
   250
#endif
williamr@2
   251
williamr@2
   252
private:
williamr@2
   253
	class TImPop3SettingsExtension
williamr@2
   254
		{
williamr@2
   255
	public:
williamr@2
   256
		inline TImPop3SettingsExtension();
williamr@2
   257
	public:
williamr@2
   258
		HBufC8* iLoginName;
williamr@2
   259
		HBufC8* iPassword;
williamr@2
   260
		HBufC8* iTlsSslDomain;
williamr@2
   261
		TInt32 iPopulationLimit;
williamr@2
   262
		};
williamr@2
   263
	inline TImPop3SettingsExtension* Extension() const;
williamr@2
   264
	inline void CheckExtensionExistsL();
williamr@2
   265
williamr@2
   266
	enum TImPop3EmailSettings
williamr@2
   267
		{
williamr@2
   268
		KPop3SettingsClearFlag					= 0x00000000,
williamr@2
   269
		KPop3BaseEmailSettingsLastUsedFlag		= CImBaseEmailSettings::EBaseEmailSettingsLastUsedFlag,	//0x00000002
williamr@2
   270
		KPop3ApopFlag							= KPop3BaseEmailSettingsLastUsedFlag << 1,		//0x00000004
williamr@2
   271
		KPop3AutoSendFlag						= KPop3ApopFlag << 1,							//0x00000008
williamr@2
   272
		KPop3DisconnectedModeFlag				= KPop3AutoSendFlag << 1,						//0x00000010
williamr@2
   273
		KPop3DeleteEmailsWhenDisconnectingFlag	= KPop3DisconnectedModeFlag << 1,				//0x00000020
williamr@2
   274
		KPop3AcknowledgeReceipts				= KPop3DeleteEmailsWhenDisconnectingFlag << 1,	//0x00000040
williamr@4
   275
#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)		
williamr@4
   276
		KPop3AuthFlag							= KPop3AcknowledgeReceipts << 1,				//0x00000080
williamr@4
   277
		KPop3FallbackFlag						= KPop3AuthFlag << 1,							//0x00000100
williamr@4
   278
		KPop3EmailSettingsLastUsedFlag			= KPop3FallbackFlag								//0x00000100
williamr@4
   279
#else		
williamr@2
   280
		KPop3EmailSettingsLastUsedFlag			= KPop3AcknowledgeReceipts						//0x00000040
williamr@4
   281
#endif		
williamr@2
   282
		};
williamr@2
   283
williamr@2
   284
	TImPop3SettingsExtension*	iExtension; // renamed iReceiptAddress
williamr@2
   285
	TInt32  iInboxSyncLimit;
williamr@2
   286
	TInt32	iMaxEmailSize;
williamr@2
   287
	TPop3GetMailOptions iGetMailOptions;
williamr@2
   288
	};
williamr@2
   289
williamr@2
   290
inline CImPop3Settings::TImPop3SettingsExtension* CImPop3Settings::Extension() const
williamr@2
   291
	{
williamr@2
   292
	return iExtension;
williamr@2
   293
	}
williamr@2
   294
williamr@2
   295
inline void CImPop3Settings::CheckExtensionExistsL()
williamr@2
   296
	{
williamr@2
   297
	if (!iExtension)
williamr@2
   298
		iExtension=new (ELeave) CImPop3Settings::TImPop3SettingsExtension;
williamr@2
   299
	}
williamr@2
   300
williamr@2
   301
inline CImPop3Settings::TImPop3SettingsExtension::TImPop3SettingsExtension() : iLoginName(NULL) , iPassword(NULL), iTlsSslDomain(NULL)
williamr@2
   302
	{
williamr@2
   303
	}
williamr@2
   304
williamr@2
   305
#endif // #define __POP3SET_H__