epoc32/include/msvstd.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) 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@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 __MSVSTD_H__
williamr@2
    17
#define __MSVSTD_H__
williamr@2
    18
williamr@2
    19
 
williamr@2
    20
williamr@2
    21
williamr@2
    22
#include <e32base.h>
williamr@2
    23
#include <s32file.h>
williamr@2
    24
williamr@2
    25
/**
williamr@2
    26
Specifies an entry in the Message Server index.
williamr@2
    27
@publishedAll
williamr@2
    28
@released
williamr@2
    29
@see #KMsvNullIndexEntryId
williamr@2
    30
@see #KMsvTempIndexEntryId
williamr@2
    31
@see #KMsvRootIndexEntryId
williamr@2
    32
@see #KMsvLocalServiceIndexEntryId
williamr@2
    33
@see #KMsvGlobalInBoxIndexEntryId
williamr@2
    34
@see #KMsvGlobalOutBoxIndexEntryId
williamr@2
    35
@see #KMsvDraftEntryId
williamr@2
    36
@see #KMsvSentEntryId
williamr@2
    37
@see #KMsvDeletedEntryFolderEntryId
williamr@2
    38
@see #KMsvUnknownServiceIndexEntryId
williamr@2
    39
*/
williamr@2
    40
typedef TInt32 TMsvId;
williamr@2
    41
williamr@2
    42
/** Identifies an asynchronous messaging operation. 
williamr@2
    43
williamr@2
    44
This ID is unique within a 
williamr@2
    45
Message Server session. The ID of an operation can be obtained from CMsvOperation::Id(). */
williamr@2
    46
typedef TInt32 TMsvOp;
williamr@2
    47
williamr@2
    48
/** Supplies the standard values for the message priority index entry field. 
williamr@2
    49
@publishedAll
williamr@2
    50
@released
williamr@2
    51
*/
williamr@2
    52
enum TMsvPriority {	
williamr@2
    53
	/** High message priority */
williamr@2
    54
					EMsvHighPriority,
williamr@2
    55
	/** Medium message priority */
williamr@2
    56
					EMsvMediumPriority,
williamr@2
    57
	/** Low message priority */
williamr@2
    58
					EMsvLowPriority};	
williamr@2
    59
williamr@2
    60
class CRichText;
williamr@2
    61
class CMsvStore;
williamr@2
    62
class CMsvEntry;
williamr@2
    63
class CMsvMove;
williamr@2
    64
class CMsvServer;
williamr@2
    65
class CMsvServerEntry;
williamr@2
    66
williamr@2
    67
_LIT(KMsvDefaultFolder, "\\Private\\1000484b\\Mail\\");
williamr@2
    68
_LIT(KMsvDefaultIndexFile, "\\Private\\1000484b\\Mail\\Index");
williamr@2
    69
_LIT(KMsvDefaultFolder2, "\\Private\\1000484b\\Mail2\\");
williamr@2
    70
_LIT(KMsvDefaultIndexFile2, "\\Private\\1000484b\\Mail2\\Index");
williamr@2
    71
_LIT(KMsvDirectoryExt, "_S\\");
williamr@2
    72
_LIT(KMsvBinaryFolderExt, "_F\\");
williamr@2
    73
williamr@2
    74
const TInt KFileNameFixedWidth=8;
williamr@2
    75
const TInt KMaxSubjectSkipStringLength=8; // For subject based email thread sorting
williamr@2
    76
_LIT(KSendAsRenderedImage, "Image");
williamr@2
    77
williamr@2
    78
// Server name and moving semaphore
williamr@2
    79
_LIT(KMsvServerName, "!MsvServer");
williamr@2
    80
_LIT(KMsvMovingSemaphore, "MsvMovingSemaphore");
williamr@2
    81
williamr@2
    82
_LIT_SECURE_ID(KMsvServerId, 0x1000484B);
williamr@2
    83
williamr@2
    84
williamr@2
    85
/** Represents an entry in the Message Server index.
williamr@2
    86
williamr@2
    87
MTM implementations and message client applications use it to access and manipulate 
williamr@2
    88
index entry values. Note that a TMsvEntry is effectively a local cache of 
williamr@2
    89
the index entry, and changes to it are not automatically written into the 
williamr@2
    90
index. To commit changes to the Message Server, you need to call CMsvEntry::ChangeL() 
williamr@2
    91
(or CMsvServerEntry::ChangeEntry()).
williamr@2
    92
williamr@2
    93
To avoid repetition, the functions and data members are simply listed here, 
williamr@2
    94
without detailed explanation of the fields. The public data members can be 
williamr@2
    95
used to get and set the values of some index entry fields. 
williamr@2
    96
@publishedAll
williamr@2
    97
@released
williamr@2
    98
*/
williamr@2
    99
