epoc32/include/mw/msvstd.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 // MSVSTD.H
    14 //
    15 //
    15 
    16 /**
       
    17  * @file 
       
    18  * @publishedAll
       
    19  * @released
       
    20  */
    16 #ifndef __MSVSTD_H__
    21 #ifndef __MSVSTD_H__
    17 #define __MSVSTD_H__
    22 #define __MSVSTD_H__
    18 
    23 
    19  
       
    20 
       
    21 
       
    22 #include <e32base.h>
    24 #include <e32base.h>
    23 #include <s32file.h>
    25 #include <s32file.h>
       
    26 #include <msvstd.hrh>
    24 
    27 
    25 /**
    28 /**
    26 Specifies an entry in the Message Server index.
    29 Specifies an entry in the Message Server index.
    27 @publishedAll
    30 @publishedAll
    28 @released
    31 @released
   161 	inline void SetForwarded(TBool aForwarded);
   164 	inline void SetForwarded(TBool aForwarded);
   162 	inline TBool Forwarded() const;
   165 	inline TBool Forwarded() const;
   163 	/** This method sets bit 32 of iMtmData1, if you are using this bit elsewhere don't call this method.*/
   166 	/** This method sets bit 32 of iMtmData1, if you are using this bit elsewhere don't call this method.*/
   164 	inline void SetLocallyDeleted(TBool aLocallyDeleted);
   167 	inline void SetLocallyDeleted(TBool aLocallyDeleted);
   165 	inline TBool LocallyDeleted() const;
   168 	inline TBool LocallyDeleted() const;
       
   169 	inline void SetVisibleFolderFlag(TBool aReadOnly);
       
   170 	inline TBool VisibleFolderFlag() const;
   166 	
   171 	
   167 	IMPORT_C TBool PendingConditions() const;
   172 	IMPORT_C TBool PendingConditions() const;
   168 	IMPORT_C void SetPendingConditions(TBool aPendingConditions);
   173 	IMPORT_C void SetPendingConditions(TBool aPendingConditions);
   169 	//
   174 	//
   170 	IMPORT_C TInt32 MtmData1() const;
   175 	IMPORT_C TInt32 MtmData1() const;
   171 	IMPORT_C TInt32 MtmData2() const;
   176 	IMPORT_C TInt32 MtmData2() const;
   172 	IMPORT_C TInt32 MtmData3() const;
   177 	IMPORT_C TInt32 MtmData3() const;
   173 	
   178 
   174 	/** 
       
   175 	@internalTechnology
       
   176 	*/
       
   177 	IMPORT_C void SetMtmData1(TInt32 aMtmData);
   179 	IMPORT_C void SetMtmData1(TInt32 aMtmData);
   178 	/** 
       
   179 	@internalTechnology
       
   180 	*/
       
   181 	IMPORT_C void SetMtmData2(TInt32 aMtmData);
   180 	IMPORT_C void SetMtmData2(TInt32 aMtmData);
   182 	/** 
       
   183 	@internalTechnology
       
   184 	*/
       
   185 	IMPORT_C void SetMtmData3(TInt32 aMtmData);
   181 	IMPORT_C void SetMtmData3(TInt32 aMtmData);
   186 	//
   182 	//
   187 protected:
   183 protected:
   188 	// only the server will be able to set the following
   184 	// only the server will be able to set the following
   189 	inline void SetId(TMsvId aId);
   185 	inline void SetId(TMsvId aId);
   247 	TPtrC iDetails;    
   243 	TPtrC iDetails;    
   248 	//
   244 	//
   249 	//
   245 	//
   250 private:
   246 private:
   251 	//
   247 	//
       
   248 	
       
   249 
   252 friend class CMsvEntry;
   250 friend class CMsvEntry;
   253 friend class CMsvServer;
   251 friend class CMsvServer;
   254 friend class CMsvServerEntry;
   252 friend class CMsvServerEntry;
   255 friend class CMsvClientEntry;
   253 friend class CMsvClientEntry;
   256 friend class CMsvServerSession;
   254 friend class CMsvServerSession;
   262 friend class CMsvIndexRebuild;
   260 friend class CMsvIndexRebuild;
   263 friend class CMsvCopyEntry;
   261 friend class CMsvCopyEntry;
   264 friend class CMsvDelete;
   262 friend class CMsvDelete;
   265 friend class CMsvIndexContext;
   263 friend class CMsvIndexContext;
   266 friend class CMsvEntryArray;
   264 friend class CMsvEntryArray;
   267 	//
   265 friend class CMsvIndexAdapter;
       
   266 friend class CMsvDBAdapter;
       
   267 friend class TSearchSortDbWrapper;
       
   268 
       
   269 #if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE)
       
   270 friend class CTestIndexAdapter;
       
   271 friend class CTestDbAdapter;
       
   272 friend class CTestVisibleFolder;
       
   273 friend class CTestIndexTableEntry;
       
   274 friend class CTestEntryFreePool;
       
   275 friend class CTestIndexContext;
       
   276 friend class CTestMsvServer;
       
   277 friend class CTestMsvEntry;
       
   278 friend class CTestSearchSortCacheEntry;
       
   279 friend class CTestSearchSortCacheManager;
       
   280 friend class CTestSearchSortDeltaCache;
       
   281 friend class CTestSearchSortOperation;
       
   282 friend class CTestSearchSortDBadapter;
       
   283 friend class CTestSearchSortCacheManager;
       
   284 friend class CTestSearchSortDeltaCache;
       
   285 friend class CTestHeaderSearchSortOperation;
       
   286 friend class CTestHeaderEntry;
       
   287 #endif
       
   288 
       
   289 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   290 	friend class CMsvVersion0Version1Converter;
       
   291 #if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE)
       
   292 	friend class CTestConverterDBAdapter;
       
   293 #endif
       
   294 #endif
   268 private:
   295 private:
   269 	//
   296 	//
   270 enum {	KMsvEntryPriorityMask=			0x00000003,
   297 enum {	KMsvEntryPriorityMask=			0x00000003,
   271 		KMsvEntryHighPriority=			0x00000002,
   298 		KMsvEntryHighPriority=			0x00000002,
   272 		KMsvEntryMediumPriority=		0x00000001,
   299 		KMsvEntryMediumPriority=		0x00000001,
   290 		KMsvSendingStateFlags=			0x001E0000, // Note: Sending state is shifted KMsvSendingStateShift places left
   317 		KMsvSendingStateFlags=			0x001E0000, // Note: Sending state is shifted KMsvSendingStateShift places left
   291 		KMsvEntryPersistedFlags=		0x00FFFFFF,
   318 		KMsvEntryPersistedFlags=		0x00FFFFFF,
   292 		KMsvEntryPendingConditionsFlag=	0x00800000,		
   319 		KMsvEntryPendingConditionsFlag=	0x00800000,		
   293 		KMsvEntryTemporaryFlags=		0xFF000000,
   320 		KMsvEntryTemporaryFlags=		0xFF000000,
   294 		KMsvEntryConnectedFlag=			0x01000000,
   321 		KMsvEntryConnectedFlag=			0x01000000,
   295 		KMsvEntryPendingDeleteFlag=		0x02000000};
   322 		KMsvEntryPendingDeleteFlag=		0x02000000,
       
   323 	    KMsvVisibleFolderNodeFlag=      0x04000000
       
   324 	   };
       
   325 	   
   296 	};
   326 	};
   297 enum 
   327 enum 
   298 	{
   328 	{
   299 		KMsvEntryDeleteProtected=		0x800000,
   329 		KMsvEntryDeleteProtected=		0x800000,
   300 		KMsvEntryForwarded=				0x40000000,
   330 		KMsvEntryForwarded=				0x40000000,
   301 		KMsvEntryLocallyDeleted=		0x80000000
   331 		KMsvEntryLocallyDeleted=		0x80000000
   302 	};
   332 	};
   303 
   333 
   304 const TUint KMsvSendingStateShift=0x11; // Places to shift sending state
   334 const TUint KMsvSendingStateShift=0x11; // Places to shift sending state
       
   335 
       
   336 #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT)
       
   337 	const TInt KDriveMask = 0x0fffffff;
       
   338 	const TInt KCurrentDriveId = 1;
       
   339 #endif
   305 
   340 
   306 /** Defines sending state flags. 
   341 /** Defines sending state flags. 
   307 @publishedAll
   342 @publishedAll
   308 @released
   343 @released
   309 */
   344 */
   334 	KMsvSendStateNotApplicable	= 0x9
   369 	KMsvSendStateNotApplicable	= 0x9
   335 	};
   370 	};
   336 
   371 
   337 const TUint KMsvSendStateLast = KMsvSendStateNotApplicable;
   372 const TUint KMsvSendStateLast = KMsvSendStateNotApplicable;
   338 const TUint KMsvSendStateMax = 0x0F;
   373 const TUint KMsvSendStateMax = 0x0F;
       
   374 // Message Database Version.
       
   375 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   376 const TUint KCurrentDatabaseVersion = 2;
       
   377 #else
       
   378 const TUint KCurrentDatabaseVersion = 1;
       
   379 #endif
   339 
   380 
   340 /** Supplies values for bitmasks that allows the rapid setting or clearing of a 
   381 /** Supplies values for bitmasks that allows the rapid setting or clearing of a 
   341 number of TMsvEntry fields.
   382 number of TMsvEntry fields.
   342 
   383 
   343 The fields that can be manipulated are:
   384 The fields that can be manipulated are:
   609 	KMsvMediaChanged = -7002,
   650 	KMsvMediaChanged = -7002,
   610 	KMsvIndexBackup      = -7003,
   651 	KMsvIndexBackup      = -7003,
   611 	KMsvIndexRestore     = -7004
   652 	KMsvIndexRestore     = -7004
   612 	};
   653 	};
   613 
   654 
       
   655 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   656 
       
   657 enum EFieldType
       
   658 /**
       
   659 Allowed field types.
       
   660 This class is also used at the server side.
       
   661  
       
   662 @publishedAll
       
   663 @released
       
   664 */
       
   665 	{
       
   666 	EIntegerField,
       
   667 	ETextField,
       
   668 	EDateField
       
   669 	};
       
   670 
       
   671 
       
   672 
       
   673 // Common class used by both client and server.
       
   674 class CFieldPair: public CBase
       
   675 /**
       
   676 Allowed field types.
       
   677 This class is also used at the server side.
       
   678  
       
   679 @publishedAll
       
   680 @released
       
   681 */
       
   682 	{
       
   683 public:
       
   684 	~CFieldPair()
       
   685 		{
       
   686 		if(iFieldName)
       
   687 			{
       
   688 			delete iFieldName;
       
   689 			}
       
   690 		if(iFieldTextValue)
       
   691 			{
       
   692 			delete iFieldTextValue;
       
   693 			}
       
   694 		}
       
   695 	HBufC* iFieldName;			// Column name
       
   696 	EFieldType iFieldType;		// Column type
       
   697 	TInt64 iFieldNumValue;		// Column value in number
       
   698 	HBufC* iFieldTextValue;		// Column value in text
       
   699 	};
       
   700 	
       
   701 
       
   702 
       
   703 class CHeaderFields: public CBase
       
   704 	{
       
   705 public:
       
   706 	~CHeaderFields()
       
   707 		{
       
   708 		iFieldPairList.ResetAndDestroy();
       
   709 		}
       
   710 	RPointerArray<CFieldPair> iFieldPairList;
       
   711 	TUid iUid;
       
   712 	};
       
   713 	
       
   714 
       
   715 /*
       
   716 // Used for CMsvEntry::ReadDBStoreL() and CMsvEntry::ReadDBStoreL()
       
   717 // Used for CMsvServerEntry::ReadDBStoreL() and CMsvServerEntry::ReadDBStoreL()
       
   718 
       
   719 @publishedAll
       
   720 @released
       
   721 */
       
   722 
       
   723 enum TEntryStoreType
       
   724 	{
       
   725 	EHeaderEntry,
       
   726 	EBodyEntry,
       
   727 	EUnknownEntry,
       
   728 	EHeaderAndBodyEntry		
       
   729 	};
       
   730 
       
   731 
       
   732 #endif 				// #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
       
   733 
       
   734 /**
       
   735 Temporary ID used for testing purpose
       
   736 @publishedAll
       
   737 @released
       
   738 @see TMsvId
       
   739 @see KMsvTempIndexEntryIdValue
       
   740 */
       
   741 const TMsvId KMsvTempIndexEntryId = KMsvTempIndexEntryIdValue;//1
       
   742 
       
   743 /**
       
   744 @publishedAll
       
   745 @released
       
   746 @see TMsvId
       
   747 */
       
   748 const TMsvId KFirstFreeEntryId=0x100000;
       
   749 		
       
   750 
   614 #include <msvstd.inl>
   751 #include <msvstd.inl>
   615 
   752 
   616 #endif
   753 #endif