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