class TMsvEntry
williamr@2
   100
	{
williamr@2
   101
public: 
williamr@2
   102
	IMPORT_C TMsvEntry(); 
williamr@2
   103
	IMPORT_C TMsvEntry(const TMsvEntry& aEntry);
williamr@2
   104
	IMPORT_C TMsvEntry& operator=(const TMsvEntry& aEntry);
williamr@2
   105
	IMPORT_C TBool operator==(const TMsvEntry& aEntry) const;
williamr@2
   106
	IMPORT_C TBool PermanentDataUnchanged(const TMsvEntry& aEntry) const;
williamr@2
   107
	//
williamr@2
   108
	IMPORT_C TMsvPriority Priority() const;
williamr@2
   109
	IMPORT_C void SetPriority(TMsvPriority aPriority);
williamr@2
   110
	// 
williamr@2
   111
	IMPORT_C void InternalizeL(RReadStream& aStream);
williamr@2
   112
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   113
	// Read only for clients
williamr@2
   114
	inline TMsvId Id() const;
williamr@2
   115
	inline TMsvId Parent() const;
williamr@2
   116
	inline TBool Owner() const;
williamr@2
   117
	inline TBool Deleted() const;
williamr@2
   118
	// Read & write for clients
williamr@2
   119
	inline TBool Complete() const;
williamr@2
   120
	inline void SetComplete(TBool aComplete);
williamr@2
   121
	inline TBool New() const;
williamr@2
   122
	inline void SetNew(TBool aNew);
williamr@2
   123
	inline TBool Unread() const;
williamr@2
   124
	inline void SetUnread(TBool aUnread);
williamr@2
   125
	inline TBool Failed() const;
williamr@2
   126
	inline void SetFailed(TBool aFailed);
williamr@2
   127
	inline TBool Operation() const;
williamr@2
   128
	inline void SetOperation(TBool aOperation);
williamr@2
   129
	inline TBool Visible() const;
williamr@2
   130
	inline void SetVisible(TBool aVisble);
williamr@2
   131
	inline TBool MultipleRecipients() const;
williamr@2
   132
	inline void SetMultipleRecipients(TBool aMultipleRecipient);
williamr@2
   133
	inline TBool ReadOnly() const;
williamr@2
   134
	inline void SetReadOnly(TBool aReadOnly);
williamr@2
   135
	inline TBool StandardFolder() const;
williamr@2
   136
	inline void SetStandardFolder(TBool aStanardFolder);
williamr@2
   137
	inline TBool Attachment() const;
williamr@2
   138
	inline void SetAttachment(TBool aAttachmentFlag);
williamr@2
   139
	inline TBool Connected() const;
williamr@2
   140
	inline void SetConnected(TBool aConnected);
williamr@2
   141
	inline TBool InPreparation() const;
williamr@2
   142
	inline void SetInPreparation(TBool aInPreparation);
williamr@2
   143
	//
williamr@2
   144
	inline TInt PcSyncCount() const;
williamr@2
   145
	inline void DecPcSyncCount();
williamr@2
   146
	inline void IncPcSyncCount();
williamr@2
   147
	//
williamr@2
   148
	inline TBool OffPeak() const;
williamr@2
   149
	inline void SetOffPeak(TBool aOffPeak);
williamr@2
   150
	inline TBool Scheduled() const;
williamr@2
   151
	inline void SetScheduled(TBool aScheduled);
williamr@2
   152
	inline TUint SendingState() const;
williamr@2
   153
	inline void SetSendingState(TUint aSendingState);
williamr@2
   154
	inline TBool PendingDelete() const;
williamr@2
   155
	inline void SetPendingDelete(TBool aPendingDelete);
williamr@2
   156
	
williamr@2
   157
	/** This method sets bit 24 of iMtmData1, if you are using this bit elsewhere don't call this method.*/
williamr@2
   158
	inline void SetDeleteProtected(TBool aDeleteProtected);
williamr@2
   159
	inline TBool DeleteProtected() const;
williamr@2
   160
	/** This method sets bit 31 of iMtmData1, if you are using this bit elsewhere don't call this method.*/
williamr@2
   161
	inline void SetForwarded(TBool aForwarded);
williamr@2
   162
	inline TBool Forwarded() const;
williamr@2
   163
	/** This method sets bit 32 of iMtmData1, if you are using this bit elsewhere don't call this method.*/
williamr@2
   164
	inline void SetLocallyDeleted(TBool aLocallyDeleted);
williamr@2
   165
	inline TBool LocallyDeleted() const;
williamr@2
   166
	
williamr@2
   167
	IMPORT_C TBool PendingConditions() const;
williamr@2
   168
	IMPORT_C void SetPendingConditions(TBool aPendingConditions);
williamr@2
   169
	//
williamr@2
   170
	IMPORT_C TInt32 MtmData1() const;
williamr@2
   171
	IMPORT_C TInt32 MtmData2() const;
williamr@2
   172
	IMPORT_C TInt32 MtmData3() const;
williamr@2
   173
	
williamr@2
   174
	/** 
williamr@2
   175
	@internalTechnology
williamr@2
   176
	*/
williamr@2
   177
	IMPORT_C void SetMtmData1(TInt32 aMtmData);
williamr@2
   178
	/** 
williamr@2
   179
	@internalTechnology
williamr@2
   180
	*/
williamr@2
   181
	IMPORT_C void SetMtmData2(TInt32 aMtmData);
williamr@2
   182
	/** 
williamr@2
   183
	@internalTechnology
williamr@2
   184
	*/
williamr@2
   185
	IMPORT_C void SetMtmData3(TInt32 aMtmData);
williamr@2
   186
	//
williamr@2
   187
protected:
williamr@2
   188
	// only the server will be able to set the following
williamr@2
   189
	inline void SetId(TMsvId aId);
williamr@2
   190
	inline void SetParent(TMsvId aId);
williamr@2
   191
	inline void SetOwner(TBool aAttachment);
williamr@2
   192
	inline void SetDeleted(TBool aDeletedFlag);
williamr@2
   193
	//
williamr@2
   194
	inline TUint PersistedFlags() const;
williamr@2
   195
	inline TUint TemporaryFlags() const;
williamr@2
   196
	//
williamr@2
   197
private:
williamr@2
   198
	void Copy(const TMsvEntry& aEntry);
williamr@2
   199
	//
williamr@2
   200
private:
williamr@2
   201
	TMsvId iId;
williamr@2
   202
	TMsvId iParentId;  
williamr@2
   203
	TInt32 iData;         
williamr@2
   204
	TInt32 iPcSyncCount;
williamr@2
   205
	TInt32 iReserved; // reserved for future proofing
williamr@2
   206
public: 
williamr@2
   207
	/** Service ID. */
williamr@2
   208
	TMsvId iServiceId; 
williamr@2
   209
	/** Related folder ID. */
williamr@2
   210
	TMsvId iRelatedId; 
williamr@2
   211
	/** Entry type */
williamr@2
   212
	TUid   iType;        
williamr@2
   213
	/** MTM */
williamr@2
   214
	TUid   iMtm;     
williamr@2
   215
	/** Time */
williamr@2
   216
	TTime  iDate;       
williamr@2
   217
	/** Size */
williamr@2
   218
	TInt32 iSize;      
williamr@2
   219
	/** Error */
williamr@2
   220
	TInt32 iError;
williamr@2
   221
	/** BIO message type */
williamr@2
   222
	TInt32 iBioType;
williamr@2
   223
	// following three can be used by MTM
williamr@2
   224
	/** MTM data 1: this can be used for any purpose by an MTM. This member must 
williamr@2
   225
	only be accessed through the predefined set and get functions. If you must 
williamr@2
   226
	write data to a bit that has no meaning in the predefined derived classes 
williamr@2
   227
	then you must derive your own class from TMsvEntry.
williamr@2
   228
	*/
williamr@2
   229
	TInt32 iMtmData1; 
williamr@2
   230
	/** MTM data 2: this can be used for any purpose by an MTM. This member must 
williamr@2
   231
	only be accessed through the predefined set and get functions. If you must 
williamr@2
   232
	write data to a bit that has no meaning in the predefined derived classes 
williamr@2
   233
	then you must derive your own class from TMsvEntry.
williamr@2
   234
	*/
williamr@2
   235
	TInt32 iMtmData2; 
williamr@2
   236
	/** MTM data 3: this can be used for any purpose by an MTM. This member must 
williamr@2
   237
	only be accessed through the predefined set and get functions. If you must 
williamr@2
   238
	write data to a bit that has no meaning in the predefined derived classes 
williamr@2
   239
	then you must derive your own class from TMsvEntry.
williamr@2
   240
	*/
williamr@2
   241
	TInt32 iMtmData3; 
williamr@2
   242
public:
williamr@2
   243
	// The TPtrC must be kept at end of class to simplify comparisons and initialisation
williamr@2
   244
	/** Description */
williamr@2
   245
	TPtrC iDescription;
williamr@2
   246
	/** Details */
williamr@2
   247
	TPtrC iDetails;    
williamr@2
   248
	//
williamr@2
   249
	//
williamr@2
   250
private:
williamr@2
   251
	//
williamr@2
   252
friend class CMsvEntry;
williamr@2
   253
friend class CMsvServer;
williamr@2
   254
friend class CMsvServerEntry;
williamr@2
   255
friend class CMsvClientEntry;
williamr@2
   256
friend class CMsvServerSession;
williamr@2
   257
friend class TMsvServerEntry; 
williamr@2
   258
friend class CMsvServerIndex;
williamr@2
   259
friend class RMsvServerSession;
williamr@2
   260
friend class CMsvLocalCopyOperation;
williamr@2
   261
friend class CMsvMove;
williamr@2
   262
friend class CMsvIndexRebuild;
williamr@2
   263
friend class CMsvCopyEntry;
williamr@2
   264
friend class CMsvDelete;
williamr@2
   265
friend class CMsvIndexContext;
williamr@2
   266
friend class CMsvEntryArray;
williamr@2
   267
	//
williamr@2
   268
private:
williamr@2
   269
	//
williamr@2
   270
enum {	KMsvEntryPriorityMask=			0x00000003,
williamr@2
   271
		KMsvEntryHighPriority=			0x00000002,
williamr@2
   272
		KMsvEntryMediumPriority=		0x00000001,
williamr@2
   273
		KMsvEntryLowPriority=			0x00000000,
williamr@2
   274
		KMsvEntryClearFlag=				0x00000000,
williamr@2
   275
		KMsvOffPeakFlag=				0x00000004,
williamr@2
   276
		KMsvEntryNotCompleteFlag=		0x00000008,
williamr@2
   277
		KMsvEntryNewFlag=				0x00000010,
williamr@2
   278
		KMsvEntryUnreadFlag=			0x00000020,
williamr@2
   279
		KMsvEntryFailedFlag=			0x00000040,
williamr@2
   280
		KMsvEntryOperationFlag=			0x00000080,
williamr@2
   281
		KMsvEntryOwnerFlag=				0x00000100,
williamr@2
   282
		KMsvEntryInvisibleFlag=			0x00000200,
williamr@2
   283
		KMsvEntryMultipleRecipientFlag=	0x00000400,
williamr@2
   284
		KMsvScheduledFlag=				0x00000800,
williamr@2
   285
		KMsvEntryReadOnlyFlag=			0x00001000,
williamr@2
   286
		KMsvEntryDeletedFlag=			0x00002000,
williamr@2
   287
		KMsvEntryStandardFolderFlag=	0x00004000,
williamr@2
   288
		KMsvEntryAttachmentFlag=		0x00008000,
williamr@2
   289
		KMsvEntryInPreparationFlag=		0x00010000,
williamr@2
   290
		KMsvSendingStateFlags=			0x001E0000, // Note: Sending state is shifted KMsvSendingStateShift places left
williamr@2
   291
		KMsvEntryPersistedFlags=		0x00FFFFFF,
williamr@2
   292
		KMsvEntryPendingConditionsFlag=	0x00800000,		
williamr@2
   293
		KMsvEntryTemporaryFlags=		0xFF000000,
williamr@2
   294
		KMsvEntryConnectedFlag=			0x01000000,
williamr@2
   295
		KMsvEntryPendingDeleteFlag=		0x02000000};
williamr@2
   296
	};
