1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__MSVIPC_H__)
19 #if !defined(__E32BASE_H__)
23 #if !defined(__MSVSTD_H__)
29 const TInt KMsvNullOperation=0;
30 const TInt KMsvFirstOperation=1;
33 const TInt KMsvSessionBufferLength=0x1000;
34 const TInt KMsvProgressBufferLength=256;
37 // ***** NOTE!!!!! TMsvPackedChangeNotification::UnpackL() MUST be ****
38 // ***** updated when adding new types *****
43 enum TMsvServerChangeNotificationType
45 EMsvNullNotification=-1,
46 EMsvEntriesNoChange=0,
51 EMsvMtmGroupInstalled=5,
52 EMsvMtmGroupDeInstalled=6,
56 EMsvIndexFailedToLoad=10,
57 EMsvCorruptedIndexRebuilt=11,
58 EMsvMediaChanged=12, // Note: I assume the following four follow each other in order
59 EMsvMediaUnavailable=13,
60 EMsvMediaAvailable=14,
61 EMsvMediaIncorrect=15,
62 EMsvCorruptedIndexRebuilding=16
66 //**********************************
68 //**********************************
70 // Packs a TMsvEntry and the two associated descriptors into a buffer for
71 // sending across IPC. Also unpacks the data into a TMsvEntry and two heap
84 IMPORT_C TMsvPackedEntry(HBufC8*& aBuffer);
85 IMPORT_C TInt PackEntry(const TMsvEntry& aEntry);
86 IMPORT_C void UnpackEntry(TMsvEntry& aEntry);
92 //**********************************
93 // TMsvPackedEntryArray
94 //**********************************
96 // Packs 1+ TMsvEntry's and the associated descriptors into a buffer for
97 // sending across IPC. Also unpacks the data into a TMsvEntry and two heap
98 // descriptors using indexed access
102 class TMsvPackedEntryArray
109 IMPORT_C TMsvPackedEntryArray(HBufC8*& aBuffer, TInt aCount=0);
110 IMPORT_C TInt PackEntry(const TMsvEntry& aEntry);
111 IMPORT_C TInt UnpackEntry(TInt aEntryIndex, TMsvEntry& aEntry);
112 IMPORT_C void Reset();
114 TInt FindEntryInArray(TInt aIndex);
123 //**********************************
124 // TMsvChildrenDetails
125 //**********************************
127 // Contains the information about the number of children of an entry and how many
128 // have been sent in the main buffer
131 class TMsvChildrenDetails
138 IMPORT_C TMsvChildrenDetails();
141 TInt iTotalNumberChildren;
142 TInt iNumberChildrenInArray;
143 TInt iLastEntryInArray;
147 //**********************************
148 // TMsvLocalOperationProgress
149 //**********************************
151 // Contains the information about a local operation
154 class TMsvLocalOperationProgress
155 /** Encapsulates progress information returned by a local operation. A local operation
156 is a CMsvOperation-derived object returned by a function that affects only
157 local entries. For example, such a function would be a CMsvEntry::ChangeL()
158 call on a local entry. You can check if the operation is local from CMsvOperation::Mtm():
159 a local operation returns a value of KUidMsvLocalServiceMtm.
161 Progress information is obtained, in a packaged format, by calling CMsvOperation::ProgressL().
162 Understanding the TMsvLocalOperationProgress structure enables an application
163 to use that information for a local operation.
169 /** Defines the possible values for the type of operation progress report.
175 /** Default value for new TMsvLocalOperationProgress */
177 /** Move operation */
179 /** Delete operation */
181 /** Copy operation */
183 /** Create operation */
185 /** Change operation */
189 IMPORT_C TMsvLocalOperationProgress();
191 /** The type of operation on which the progress is reporting */
192 TLocalOperation iType;
193 /** The number of entries on which the operation was or will be attempted */
194 TInt iTotalNumberOfEntries;
195 /** The number of entries on which the operation has been successful */
196 TInt iNumberCompleted;
197 /** The number of entries on which the operation has failed */
199 /** The number of entries on which the operation has yet to be attempted */
200 TInt iNumberRemaining;
201 /** The error code for the latest failed operation */
203 /** This contains different information for different operation types:
205 1. copying a single entry: ID of the new entry
207 2. moving an entry: ID of the entry moved
209 3. copying or moving multiple entries: ID of the first entry in the selection */
213 //**********************************
214 // TMsvServerOperationProgress
215 //**********************************
216 /** Encapsulates progress information returned by a non-MTM specific Message Server
219 You can check if an operation has this type of progress information by calling
220 CMsvOperation::Mtm(): a suitable operation returns a value of KUidMsvServerMtm.
222 Progress information is obtained, in a packaged format, by calling CMsvOperation::ProgressL().
223 Understanding the TMsvServerOperationProgress class enables an application
224 to use that information for a Message Server operation.
226 @see TMsvLocalOperationProgress
227 @see CMsvSession::CopyStoreL()
228 @see CMsvSession::DeleteStoreL()
233 class TMsvServerOperationProgress
237 enum TMsvServerOperationType
239 /** No operation in progress. */
241 /** Change drive operation in progress.
243 @see CMsvSession::ChangeDriveL() */
244 EMsvChangeDriveOperation
247 /** Copy Store operation in progress.
248 @see CMsvSession::CopyStoreL() */
251 /** Delete Store operation in progress.
252 @see CMsvSession::DeleteStoreL() */
259 IMPORT_C TMsvServerOperationProgress();
260 TMsvServerOperationProgress(TMsvServerOperationType aType);
263 /** The type of operation in progress. */
264 TMsvServerOperationType iOperationType;
268 //**********************************
270 //**********************************
272 class TMsvIndexProgress
273 /** Provides details of index loading progress.
275 @see TMsvIndexLoadProgress
281 IMPORT_C TMsvIndexProgress();
284 /** Total number of entries in the index. */
286 /** Number of entries created so far. */
288 /** Number of entries remaining. */
290 /** ID of entry last created. */
295 //**********************************
296 // TMsvIndexLoadProgress
297 //**********************************
299 class TMsvIndexLoadProgress : public TMsvServerOperationProgress
300 /** Progress information for an operation controlling the Message Server loading
303 Such an operation can occur when the Message Server changes drive.
306 @see CMsvSession::ChangeDriveL()
312 /** States for the index loading process.
318 /** Index loading has not begun. */
320 /** Index loading is in progress. */
322 /** Index is being built. */
324 /** Index loading is complete. */
328 IMPORT_C TMsvIndexLoadProgress();
331 /** Stores any errors that prevented the index being loaded. */
333 /** Current state of the index loading process. */
335 /** Details of the index loading progress. */
336 TMsvIndexProgress iIndex;
341 //**********************************
343 //**********************************
345 /** Progress information for the copy operation.
348 @see CMsvSession::CopyStoreL()
352 class TMsvCopyProgress : public TMsvServerOperationProgress
355 /** States for the copy operation.
361 /** Operation not yet started */
363 /** Mail Store is being locked */
365 /** Initialising Copy operation */
367 /** Mail Store is being copied */
369 /** Mail Store is being unlocked. */
371 /** Operation completed */
375 /** Stores any errors that the operation encountered. */
377 TInt iTotal; // Total number of items to be copied
378 TInt iCurrent; // Current item number being copied
382 IMPORT_C TMsvCopyProgress();
386 //**********************************
387 // TMsvDeleteProgress
388 //**********************************
390 /** Progress information for the delete operation.
393 @see CMsvSession::DeleteStoreL()
397 class TMsvDeleteProgress : public TMsvServerOperationProgress
400 /** States for the delete operation.
406 /** Operation not yet started */
408 /** Mail Store is being deleted */
410 /** Operation is complete */
414 /** Stores any errors that the operation encountered. */
419 IMPORT_C TMsvDeleteProgress();
424 //**********************************
425 // TMsvPackedOperation
426 //**********************************
428 // Packs an operation, the selection, and some associated parameters (TInt) into the
433 class TMsvPackedOperation
440 IMPORT_C TMsvPackedOperation(HBufC8*& aBuffer);
441 IMPORT_C TInt Pack(const CMsvEntrySelection& aSelection, TInt aParameter1=0, TInt aParameter2=0);
442 IMPORT_C void UnpackL(CMsvEntrySelection& aSelection, TInt& aParameter1, TInt& aParameter2);
448 //**********************************
449 // TMsvPackedChangeNotification
450 //**********************************
452 // Packs the CMsvEntrySelection of index entries that have been changed, and also
453 // the integer describing the type of change. There is a limit of KMsvPackedChangeLimit
454 // top the number of entry ids that can be sent at one time
458 typedef TBuf8<128> TMsvNotifBuffer;
460 class TMsvPackedChangeNotification
467 enum { KMsvChangeNotificationNumberOfTInts=4,
468 KMsvPackedChangeLimit=28, // 32-KMsvChangeNotificationNumberOfTInts
471 IMPORT_C TMsvPackedChangeNotification(TMsvNotifBuffer& aBuffer);
472 inline void Pack(TMsvServerChangeNotificationType aChangeType, const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2);
473 IMPORT_C void Pack(TMsvServerChangeNotificationType aChangeType, const CMsvEntrySelection& aSelection, TInt aParameter1, TInt aParameter2, TInt aStartIndex, TInt aFinishIndex);
474 IMPORT_C void Pack(TMsvServerChangeNotificationType aChangeType, TMsvId aId, TInt aParameter1, TInt aParameter2);
475 IMPORT_C void UnpackL(TMsvServerChangeNotificationType& aChangeType, CMsvEntrySelection& aSelection, TInt& aParameter1, TInt& aParameter2);
477 TMsvNotifBuffer& iBuffer;
480 //**********************************
481 // TMsvPackedEntryFilter
482 //**********************************
484 class TMsvPackedEntryFilter
491 TMsvPackedEntryFilter(HBufC8*& aBuffer);
492 TInt PackFilter(const CMsvEntryFilter& aFilter);
493 void UnpackFilter(CMsvEntryFilter& aFilter);
499 #include <msvipc.inl>