epoc32/include/mw/msvapi.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 // MSVAPI.H
       
    15 //
       
    16 /**
       
    17  * @file 
       
    18  * @publishedAll
       
    19  * @released
       
    20  */
    15 
    21 
    16 #ifdef _DEBUG
    22 #ifdef _DEBUG
    17 #undef _NO_SESSION_LOGGING_
    23 #undef _NO_SESSION_LOGGING_
    18 #endif
    24 #endif
    19 
    25 
    34 #include <msvstd.h>
    40 #include <msvstd.h>
    35 #include <msvstore.h>
    41 #include <msvstore.h>
    36 #include <msvipc.h>
    42 #include <msvipc.h>
    37 #include <msvarray.h>
    43 #include <msvarray.h>
    38 #include <mclient.h>
    44 #include <mclient.h>
       
    45 #include <tmsvsystemprogress.h>
    39 
    46 
    40 // Forward declarations
    47 // Forward declarations
    41 class CMsvSession;
    48 class CMsvSession;
    42 class CMsvEntry;
    49 class CMsvEntry;
    43 class CBaseMtm;
    50 class CBaseMtm;
    44 class CMsvClientEntry;
    51 class CMsvClientEntry;
    45 class CMsvEntryArray;
    52 class CMsvEntryArray;
    46 class CMsvServer;
    53 class CMsvServer;
    47 class CMsvServerEntry;
    54 class CMsvServerEntry;
       
    55 class CMsvSearchSortOperation;
       
    56 
       
    57 
    48 
    58 
    49 // Remove these to remove client logging
    59 // Remove these to remove client logging
    50 //#define _NO_SESSION_LOGGING_
    60 //#define _NO_SESSION_LOGGING_
    51 #define _NO_SESSION_LOGGING_SERIAL_
    61 #define _NO_SESSION_LOGGING_SERIAL_
    52 
    62 
   482 							EMsvCorruptedIndexRebuilt,
   492 							EMsvCorruptedIndexRebuilt,
   483 	/** The Message Server has been terminated. 
   493 	/** The Message Server has been terminated. 
   484 	
   494 	
   485 	All clients must close their sessions immediately. */
   495 	All clients must close their sessions immediately. */
   486 							EMsvServerTerminated,
   496 							EMsvServerTerminated,
   487 	/** The Message Server has automatically changed the index location to use the 
   497 	/** This notification is sent whenever Message Server current drive is changed.
   488 	internal disk.
   498 	Upon receiving this event, the client should delete the current context of operations 
       
   499 	and refresh its view of messaging.
   489 	
   500 	
   490 	aArg1 is a TDriveNumber value that identifies the drive used by the Message 
   501 	aArg1 is a TDriveNumber value that identifies the drive used by the Message 
   491 	Server to hold the index prior to the change. 
   502 	Server to hold the index prior to the change. 
   492 	
   503 	
   493 	aArg2 is also a TDriveNumber value; it identifies the new drive that the Message 
   504 	aArg2 is also a TDriveNumber value; it identifies the new drive that the Message 
   524 							EMsvMediaIncorrect,
   535 							EMsvMediaIncorrect,
   525 	/** The Message Server has started to rebuild its index after it has been corrupted.
   536 	/** The Message Server has started to rebuild its index after it has been corrupted.
   526 	
   537 	
   527 	@see EMsvCorruptedIndexRebuilt */
   538 	@see EMsvCorruptedIndexRebuilt */
   528 							EMsvCorruptedIndexRebuilding
   539 							EMsvCorruptedIndexRebuilding
       
   540 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   541 	/** A media with pre-SQLite message store index has been inserted into a drive in the
       
   542 	priority drive list. */
       
   543 							,EMsvMessageStoreNotSupported,
       
   544 	/** A media with corrupt message store has been inserted into a drive in the priority
       
   545 	drive list and will be deleted. */
       
   546 							EMsvMessageStoreCorrupt,
       
   547 	/** The client needs to refresh its view of messaging either due to a drive with a 
       
   548 	valid message store being added or removed from the priority drive list, or a disk with
       
   549 	a valid message store being inserted or removed from a drive with priority less than
       
   550 	the current drive. */
       
   551 							EMsvRefreshMessageView,
       
   552 	/** Media is not available in the drive that has been added to the priority drive list. */
       
   553 							EMsvDiskNotAvailable,
       
   554 	/** A media insertion/removal event is received by server which it is unable to handle. */
       
   555 							EMsvUnableToProcessDiskNotification
       
   556 #endif
   529 							};
   557 							};
   530 public: 
   558 public: 
   531 	/** Indicates an event has occurred. 
   559 	/** Indicates an event has occurred. 
   532 	
   560 	
   533 	The type of event is indicated by the value of aEvent. The interpretation 
   561 	The type of event is indicated by the value of aEvent. The interpretation 
   605 	// --- Observer functions ---
   633 	// --- Observer functions ---
   606 	IMPORT_C void AddObserverL(MMsvSessionObserver& aObserver);
   634 	IMPORT_C void AddObserverL(MMsvSessionObserver& aObserver);
   607 	IMPORT_C void RemoveObserver(MMsvSessionObserver& aObserver);
   635 	IMPORT_C void RemoveObserver(MMsvSessionObserver& aObserver);
   608 	IMPORT_C TInt SetReceiveEntryEvents(TBool aReceive);
   636 	IMPORT_C TInt SetReceiveEntryEvents(TBool aReceive);
   609 	// --- Utility functions ---
   637 	// --- Utility functions ---
       
   638 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   639     IMPORT_C CMsvEntry* GetEntryL(TMsvId aEntId, TBool aChildrenOfAvailableDrives);
       
   640 #endif
   610 	IMPORT_C CMsvEntry* GetEntryL(TMsvId aEntId);
   641 	IMPORT_C CMsvEntry* GetEntryL(TMsvId aEntId);
   611 	IMPORT_C TInt GetEntry(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
   642 	IMPORT_C TInt GetEntry(TMsvId aId, TMsvId& aService, TMsvEntry& aEntry);
   612 	
   643 	
   613 	IMPORT_C CMsvOperation* TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TRequestStatus& aStatus);
   644 	IMPORT_C CMsvOperation* TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TRequestStatus& aStatus);
   614 	IMPORT_C void TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TDes8& aProgress);
   645 	IMPORT_C void TransferCommandL(const CMsvEntrySelection& aSelection, TInt aCommandId, const TDesC8& aParameter, TDes8& aProgress);
   624 	IMPORT_C static void CleanupEntry(TAny* aPtr);
   655 	IMPORT_C static void CleanupEntry(TAny* aPtr);
   625 	IMPORT_C void CleanupEntryPushL(TMsvId aId);
   656 	IMPORT_C void CleanupEntryPushL(TMsvId aId);
   626 	IMPORT_C void CleanupEntryPop(TInt aCount=1);
   657 	IMPORT_C void CleanupEntryPop(TInt aCount=1);
   627 
   658 
   628 	IMPORT_C void RemoveEntry(TMsvId aId);
   659 	IMPORT_C void RemoveEntry(TMsvId aId);
   629 	/// MTM functions
   660 	// MTM functions
   630 	IMPORT_C TInt InstallMtmGroup(const TDesC& aFullName);
   661 	IMPORT_C TInt InstallMtmGroup(const TDesC& aFullName);
   631 	IMPORT_C TInt DeInstallMtmGroup(const TDesC& aFullName); 
   662 	IMPORT_C TInt DeInstallMtmGroup(const TDesC& aFullName); 
   632 	
   663 	
   633 	IMPORT_C TInt StopService(TMsvId aServiceId);
   664 	IMPORT_C TInt StopService(TMsvId aServiceId);
   634 	IMPORT_C TBool ServiceActive(TMsvId aServiceId);
   665 	IMPORT_C TBool ServiceActive(TMsvId aServiceId);
   644 	IMPORT_C TDriveUnit CurrentDriveL();
   675 	IMPORT_C TDriveUnit CurrentDriveL();
   645 	IMPORT_C TBool DriveContainsStoreL(TDriveUnit aDrive);
   676 	IMPORT_C TBool DriveContainsStoreL(TDriveUnit aDrive);
   646 	IMPORT_C TBool MessageStoreDrivePresentL();
   677 	IMPORT_C TBool MessageStoreDrivePresentL();
   647 
   678 
   648 	IMPORT_C TInt ServiceAccessPointId(TMsvId aServiceId, TUint32& aAccessPointId);
   679 	IMPORT_C TInt ServiceAccessPointId(TMsvId aServiceId, TUint32& aAccessPointId);
   649 
   680 	
       
   681 	// Changed for PREQ 557.
       
   682 	// ---- Preferred list related APIs.
       
   683 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   684 	IMPORT_C void CurrentDriveInfoL(TDriveNumber& aDriveNumber, TUint& aPriority);
       
   685 	IMPORT_C void DriveListL(RArray<TDriveNumber>& aDriveList);
       
   686 	IMPORT_C void AvailableDriveListL(RArray<TDriveNumber>& aDriveList);
       
   687 	IMPORT_C void AddDriveL(TDriveNumber aDriveNumber, TUint& aPriority);
       
   688 	IMPORT_C void RemoveDriveL(TDriveNumber aDriveNumber);
       
   689 	IMPORT_C void UpdateDrivePriorityL(TDriveNumber aDriveNumber, TUint& aPriority);		
       
   690 	IMPORT_C void GetChildIdsAllL(TMsvId aId, const CMsvEntryFilter& aFilter, CMsvEntrySelection& aSelection);
       
   691 
       
   692 #if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE)
       
   693 	IMPORT_C void ResetRepositoryL();
       
   694 	IMPORT_C void PrintCache();
       
   695 #endif
       
   696 #endif
       
   697 
       
   698     // change for PREQ 2073 Converter
       
   699 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   700 	IMPORT_C void GetConvertibleDriveListL(RArray<TDriveNumber>& aDriveList);
       
   701 	IMPORT_C void ConvertMessageStore(TDriveNumber aDrive,TRequestStatus& aStatus);
       
   702 	IMPORT_C void GetConversionStatusL(TDriveNumber aDrive);
       
   703 	IMPORT_C TInt CancelConversion(TDriveNumber aDrive);
       
   704 #endif			// #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
   650 protected:
   705 protected:
   651 	CMsvSession(MMsvSessionObserver& aObserver);
   706 	CMsvSession(MMsvSessionObserver& aObserver);
   652 	CMsvSession(MMsvSessionObserver& aObserver, RFs& aFs);
   707 	CMsvSession(MMsvSessionObserver& aObserver, RFs& aFs);
   653 	CMsvSession(MMsvSessionObserver& aObserver, TInt aPriority);
   708 	CMsvSession(MMsvSessionObserver& aObserver, TInt aPriority);
   654 	CMsvSession(MMsvSessionObserver& aObserver, RFs& aFs, TInt aPriority);
   709 	CMsvSession(MMsvSessionObserver& aObserver, RFs& aFs, TInt aPriority);
   671 	void CleanupEntryDelete();
   726 	void CleanupEntryDelete();
   672   	void DoRunL(TMsvNotifBuffer& aBuffer);
   727   	void DoRunL(TMsvNotifBuffer& aBuffer);
   673  	void HandleNotifyL();
   728  	void HandleNotifyL();
   674  	void DoHandleNotifyL(TMsvNotifBuffer& aBuffer);
   729  	void DoHandleNotifyL(TMsvNotifBuffer& aBuffer);
   675 	void GetMessageFolderL();
   730 	void GetMessageFolderL();
       
   731 
   676 	//	
   732 	//	
   677 private:
   733 private:
   678 	TInt iOperationId;
   734 	TInt iOperationId;
   679 	RFs	iFs;
   735 	RFs	iFs;
   680 	RMsvServerSession iSession;
   736 	RMsvServerSession* iSession;
       
   737 	TInt dummy1;
       
   738 	TInt dummy2;
       
   739 	TInt dummy3;
   681 	TMsvNotifBuffer iChange;	
   740 	TMsvNotifBuffer iChange;	
   682 	MMsvSessionObserver&	iMainObserver;
   741 	MMsvSessionObserver&	iMainObserver;
   683 	CArrayPtrFlat<MMsvSessionObserver>* iObservers;
   742 	CArrayPtrFlat<MMsvSessionObserver>* iObservers;
   684 	CMsvEntrySelection* iCleanupList;
   743 	CMsvEntrySelection* iCleanupList;
   685 	TInt iSyncStart;
   744 	TInt iSyncStart;
   703 friend class CSendAs;
   762 friend class CSendAs;
   704 friend class CMsvEntry;
   763 friend class CMsvEntry;
   705 friend class CMsvOperation;
   764 friend class CMsvOperation;
   706 friend class CMsvEntryOperation;
   765 friend class CMsvEntryOperation;
   707 friend class CObserverRegistry;
   766 friend class CObserverRegistry;
   708 	//
   767 friend class CMsvSearchSortOperation;
       
   768 friend class CMsvSearchsortOpOnHeaderBody;
       
   769 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   770 friend class CMsvHeaderStore;
       
   771 #endif
       
   772 #if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE)
       
   773 	friend class CTestMsvSession;
       
   774 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   775 	friend class CTestHeaderEntry;
       
   776 #endif
       
   777 #endif	
   709 	};
   778 	};
   710 
   779 
   711 
   780 
   712 
   781 
   713 
   782 
   817 @publishedAll
   886 @publishedAll
   818 @released
   887 @released
   819 */
   888 */
   820 	{
   889 	{
   821 public: // Public member functions
   890 public: // Public member functions
       
   891 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   892     IMPORT_C static CMsvEntry* NewL(CMsvSession& aMsvSession, TMsvId aMsvId, const TMsvSelectionOrdering& aOrdering, TBool aChildrenOfAvailableDrives);
       
   893     IMPORT_C void SetStandardFolderEntryL(TMsvId aId);
       
   894     IMPORT_C CMsvEntrySelection* ChildrenOfAvailableDrivesL() const;
       
   895 #endif
   822 	IMPORT_C static CMsvEntry* NewL(CMsvSession& aMsvSession, TMsvId aMsvId, const TMsvSelectionOrdering& aOrdering);
   896 	IMPORT_C static CMsvEntry* NewL(CMsvSession& aMsvSession, TMsvId aMsvId, const TMsvSelectionOrdering& aOrdering);
       
   897 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   898 	IMPORT_C void SetEntryNoCheckL(TMsvId aId, TBool aChildrenOfAvailableDrives=EFalse);
       
   899 #else
       
   900 	IMPORT_C void SetEntryNoCheckL(TMsvId aId);
       
   901 #endif
   823 	IMPORT_C ~CMsvEntry();
   902 	IMPORT_C ~CMsvEntry();
   824 	//
   903 	//
   825 	// --- Observer functions ---
   904 	// --- Observer functions ---
   826 	IMPORT_C void AddObserverL(MMsvEntryObserver& aObserver);
   905 	IMPORT_C void AddObserverL(MMsvEntryObserver& aObserver);
   827 	IMPORT_C void RemoveObserver(MMsvEntryObserver& aObserver);
   906 	IMPORT_C void RemoveObserver(MMsvEntryObserver& aObserver);
   863 	// --- Synchronous Child Entry functions ---
   942 	// --- Synchronous Child Entry functions ---
   864 	IMPORT_C CMsvEntrySelection* ChildrenL() const;
   943 	IMPORT_C CMsvEntrySelection* ChildrenL() const;
   865 	IMPORT_C CMsvEntrySelection* ChildrenWithServiceL(TMsvId aServiceId) const;
   944 	IMPORT_C CMsvEntrySelection* ChildrenWithServiceL(TMsvId aServiceId) const;
   866 	IMPORT_C CMsvEntrySelection* ChildrenWithMtmL(TUid aMtm) const;
   945 	IMPORT_C CMsvEntrySelection* ChildrenWithMtmL(TUid aMtm) const;
   867 	IMPORT_C CMsvEntrySelection* ChildrenWithTypeL(TUid aType) const;
   946 	IMPORT_C CMsvEntrySelection* ChildrenWithTypeL(TUid aType) const;
       
   947 	
   868 	inline TInt Count() const;
   948 	inline TInt Count() const;
   869 	IMPORT_C const TMsvEntry& ChildDataL(TMsvId aId) const;
   949 	IMPORT_C const TMsvEntry& ChildDataL(TMsvId aId) const;
   870 	IMPORT_C const TMsvEntry& operator[](TInt aIndex) const;
   950 	IMPORT_C const TMsvEntry& operator[](TInt aIndex) const;
   871 	IMPORT_C CMsvEntry* ChildEntryL(TMsvId aId) const;
   951 	IMPORT_C CMsvEntry* ChildEntryL(TMsvId aId) const;
   872 	IMPORT_C void MoveL(TMsvId aMsvId, TMsvId aTargetId);
   952 	IMPORT_C void MoveL(TMsvId aMsvId, TMsvId aTargetId);
   886 	// From MMsvStoreObserver
   966 	// From MMsvStoreObserver
   887 	void HandleStoreEvent(TMsvStoreEvent aEvent, TMsvId aId);
   967 	void HandleStoreEvent(TMsvStoreEvent aEvent, TMsvId aId);
   888 
   968 
   889 
   969 
   890 	IMPORT_C TBool HasStoreL() const;
   970 	IMPORT_C TBool HasStoreL() const;
   891 	//
   971 	
   892  	/** @internalTechnology */
       
   893  	IMPORT_C void SetEntryNoCheckL(TMsvId aId);
       
   894 	//	
   972 	//	
   895 private: // Private members
   973 private: // Private members
       
   974 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   975     CMsvEntry(CMsvSession& aMsvSession, const TMsvSelectionOrdering& aOrdering, TBool aChildrenOfAvailableDrives);
       
   976 	inline TUint GetDriveId(TMsvId aMaskedId) const;
       
   977 #endif
   896 	CMsvEntry(CMsvSession& aMsvSession, const TMsvSelectionOrdering& aOrdering);
   978 	CMsvEntry(CMsvSession& aMsvSession, const TMsvSelectionOrdering& aOrdering);
       
   979 
   897 	void ConstructL(TMsvId aMsvId);
   980 	void ConstructL(TMsvId aMsvId);
   898 	//
   981 	//
   899 	void NotifyAllObserversL(MMsvEntryObserver::TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
   982 	void NotifyAllObserversL(MMsvEntryObserver::TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
   900 	void ContextChangedL(MMsvEntryObserver::TMsvEntryEvent aEvent);
   983 	void ContextChangedL(MMsvEntryObserver::TMsvEntryEvent aEvent);
   901 	void NewChildrenL(const CMsvEntrySelection& aSelection);
   984 	void NewChildrenL(const CMsvEntrySelection& aSelection);
   921 	void HandleMediaChangeL();
  1004 	void HandleMediaChangeL();
   922 
  1005 
   923 	TInt MoveOneL(TMsvId aMsvId, TMsvId aTargetId);
  1006 	TInt MoveOneL(TMsvId aMsvId, TMsvId aTargetId);
   924 	TInt CopyOneL(TMsvId aMsvId, TMsvId aTargetId);
  1007 	TInt CopyOneL(TMsvId aMsvId, TMsvId aTargetId);
   925 	TInt DeleteOneL(TMsvId aMsvId);
  1008 	TInt DeleteOneL(TMsvId aMsvId);
       
  1009 
   926 	//
  1010 	//
   927 private:
  1011 private:
   928 	enum TEntryState {	EValid,
  1012 	enum TEntryState {	EValid,
   929 						EInvalidChangingContext,
  1013 						EInvalidChangingContext,
   930 						EInvalidDeletedContext,
  1014 						EInvalidDeletedContext,
   946 	CMsvEntryArray* iSortedChildren;
  1030 	CMsvEntryArray* iSortedChildren;
   947 	CMsvStore* iStore;
  1031 	CMsvStore* iStore;
   948 	CArrayFixFlat<TUid>* iMtmList;
  1032 	CArrayFixFlat<TUid>* iMtmList;
   949 	TMsvId iOwningService;
  1033 	TMsvId iOwningService;
   950 	TUint32 iNotifySequence;
  1034 	TUint32 iNotifySequence;
       
  1035 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
  1036 	/* If this flag is set, child entries from all available drives
       
  1037 	   in the preferred drive list will be fetched. */
       
  1038 	TBool iChildrenOfAvailableDrives;
       
  1039 #endif
   951 	};
  1040 	};
   952 
  1041 
   953 //**********************************
  1042 //**********************************
   954 // MessageServer
  1043 // MessageServer
   955 //**********************************
  1044 //**********************************
   970 	IMPORT_C static TMsvId NullUidValue();
  1059 	IMPORT_C static TMsvId NullUidValue();
   971 	//
  1060 	//
   972 	IMPORT_C static TBool DriveContainsStore(RFs& aFs, TInt aDrive);
  1061 	IMPORT_C static TBool DriveContainsStore(RFs& aFs, TInt aDrive);
   973 	IMPORT_C static TInt CurrentDriveL(RFs& aFs);
  1062 	IMPORT_C static TInt CurrentDriveL(RFs& aFs);
   974 	IMPORT_C static TBool IsMessageStoreDrivePresentL(RFs& aFs);
  1063 	IMPORT_C static TBool IsMessageStoreDrivePresentL(RFs& aFs);
       
  1064 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
  1065 	IMPORT_C static TBool IsMessageStoreSupported(TDriveNumber aDrive);
       
  1066 #endif
   975 	};
  1067 	};
   976 
  1068 
   977 //**********************************
  1069 //**********************************
   978 // MtmClientUtils
  1070 // MtmClientUtils
   979 //**********************************
  1071 //**********************************
   995     IMPORT_C static TMsvLocalOperationProgress GetFinalLocalProgress(CMsvOperation& aOperation);
  1087     IMPORT_C static TMsvLocalOperationProgress GetFinalLocalProgress(CMsvOperation& aOperation);
   996     IMPORT_C static TInt GetProgressErrorL(CMsvOperation& aOperation);
  1088     IMPORT_C static TInt GetProgressErrorL(CMsvOperation& aOperation);
   997     IMPORT_C static TMsvId GetProgressIdL(CMsvOperation& aOperation);
  1089     IMPORT_C static TMsvId GetProgressIdL(CMsvOperation& aOperation);
   998 	};
  1090 	};
   999 
  1091 
       
  1092 
       
  1093 
       
  1094 
       
  1095 
       
  1096 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
  1097 
       
  1098 /**
       
  1099  * The class allows  client MTMs  to communicate the  header structure 
       
  1100  * to the message server. It provides API to add various fields to the
       
  1101  * header structure. Finally it provides API to create header store in
       
  1102  * the messaging DB.   The store will always be created in the message
       
  1103  * server current drive. In order to create store in non-current drive
       
  1104  * the user should perform ChangeDrive() operation.
       
  1105 
       
  1106  * The header store should be created immediately after creating the
       
  1107  * mail account. The server will create separate header store for each
       
  1108  * MTM type. The function does not return an error if the header store
       
  1109  * being created already exist.
       
  1110 
       
  1111  @publishedAll
       
  1112  @released
       
  1113  */
       
  1114 class CMsvHeaderStore : public CBase
       
  1115 	{
       
  1116 public:
       
  1117 
       
  1118 	/**
       
  1119 	 * Common Header Fields
       
  1120 	 * @publishedAll
       
  1121 	 * @released
       
  1122 	 */
       
  1123 	enum TCommonHeaderField
       
  1124 		{		
       
  1125 		EFrom    = 0x001,
       
  1126 		ETo      = 0x002,
       
  1127 		ECC      = 0x004,
       
  1128 		EBCC     = 0x008,
       
  1129 		ESubject = 0x010
       
  1130 		};
       
  1131 
       
  1132 
       
  1133 	IMPORT_C static CMsvHeaderStore* NewL(const TUid& aMtmId, CMsvSession& aSession);
       
  1134 	IMPORT_C static CMsvHeaderStore* NewLC(const TUid& aMtmId, CMsvSession& aSession);
       
  1135 	~CMsvHeaderStore();
       
  1136 
       
  1137 	IMPORT_C void AddFieldL(HBufC* aFieldName, EFieldType aFieldType);
       
  1138 	IMPORT_C void AddFieldL(TCommonHeaderField aCommonHeaderFieldName);
       
  1139 	IMPORT_C void CreateStoreL();
       
  1140 	IMPORT_C static TBool DoesStoreExistsL(const TUid& aMtmId, CMsvSession& aSession);
       
  1141 	IMPORT_C TPtrC LastErrorMessageL();
       
  1142 	
       
  1143 private:
       
  1144 	CMsvHeaderStore(TUid aMtmId, CMsvSession& aSession);
       
  1145 	void ConstructL();
       
  1146 
       
  1147 private:
       
  1148 
       
  1149 	TUid iMtmUid;
       
  1150 	CMsvSession& iSessionRef;
       
  1151 	RPointerArray<CFieldPair> iFieldDetails;
       
  1152 	HBufC* iLastErrorMessage;
       
  1153 	};
       
  1154 
       
  1155 
       
  1156 #endif    	// #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
  1000 #include <msvapi.inl>
  1157 #include <msvapi.inl>
  1001 
  1158 
  1002 #endif // __MSVAPI_H__
  1159 #endif // __MSVAPI_H__