williamr@2
   297
enum 
williamr@2
   298
	{
williamr@2
   299
		KMsvEntryDeleteProtected=		0x800000,
williamr@2
   300
		KMsvEntryForwarded=				0x40000000,
williamr@2
   301
		KMsvEntryLocallyDeleted=		0x80000000
williamr@2
   302
	};
williamr@2
   303
williamr@2
   304
const TUint KMsvSendingStateShift=0x11; // Places to shift sending state
williamr@2
   305
williamr@2
   306
/** Defines sending state flags. 
williamr@2
   307
@publishedAll
williamr@2
   308
@released
williamr@2
   309
*/
williamr@2
   310
enum TMsvSendState
williamr@2
   311
	{
williamr@2
   312
	/** State unknown. */
williamr@2
   313
	KMsvSendStateUnknown		= 0x0,
williamr@2
   314
	/** Message will be sent on request. */
williamr@2
   315
	KMsvSendStateUponRequest	= 0x1,
williamr@2
   316
	/** Waiting to be sent.
williamr@2
   317
	
williamr@2
   318
	Messages in the outbox with this state can be sent automatically by the relevant 
williamr@2
   319
	MTM once an appropriate connection is established. */
williamr@2
   320
	KMsvSendStateWaiting		= 0x2,
williamr@2
   321
	/** Sending in progress. */
williamr@2
   322
	KMsvSendStateSending		= 0x3,
williamr@2
   323
	/** Sending scheduled. */
williamr@2
   324
	KMsvSendStateScheduled		= 0x4,
williamr@2
   325
	/** Resending. */
williamr@2
   326
	KMsvSendStateResend			= 0x5,
williamr@2
   327
	/** Sending suspended. */
williamr@2
   328
	KMsvSendStateSuspended		= 0x6,
williamr@2
   329
	/** Sending failed. */
williamr@2
   330
	KMsvSendStateFailed			= 0x7,
williamr@2
   331
	/** Sending complete. */
williamr@2
   332
	KMsvSendStateSent			= 0x8,
williamr@2
   333
	/** Not applicable. */
williamr@2
   334
	KMsvSendStateNotApplicable	= 0x9
williamr@2
   335
	};
