messagingfw/msgsrvnstore/server/inc/cmsvversion0version1converter.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2008-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CMSVVERSION0VERSION1CONVERTER_H__
       
    17 #define __CMSVVERSION0VERSION1CONVERTER_H__
       
    18 
       
    19 // includes
       
    20 #include <e32base.h>
       
    21 #include <s32file.h>
       
    22 #include <f32file.h>
       
    23 #include <msvstd.h>
       
    24 #include "msvdbadapter.h"
       
    25 #include "cmessageconvertermanager.h"
       
    26 #include "cmsvconverterwaiter.h"
       
    27 
       
    28 //constants
       
    29 const TInt KMsvStreamIndexGranularity=8;
       
    30 const TInt KIndexReadGranularity=10;
       
    31 
       
    32 
       
    33 // fwd declaration
       
    34 class MMsvMessageStoreConverter;
       
    35 
       
    36 /**
       
    37 CMsvVersion0Version1Converter
       
    38 This class derives from MMsvMessageStoreConverter and converts message store version 0 to store version 1
       
    39 It traverses the file containg the message information and inserts them into the database table.
       
    40 
       
    41 @internalAll 
       
    42 @released
       
    43 */
       
    44 NONSHARABLE_CLASS (CMsvVersion0Version1Converter): public CBase , public MMsvMessageStoreConverter
       
    45 {
       
    46 public:	
       
    47 	static CMsvVersion0Version1Converter* NewL(CMsvDBAdapter& aDBAapter,TDriveNumber aDriveNum,TBool aConversionResume);
       
    48 	~CMsvVersion0Version1Converter();
       
    49 	void ConvertMessageStoreL();
       
    50 	
       
    51 private:	
       
    52 	CMsvVersion0Version1Converter(CMsvDBAdapter& aDBAapter,TDriveNumber aDriveNum,TBool aConversionResume);	
       
    53 	void ConstructL();
       
    54 	void RestoreStreamIndexL();
       
    55 	void PopulateDatabaseL(TInt aFirstEntry, TInt aNextEntry);
       
    56 	TBool ReadNextEntriesL();
       
    57 	void InternalizeL(RReadStream& aStream);
       
    58 	void UpdateVisibleParentL();
       
    59 	TInt GetPropertyValue();
       
    60 private:
       
    61 	CPermanentFileStore* iIndexStore;
       
    62 	CArrayFixFlat<TStreamId>* iStream;
       
    63 	TInt iEntryStreamIndex;
       
    64 	CMsvDBAdapter& iDBAdapter;
       
    65 	
       
    66 	RFile iFileName;
       
    67 	TConversionResumeStatus iResumeStatus;
       
    68 	TDriveNumber iDrive;
       
    69 	TBool iResume;
       
    70 	
       
    71 	TMsvEntry iEntry;	
       
    72 	TMsvEntry iNext;
       
    73 	TMsvEntry iSibling;
       
    74 	TMsvEntry iChild;
       
    75 	TMsvDays	iLastChangeDays;
       
    76 	TMsvMinutes iLastChangeMinutes;
       
    77 	TMsvDays	iCreatedDays;
       
    78 	TMsvMinutes iCreatedMinutes;
       
    79 	HBufC* iDescriptionBuffer;
       
    80 	HBufC* iDetailsBuffer;
       
    81 #if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE)	
       
    82 	friend class CTestVersion0Version1Converter;
       
    83 #endif
       
    84 	};
       
    85 
       
    86 #endif // __CMSVVERSION0VERSION1CONVERTER_H__
       
    87 
       
    88