epoc32/include/msvipc.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/msvipc.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/msvipc.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,501 @@
     1.4 -msvipc.h
     1.5 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#if !defined(__MSVIPC_H__)
    1.21 +#define __MSVIPC_H__
    1.22 +
    1.23 +#if !defined(__E32BASE_H__)
    1.24 +#include <e32base.h>
    1.25 +#endif
    1.26 +
    1.27 +#if !defined(__MSVSTD_H__)
    1.28 +#include <msvstd.h>
    1.29 +#endif
    1.30 +
    1.31 +
    1.32 +//
    1.33 +const TInt KMsvNullOperation=0;
    1.34 +const TInt KMsvFirstOperation=1;
    1.35 +
    1.36 +//
    1.37 +const TInt KMsvSessionBufferLength=0x1000;
    1.38 +const TInt KMsvProgressBufferLength=256;
    1.39 +
    1.40 +
    1.41 +// ***** NOTE!!!!! TMsvPackedChangeNotification::UnpackL() MUST be	****
    1.42 +// ***** updated when adding new types								*****
    1.43 +/**
    1.44 +@internalComponent
    1.45 +@released
    1.46 +*/
    1.47 +enum TMsvServerChangeNotificationType 
    1.48 +	{
    1.49 +	EMsvNullNotification=-1,
    1.50 +	EMsvEntriesNoChange=0,
    1.51 +	EMsvEntriesCreated=1,
    1.52 +	EMsvEntriesChanged=2,
    1.53 +	EMsvEntriesDeleted=3,
    1.54 +	EMsvEntriesMoved=4,
    1.55 +	EMsvMtmGroupInstalled=5,
    1.56 +	EMsvMtmGroupDeInstalled=6,
    1.57 +	EMsvStoreDeleted=7,  
    1.58 +	EMsvCloseSession=8,
    1.59 +	EMsvIndexLoaded=9,
    1.60 +	EMsvIndexFailedToLoad=10,
    1.61 +	EMsvCorruptedIndexRebuilt=11,
    1.62 +	EMsvMediaChanged=12, // Note: I assume the following four follow each other in order
    1.63 +	EMsvMediaUnavailable=13,
    1.64 +	EMsvMediaAvailable=14,
    1.65 +	EMsvMediaIncorrect=15,
    1.66 +	EMsvCorruptedIndexRebuilding=16
    1.67 +	};
    1.68 +
    1.69 +
    1.70 +//**********************************
    1.71 +// TMsvPackedEntry
    1.72 +//**********************************
    1.73 +//
    1.74 +// Packs a TMsvEntry and the two associated descriptors into a buffer for
    1.75 +// sending across IPC. Also unpacks the data into a TMsvEntry and two heap 
    1.76 +// descriptors
    1.77 +//
    1.78 +//
    1.79 +class TMsvEntry;
    1.80 +
    1.81 +class TMsvPackedEntry
    1.82 +/**
    1.83 +@internalComponent
    1.84 +@released
    1.85 +*/
    1.86 +	{
    1.87 +public:
    1.88 +	IMPORT_C TMsvPackedEntry(HBufC8*& aBuffer);
    1.89 +	IMPORT_C TInt PackEntry(const TMsvEntry& aEntry);
    1.90 +	IMPORT_C void UnpackEntry(TMsvEntry& aEntry);
    1.91 +private:
    1.92 +	HBufC8*& iBuffer;
    1.93 +	};
    1.94 +
    1.95 +
    1.96 +//**********************************
    1.97 +// TMsvPackedEntryArray
    1.98 +//**********************************
    1.99 +//
   1.100 +// Packs 1+ TMsvEntry's and the associated descriptors into a buffer for
   1.101 +// sending across IPC. Also unpacks the data into a TMsvEntry and two heap 
   1.102 +// descriptors using indexed access
   1.103 +//
   1.104 +//
   1.105 +
   1.106 +class TMsvPackedEntryArray
   1.107 +/**
   1.108 +@internalComponent
   1.109 +@released
   1.110 +*/
   1.111 +	{
   1.112 +public:
   1.113 +	IMPORT_C TMsvPackedEntryArray(HBufC8*& aBuffer, TInt aCount=0);
   1.114 +	IMPORT_C TInt PackEntry(const TMsvEntry& aEntry);
   1.115 +	IMPORT_C TInt UnpackEntry(TInt aEntryIndex, TMsvEntry& aEntry);
   1.116 +	IMPORT_C void Reset();
   1.117 +private:
   1.118 +	TInt FindEntryInArray(TInt aIndex);
   1.119 +private:
   1.120 +	TInt	iIndex;
   1.121 +	TInt	iCount;
   1.122 +	const TUint8* iPos;
   1.123 +	HBufC8*& iBuffer;
   1.124 +	};
   1.125 +
   1.126 +
   1.127 +//**********************************
   1.128 +// TMsvChildrenDetails
   1.129 +//**********************************
   1.130 +//
   1.131 +// Contains the information about the number of children of an entry and how many
   1.132 +// have been sent in the main buffer
   1.133 +//
   1.134 +
   1.135 +class TMsvChildrenDetails
   1.136 +/**
   1.137 +@internalComponent
   1.138 +@released
   1.139 +*/
   1.140 +	{
   1.141 +public:
   1.142 +	IMPORT_C TMsvChildrenDetails();
   1.143 +public:
   1.144 +	TMsvId	iParentId;
   1.145 +	TInt	iTotalNumberChildren;
   1.146 +	TInt	iNumberChildrenInArray;
   1.147 +	TInt	iLastEntryInArray;
   1.148 +	};
   1.149 +
   1.150 +
   1.151 +//**********************************
   1.152 +// TMsvLocalOperationProgress
   1.153 +//**********************************
   1.154 +//
   1.155 +// Contains the information about a local operation
   1.156 +//
   1.157 +
   1.158 +class TMsvLocalOperationProgress
   1.159 +/** Encapsulates progress information returned by a local operation. A local operation 
   1.160 +is a CMsvOperation-derived object returned by a function that affects only 
   1.161 +local entries. For example, such a function would be a CMsvEntry::ChangeL() 
   1.162 +call on a local entry. You can check if the operation is local from CMsvOperation::Mtm(): 
   1.163 +a local operation returns a value of KUidMsvLocalServiceMtm. 
   1.164 +
   1.165 +Progress information is obtained, in a packaged format, by calling CMsvOperation::ProgressL(). 
   1.166 +Understanding the TMsvLocalOperationProgress structure enables an application 
   1.167 +to use that information for a local operation.  
   1.168 +@publishedAll
   1.169 +@released
   1.170 +*/
   1.171 +	{
   1.172 +public:
   1.173 +/** Defines the possible values for the type of operation progress report. 
   1.174 +@publishedAll
   1.175 +@released
   1.176 +*/
   1.177 +	enum TLocalOperation
   1.178 +						{	
   1.179 +	/** Default value for new TMsvLocalOperationProgress */
   1.180 +							ELocalNone=0,
   1.181 +	/** Move operation */
   1.182 +							ELocalMove,
   1.183 +	/** Delete operation */
   1.184 +							ELocalDelete,
   1.185 +	/** Copy operation */
   1.186 +							ELocalCopy,
   1.187 +	/** Create operation */
   1.188 +							ELocalNew,
   1.189 +	/** Change operation */
   1.190 +							ELocalChanged
   1.191 +							};
   1.192 +public:
   1.193 +	IMPORT_C TMsvLocalOperationProgress();
   1.194 +public:
   1.195 +	/** The type of operation on which the progress is reporting */
   1.196 +	TLocalOperation iType;
   1.197 +	/** The number of entries on which the operation was or will be attempted */
   1.198 +	TInt iTotalNumberOfEntries;
   1.199 +	/** The number of entries on which the operation has been successful */
   1.200 +	TInt iNumberCompleted;	
   1.201 +	/** The number of entries on which the operation has failed */
   1.202 +	TInt iNumberFailed;	
   1.203 +	/** The number of entries on which the operation has yet to be attempted */
   1.204 +	TInt iNumberRemaining;	
   1.205 +	/** The error code for the latest failed operation */
   1.206 +	TInt iError;
   1.207 +	/** This contains different information for different operation types:
   1.208 +	
   1.209 +	1. copying a single entry: ID of the new entry
   1.210 +	
   1.211 +	2. moving an entry: ID of the entry moved
   1.212 +	
   1.213 +	3. copying or moving multiple entries: ID of the first entry in the selection */
   1.214 +	TMsvId	iId;
   1.215 +	};
   1.216 +
   1.217 +//**********************************
   1.218 +// TMsvServerOperationProgress
   1.219 +//**********************************
   1.220 +/** Encapsulates progress information returned by a non-MTM specific Message Server 
   1.221 +operation. 
   1.222 +
   1.223 +You can check if an operation has this type of progress information by calling 
   1.224 +CMsvOperation::Mtm(): a suitable operation returns a value of KUidMsvServerMtm. 
   1.225 +
   1.226 +Progress information is obtained, in a packaged format, by calling CMsvOperation::ProgressL(). 
   1.227 +Understanding the TMsvServerOperationProgress class enables an application 
   1.228 +to use that information for a Message Server operation. 
   1.229 +
   1.230 +@see TMsvLocalOperationProgress 
   1.231 +@see CMsvSession::CopyStoreL() 
   1.232 +@see CMsvSession::DeleteStoreL()
   1.233 +@publishedAll
   1.234 +@released
   1.235 +*/
   1.236 +
   1.237 +class TMsvServerOperationProgress
   1.238 +	{
   1.239 +public:
   1.240 +
   1.241 +	enum TMsvServerOperationType 
   1.242 +		{ 
   1.243 +		/** No operation in progress. */
   1.244 +		EMsvNoOperation = 0, 
   1.245 +		/** Change drive operation in progress.
   1.246 +	
   1.247 +		@see CMsvSession::ChangeDriveL() */
   1.248 +		EMsvChangeDriveOperation
   1.249 +		
   1.250 +		,
   1.251 + 		/** Copy Store operation in progress.
   1.252 + 		@see CMsvSession::CopyStoreL() */
   1.253 + 		EMsvCopyOperation,
   1.254 + 		
   1.255 + 		/** Delete Store operation in progress.
   1.256 + 		@see CMsvSession::DeleteStoreL() */
   1.257 + 		EMsvDeleteOperation
   1.258 + 		
   1.259 + 				
   1.260 + 		 };
   1.261 +	//
   1.262 +public:
   1.263 +	IMPORT_C TMsvServerOperationProgress();
   1.264 +	TMsvServerOperationProgress(TMsvServerOperationType aType);
   1.265 +	//
   1.266 +public:
   1.267 +	/** The type of operation in progress. */
   1.268 +	TMsvServerOperationType iOperationType;
   1.269 +	};
   1.270 +
   1.271 +		
   1.272 +//**********************************
   1.273 +// TMsvIndexProgress
   1.274 +//**********************************
   1.275 +
   1.276 +class TMsvIndexProgress
   1.277 +/** Provides details of index loading progress. 
   1.278 +
   1.279 +@see TMsvIndexLoadProgress 
   1.280 +@publishedAll
   1.281 +@released
   1.282 +*/
   1.283 +	{
   1.284 +public:
   1.285 +	IMPORT_C TMsvIndexProgress();
   1.286 +	//
   1.287 +public:
   1.288 +	/** Total number of entries in the index. */
   1.289 +	TInt iTotal;
   1.290 +	/** Number of entries created so far. */
   1.291 +	TInt iCompleted;
   1.292 +	/** Number of entries remaining. */
   1.293 +	TInt iRemaining;
   1.294 +	/** ID of entry last created. */
   1.295 +	TMsvId iId;
   1.296 +	};
   1.297 +
   1.298 +
   1.299 +//**********************************
   1.300 +// TMsvIndexLoadProgress
   1.301 +//**********************************
   1.302 +
   1.303 +class TMsvIndexLoadProgress : public TMsvServerOperationProgress
   1.304 +/** Progress information for an operation controlling the Message Server loading 
   1.305 +its index. 
   1.306 +
   1.307 +Such an operation can occur when the Message Server changes drive.
   1.308 +
   1.309 +@see CMsvOperation
   1.310 +@see CMsvSession::ChangeDriveL() 
   1.311 +@publishedAll
   1.312 +@released
   1.313 +*/
   1.314 +	{
   1.315 +public:
   1.316 +	/** States for the index loading process. 
   1.317 +@publishedAll
   1.318 +@released
   1.319 +*/
   1.320 +	enum TIndexState 
   1.321 +		{
   1.322 +		/** Index loading has not begun. */
   1.323 +		EIndexNotLoaded = 0, 
   1.324 +		/** Index loading is in progress. */
   1.325 +		EIndexLoading, 
   1.326 +		/** Index is being built. */
   1.327 +		EIndexRebuilding, 
   1.328 +		/** Index loading is complete. */
   1.329 +		EIndexComplete};
   1.330 +	//
   1.331 +public:
   1.332 +	IMPORT_C TMsvIndexLoadProgress();
   1.333 +	//
   1.334 +public:
   1.335 +	/** Stores any errors that prevented the index being loaded. */
   1.336 +	TInt iError;
   1.337 +	/** Current state of the index loading process. */
   1.338 +	TIndexState iState;
   1.339 +	/** Details of the index loading progress. */
   1.340 +	TMsvIndexProgress iIndex;
   1.341 +	};
   1.342 +
   1.343 +
   1.344 +
   1.345 +//**********************************
   1.346 +// TMsvCopyProgress
   1.347 +//**********************************
   1.348 +
   1.349 +/** Progress information for the copy operation. 
   1.350 +
   1.351 +@see CMsvOperation
   1.352 +@see CMsvSession::CopyStoreL() 
   1.353 +@publishedAll
   1.354 +@released
   1.355 +*/
   1.356 +class TMsvCopyProgress : public TMsvServerOperationProgress
   1.357 +	{
   1.358 +public:
   1.359 +/** States for the copy operation. 
   1.360 +@publishedAll
   1.361 +@released
   1.362 +*/
   1.363 +	enum TCopyState 
   1.364 +		{
   1.365 +		/** Operation not yet started */
   1.366 +		ENotYetStarted = 0,
   1.367 +		/** Mail Store is being locked */
   1.368 +		ELock, 
   1.369 +		/** Initialising Copy operation */
   1.370 +		EInitCopy,
   1.371 +		/** Mail Store is being copied */
   1.372 +		ECopyStore, 
   1.373 +		/** Mail Store is being unlocked. */
   1.374 +		EUnlock,
   1.375 +		/** Operation completed */
   1.376 +		ECompleted
   1.377 +		};
   1.378 +		
   1.379 +	/** Stores any errors that the operation encountered. */
   1.380 +	TInt iError;
   1.381 +	TInt iTotal;      // Total number of items to be copied
   1.382 +	TInt iCurrent;    // Current item number being copied
   1.383 + 	TCopyState iState;
   1.384 +	
   1.385 +public:
   1.386 +    IMPORT_C TMsvCopyProgress();
   1.387 +	};
   1.388 +
   1.389 +
   1.390 +//**********************************
   1.391 +// TMsvDeleteProgress
   1.392 +//**********************************
   1.393 +
   1.394 +/** Progress information for the delete operation.
   1.395 + 
   1.396 +@see CMsvOperation
   1.397 +@see CMsvSession::DeleteStoreL() 
   1.398 +@publishedAll
   1.399 +@released
   1.400 +*/
   1.401 +class TMsvDeleteProgress : public TMsvServerOperationProgress
   1.402 +	{
   1.403 +public:
   1.404 +/** States for the delete operation. 
   1.405 +@publishedAll
   1.406 +@released
   1.407 +*/
   1.408 +	enum TDeleteState 
   1.409 +		{
   1.410 +		/** Operation not yet started */
   1.411 +		ENotYetStarted = 0,
   1.412 +		/** Mail Store is being deleted */
   1.413 +		EDeleteStore, 
   1.414 +		/** Operation is complete */
   1.415 +		ECompleted
   1.416 +		};
   1.417 +		
   1.418 +	/** Stores any errors that the operation encountered. */
   1.419 +	TInt iError;
   1.420 +	TDeleteState iState;
   1.421 +	
   1.422 +public:
   1.423 +    IMPORT_C TMsvDeleteProgress();
   1.424 +	};
   1.425 +
   1.426 +
   1.427 +
   1.428 +//**********************************
   1.429 +// TMsvPackedOperation
   1.430 +//**********************************
   1.431 +//
   1.432 +// Packs an operation, the selection, and some associated parameters (TInt) into the
   1.433 +// IPC buffer
   1.434 +//
   1.435 +//
   1.436 +
   1.437 +class TMsvPackedOperation
   1.438 +/**
   1.439 +@internalComponent
   1.440 +@released
   1.441 +*/
   1.442 +	{
   1.443 +public:
   1.444 +	IMPORT_C TMsvPackedOperation(HBufC8*& aBuffer);
   1.445 +	IMPORT_C TInt Pack(const CMsvEntrySelection& aSelection, TInt aParameter1=0, TInt aParameter2=0);
   1.446 +	IMPORT_C void UnpackL(CMsvEntrySelection& aSelection, TInt& aParameter1, TInt& aParameter2);
   1.447 +private:
   1.448 +	HBufC8*& iBuffer;
   1.449 +	};
   1.450 +
   1.451 +
   1.452 +//**********************************
   1.453 +// TMsvPackedChangeNotification
   1.454 +//**********************************
   1.455 +//
   1.456 +// Packs the CMsvEntrySelection of index entries that have been changed, and also 
   1.457 +// the integer describing the type of change. There is a limit of KMsvPackedChangeLimit
   1.458 +// top the number of entry ids that can be sent at one time
   1.459 +//
   1.460 +//
   1.461 +
   1.462 +typedef TBuf8<128> TMsvNotifBuffer;
   1.463 +
   1.464 +class TMsvPackedChangeNotification
   1.465 +/**
   1.466 +@internalComponent
   1.467 +@released
   1.468 +*/
   1.469 +	{
   1.470 +public:
   1.471 +	enum {	KMsvChangeNotificationNumberOfTInts=4,
   1.472 +			KMsvPackedChangeLimit=28, // 32-KMsvChangeNotificationNumberOfTInts
   1.473 +			}; 
   1.474 +public:
   1.475 +	IMPORT_C TMsvPackedChangeNotification(TMsvNotifBuffer& aBuffer);
   1.476 +	inline void Pack(TMsvServerChangeNotificationType aChangeType, const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2);
   1.477 +	IMPORT_C void Pack(TMsvServerChangeNotificationType aChangeType, const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2, TInt aStartIndex, TInt aFinishIndex);
   1.478 +	IMPORT_C void Pack(TMsvServerChangeNotificationType aChangeType, TMsvId aId, TInt aParameter1, TInt aParameter2);
   1.479 +	IMPORT_C void UnpackL(TMsvServerChangeNotificationType& aChangeType, CMsvEntrySelection& aSelection, TInt& aParameter1, TInt& aParameter2);
   1.480 +private:
   1.481 +	TMsvNotifBuffer& iBuffer;
   1.482 +	};
   1.483 +
   1.484 +//**********************************
   1.485 +// TMsvPackedEntryFilter
   1.486 +//**********************************
   1.487 +
   1.488 +class TMsvPackedEntryFilter
   1.489 +/**
   1.490 +@internalComponent
   1.491 +@released
   1.492 +*/
   1.493 +	{
   1.494 +public:
   1.495 +	TMsvPackedEntryFilter(HBufC8*& aBuffer);
   1.496 +	TInt PackFilter(const CMsvEntryFilter& aFilter);
   1.497 +	void UnpackFilter(CMsvEntryFilter& aFilter);
   1.498 +private:
   1.499 +	HBufC8*& iBuffer;
   1.500 +	};
   1.501 +
   1.502 +
   1.503 +#include <msvipc.inl>
   1.504 +
   1.505 +#endif