williamr@2
   336
williamr@2
   337
const TUint KMsvSendStateLast = KMsvSendStateNotApplicable;
williamr@2
   338
const TUint KMsvSendStateMax = 0x0F;
williamr@2
   339
williamr@2
   340
/** Supplies values for bitmasks that allows the rapid setting or clearing of a 
williamr@2
   341
number of TMsvEntry fields.
williamr@2
   342
williamr@2
   343
The fields that can be manipulated are:
williamr@2
   344
williamr@2
   345
1. PC synchronisation
williamr@2
   346
williamr@2
   347
2. Visibility flag
williamr@2
   348
williamr@2
   349
3. Read flag
williamr@2
   350
williamr@2
   351
4. In-preparation flag
williamr@2
   352
williamr@2
   353
5. Connected flag
williamr@2
   354
williamr@2
   355
6. Pending deletion flag.
williamr@2
   356
williamr@2
   357
7. New flag
williamr@2
   358
williamr@2
   359
@see TMsvEntry
williamr@2
   360
@see CMsvSession::ChangeAttributesL()
williamr@2
   361
@see CMsvServerEntry::ChangeAttributes() 
williamr@2
   362
@publishedAll
williamr@2
   363
@released
williamr@2
   364
*/
williamr@2
   365
enum TMsvAttribute    { 
williamr@2
   366
	/** PC synchronisation field. */
williamr@2
   367
						KMsvPcSyncCountAttribute	=0x00000001,
williamr@2
   368
	/** Visibility flag field. */
williamr@2
   369
						KMsvVisibilityAttribute		=0x00000200,
williamr@2
   370
	/** Read flag field. */
williamr@2
   371
						KMsvUnreadAttribute			=0x00000020,
williamr@2
   372
	/** In-preparation field. */
williamr@2
   373
						KMsvInPreparationAttribute	=0x00010000,
williamr@2
   374
	/** Connected flag field. */
williamr@2
   375
						KMsvConnectedAttribute		=0x01000000,
williamr@2
   376
	/** Pending deletion flag. */
williamr@2
   377
						KMsvPendingDeleteAttribute	=0x02000000,
williamr@2
   378
	/** New flag field. */
williamr@2
   379
						KMsvNewAttribute			=0x00000010};
williamr@2
   380
williamr@2
   381
/** Defines the sort order options for a TMsvSelectionOrdering object. Options 
williamr@2
   382
are set through TMsvSelectionOrdering::SetSorting().
williamr@2
   383
williamr@2
   384
@see TMsvSelectionOrdering 
williamr@2
   385
@publishedAll
williamr@2
   386
@released
williamr@2
   387
*/
williamr@2
   388
enum TMsvSorting 
williamr@2
   389
	{
williamr@2
   390
	/** Don't sort */
williamr@2
   391
	EMsvSortByNone=0,				// Don't sort
williamr@2
   392
	/** Date (earliest-latest) */
williamr@2
   393
	EMsvSortByDate,					// Date (earliest-latest)
williamr@2
   394
	/** Date (latest-earliest) */
williamr@2
   395
	EMsvSortByDateReverse,			// Date (latest-earliest)
williamr@2
   396
	/** Size (smallest-largest) */
williamr@2
   397
	EMsvSortBySize,					// Size (smallest-largest)
williamr@2
   398
	/** Size (largest-smallest) */
williamr@2
   399
	EMsvSortBySizeReverse,			// Size (largest-smallest)
williamr@2
   400
	/** To/From (A-Z folded) */
williamr@2
   401
	EMsvSortByDetails,				// ToFrom (A-Z collated)
williamr@2
   402
	/** To/From (Z-A folded) */
williamr@2
   403
	EMsvSortByDetailsReverse,		// ToFrom (Z-A collated)
williamr@2
   404
	/** Description (A-Z folded) */
williamr@2
   405
	EMsvSortByDescription,			// Description (A-Z collated)
williamr@2
   406
	/** Description (Z-A folded) */
williamr@2
   407
	EMsvSortByDescriptionReverse,	// Description (Z-A collated)
williamr@2
   408
	/** Sort by message ID. */
williamr@2
   409
	EMsvSortById,			        // Id (lowest-highest)
williamr@2
   410
	/** Sort in reverse order by message ID. */
williamr@2
   411
	EMsvSortByIdReverse	            // Id (highest-lowest)
williamr@2
   412
	};
williamr@2
   413
williamr@2
   414
/** Defines grouping order options for a TMsvEntrySelection object. Grouping options 
williamr@2
   415
can be combined in a bitmask and set through the TMsvEntrySelection constructor 
williamr@2
   416
@publishedAll
williamr@2
   417
@released
williamr@2
   418
*/
williamr@2
   419
enum TMsvGrouping
williamr@2
   420
	{
williamr@2
   421
	/** No grouping */
williamr@2
   422
	KMsvNoGrouping=0,				// No grouping
williamr@2
   423
	/** Group by entry type, in order, services, folders, messages, attachments */
williamr@2
   424
	KMsvGroupByType=0x2,			// Folder, Message, Attachment
williamr@2
   425
	/** Place standard folders first, in the order they were created */
williamr@2
   426
	KMsvGroupByStandardFolders=0x6,	// Standrad folders first (must have sorting by type set aswell)
williamr@2
   427
	/** Group by message priority, in order, high, medium, then low */
williamr@2
   428
	KMsvGroupByPriority=0x8,		// High, Mediem, Low
williamr@2
   429
	/** Group by MTM, either in the order set by CMsvEntry::SetMtmListL() or by MTM 
williamr@2
   430
	Uid value */
williamr@2
   431
	KMsvGroupByMtm=0x10,			// By increasing uid value
williamr@2
   432
	};
williamr@2
   433
williamr@2
   434
/** Defines the sorting and grouping rules used to prepare a selection of entries.
williamr@2
   435
 
williamr@2
   436
It is used in the interfaces of CMsvEntry and CMsvServerEntry to set the ordering 
williamr@2
   437
of an entry's children.
williamr@2
   438
williamr@2
   439
Firstly, the entries will be grouped, if the appropriate grouping option is 
williamr@2
   440
set, by:
williamr@2
   441
williamr@2
   442
1. Standard folders: any entries marked as standard folders are placed first, 
williamr@2
   443
in the order they were created.
williamr@2
   444
williamr@2
   445
2. Entry type: in the order services, folders, messages, attachments, unknown
williamr@2
   446
williamr@2
   447
3. Priority: in the order high, medium, then low
williamr@2
   448
williamr@2
   449
4. MTM: either in the MTM order set by CMsvEntry::SetMtmListL() or just in MTM 
williamr@2
   450
Uid value
williamr@2
   451
williamr@2
   452
Grouping options are simply Boolean flags that can be set on or off by functions 
williamr@2
   453
of this class.
williamr@2
   454
williamr@2
   455
Secondly, the order of entries within these groups is defined by a sorting 
williamr@2
   456
order option.
williamr@2
   457
williamr@2
   458
@see CMsvEntry
williamr@2
   459
@see CMsvServerEntry 
williamr@2
   460
@publishedAll
williamr@2
   461
@released
williamr@2
   462
*/
williamr@2
   463
class TMsvSelectionOrdering
williamr@2
   464
	{
williamr@2
   465
public:
williamr@2
   466
	IMPORT_C TMsvSelectionOrdering();
williamr@2
   467
	IMPORT_C TMsvSelectionOrdering(TInt aGroupingKey, TMsvSorting aSorting, TBool aShowInvisible=EFalse);
williamr@2
   468
	IMPORT_C void InternalizeL(RReadStream& aStream);
williamr@2
   469
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   470
	IMPORT_C TBool operator==(const TMsvSelectionOrdering& aOrdering) const;
williamr@2
   471
	IMPORT_C void SetSubjectSkipString(const TDesC& aSubjectSkipString);
williamr@2
   472
	IMPORT_C const TDesC& SubjectSkipString() const;
williamr@2
   473
williamr@2
   474
	//
williamr@2
   475
	inline TMsvSorting Sorting() const;
williamr@2
   476
	inline TBool GroupByType() const;
williamr@2
   477
	inline TBool GroupStandardFolders() const;
williamr@2
   478
	inline TBool GroupByPriority() const;
williamr@2
   479
	inline TBool GroupByMtm() const;
williamr@2
   480
	inline TBool ShowInvisibleEntries() const;
williamr@2
   481
	inline TBool GroupingOn() const;
williamr@2
   482
	// 
williamr@2
   483
	inline void SetGroupByType(TBool aFlag);
williamr@2
   484
	inline void SetGroupStandardFolders(TBool aFlag);
williamr@2
   485
	inline void SetGroupByPriority(TBool aFlag);
williamr@2
   486
	inline void SetGroupByMtm(TBool aFlag);
williamr@2
   487
	inline void SetShowInvisibleEntries(TBool aFlag);
williamr@2
   488
	inline void SetSorting(TMsvSorting aSortType);
williamr@2
   489
williamr@2
   490
	//
williamr@2
   491
	//
williamr@2
   492
private:
williamr@2
   493
williamr@2
   494
	enum TMsvGroupingPrivate
williamr@2
   495
		{
williamr@2
   496
		KMsvInvisibleFlag=0x1,
williamr@2
   497
		KMsvStandardFolders=0x4,
williamr@2
   498
		KMsvAllGroupingFlags=0x1e
williamr@2
   499
		};
williamr@2
   500
	TInt iGrouping;
williamr@2
   501
	TMsvSorting iSortType;
williamr@2
   502
 	TBuf<KMaxSubjectSkipStringLength>	iSubjectSkipString;
williamr@2
   503
	};
williamr@2
   504
williamr@2
   505
const TInt KMsvInvisibleFlag=1;
williamr@2
   506
williamr@2
   507
/** Encapsulates an array of entry IDs. 
williamr@2
   508
williamr@2
   509
An object of this type is commonly passed to a function to indicate the set 
williamr@2
   510
of entries on which the function should operate. The array base class (CArrayFixFlat<TMsvId>) 
williamr@2
   511
provide methods to access, sort, and manipulate members of the array.
williamr@2
   512
 
williamr@2
   513
@publishedAll
williamr@2
   514
@released
williamr@2
   515
*/
williamr@2
   516
class CMsvEntrySelection : public CArrayFixFlat<TMsvId>
williamr@2
   517
	{ 
williamr@2
   518
public: 
williamr@2
   519
	IMPORT_C CMsvEntrySelection();
williamr@2
   520
	IMPORT_C CMsvEntrySelection* CopyL()  const;
williamr@2
   521
	IMPORT_C CMsvEntrySelection* CopyLC() const;
williamr@2
   522
	IMPORT_C TInt Find(TMsvId aId) const;
williamr@2
   523
	};
williamr@2
   524
williamr@2
   525
/** Specifies a default service for a MTM.
williamr@2
   526
williamr@2
   527
@publishedAll
williamr@2
   528
@released
williamr@2
   529
*/
williamr@2
   530
class TMsvDefaultService
williamr@2
   531
	{
williamr@2
   532
public:
williamr@2
   533
	/** MTM for which the default service is specified. */
williamr@2
   534
	TUid iMtm;
williamr@2
   535
	/** ID of the default service. */
williamr@2
   536
	TMsvId iService;
williamr@2
   537
	};
williamr@2
   538
williamr@2
   539
williamr@2
   540
williamr@2
   541
/** Used to query the Message Server for entries that match the specification defined 
williamr@2
   542
in the filter. 
williamr@2
   543
williamr@2
   544
It allows a query to be performed on service, MTM, type and last change date. 
williamr@2
   545
The filter also enables the specification of the order in which the entries 
williamr@2
   546
are returned. 
williamr@2
   547
williamr@2
   548
@see CMsvSession::GetChildIdsL() 
williamr@2
   549
@publishedAll
williamr@2
   550
@released
williamr@2
   551
*/
williamr@2
   552
class CMsvEntryFilter : public CBase
williamr@2
   553
	{
williamr@2
   554
public:
williamr@2
   555
	IMPORT_C static CMsvEntryFilter* NewLC();
williamr@2
   556
	IMPORT_C static CMsvEntryFilter* NewL();
williamr@2
   557
	//
williamr@2
   558
public:
williamr@2
   559
	inline TMsvId Service() const;
williamr@2
   560
	inline void SetService(TMsvId aServiceId);
williamr@2
   561
	//
williamr@2
   562
	inline TUid Mtm() const;
williamr@2
   563
	inline void SetMtm(TUid aMtm);
williamr@2
   564
	//
williamr@2
   565
	inline TUid Type() const;
williamr@2
   566
	inline void SetType(TUid aType);
williamr@2
   567
	//
williamr@2
   568
	inline const TTime& LastChangeDate() const;
williamr@2
   569
	inline void SetLastChangeDate(const TTime& aLastChange);
williamr@2
   570
	//
williamr@2
   571
	inline const TMsvSelectionOrdering& Order() const;
williamr@2
   572
	inline void SetOrder(const TMsvSelectionOrdering& aOrder);
williamr@2
   573
	//
williamr@2
   574
	inline TUid SortMtm() const;
williamr@2
   575
	inline void SetSortMtm(TUid aSortMtm);
williamr@2
   576
	//
williamr@2
   577
private:
williamr@2
   578
	CMsvEntryFilter();
williamr@2
   579
	//
williamr@2
   580
private:
williamr@2
   581
	TMsvId iServiceId;
williamr@2
   582
	TUid iMtm;
williamr@2
   583
	TUid iType;
williamr@2
   584
	TTime iLastChange;
williamr@2
   585
	TMsvSelectionOrdering iOrdering;
williamr@2
   586
	TUid iSortMtm;
williamr@2
   587
	};
williamr@2
   588
williamr@2
   589
// Error resolver leave codes -7000 to -7127
williamr@2
   590
/** Defines error codes that relate to the Message Server.
williamr@2
   591
williamr@2
   592
@see MMsvEntryObserver::EMsvContextInvalid 
williamr@2
   593
@publishedAll
williamr@2
   594
@released
williamr@2
   595
*/
williamr@2
   596
enum TMsvResolverLeave
williamr@2
   597
	{
williamr@2
   598
	/** There is no disk in the drive containing the Message Server index. */
williamr@2
   599
	KMsvMediaUnavailable = -7000,
williamr@2
   600
	/** There is a disk in the drive containing the Message Server index, but it is 
williamr@2
   601
	the wrong one. */
williamr@2
   602
	KMsvMediaIncorrect = -7001,
williamr@2
   603
	/** A CMsvEntry context is no longer valid because the location of the Message Server's 
williamr@2
   604
	index has changed.
williamr@2
   605
	
williamr@2
   606
	Such contexts will need refreshing by the client.
williamr@2
   607
	
williamr@2
   608
	@see MMsvEntryObserver::EMsvContextInvalid */
williamr@2
   609
	KMsvMediaChanged = -7002,
williamr@2
   610
	KMsvIndexBackup      = -7003,
williamr@2
   611
	KMsvIndexRestore     = -7004
williamr@2
   612
	};
williamr@2
   613
williamr@2
   614
#include <msvstd.inl>
williamr@2
   615
williamr@2
   616
#endif