diff -r 9f5ae1728557 -r db3f5fa34ec7 messagingfw/msgsrvnstore/server/inc/msvcachevisiblefolder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingfw/msgsrvnstore/server/inc/msvcachevisiblefolder.h Wed Nov 03 22:41:46 2010 +0530 @@ -0,0 +1,120 @@ +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// CMSVCACHEVISIBLEFOLDER.H +// +// + +#ifndef __CMSVCACHEVISIBLEFOLDER_H__ +#define __CMSVCACHEVISIBLEFOLDER_H__ + +#include +#include +#include +#include + +/** +Forward declarations. +*/ +class CMsvCacheIndexTableEntry; +class CMsvDBAdapter; +class CMsvCacheEntry; + + + +/** +Provides the implementation of the Cache Visible Folder list. + +This Class represents the list of visible folders, which holds the information +about the blocks and childrens which it corresponds to. + +@internalComponent +@prototype +*/ +NONSHARABLE_CLASS (CMsvCacheVisibleFolder) : public CBase + { +public: + static CMsvCacheVisibleFolder* NewL(TMsvId aId); + static CMsvCacheVisibleFolder* NewL(TMsvId aId, RPointerArray& aEntries); + ~CMsvCacheVisibleFolder(); + + void AddEntryL(CMsvCacheEntry*& aEntry, TBool aReplace = EFalse); + void AddEntryListL(RPointerArray& aEntries, TBool aIsCompleteChildOfFolder = EFalse); + TBool GetEntry(TMsvId aId, CMsvCacheEntry*& aEntry); + TBool GetChildrenL(TMsvId aId, CMsvDBAdapter* aDbAdapter, RPointerArray& aEntries); + TBool GetChildrenIdL(CMsvEntrySelection& aSelection); + void DeleteEntryL(TMsvId aId, TBool aForceDelete = EFalse); + void DeleteEntryListL(CMsvEntrySelection& aEntrySelection); + TBool EntryExists(TMsvId aId) const; + TBool IsAllBlocksDirty() const; + TBool ReleaseAllBlocks(TInt& aCount); + TInt ReleaseBlocks(TInt aNumberOfEntriesToRelease, TBool& aIsFolderEmpty); + void UpdateChildMsvIdsL(TMsvId aParentId, TMsvId aChildId, TBool aAppend = ETrue); + void UpdateChildMsvIdsL(RPointerArray& aEntries); + void SplitBlockL(); + RPointerArray* GetIndexTableEntry(); + inline TBool IsComplete() const; + inline void SetComplete(TBool aStatus); + inline TMsvId GetFolderId() const; + inline void SetGetChildrenFromVisibleFolder(TBool aFlag); + inline TBool GetChildrenFromVisibleFolder(); + +#if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) + inline TUint GetDrive() const; + inline void SetDrive(TUint aDriveId); +#endif + +#if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE) +#ifdef _DEBUG + void Print(RFileLogger& aLogger); +#endif +#endif + +private: + CMsvCacheVisibleFolder(TMsvId aId); + void ConstructL(RPointerArray& aEntries); + void SplitAndAppendL(RPointerArray& aEntryList, TInt aInitIndex=0); +public: + TDblQueLink iDlink; + static const TInt iOffset; + +private: + TMsvId iVisibleFolderId; + TInt8 iFlags; + TTime iAccessTime; + RPointerArray iIndexTable; + +#if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) + TUint iDriveId; +#endif + + enum + { + EMsvCacheVisibleFolderClearFlag = 0X00, + EMsvCacheVisibleFolderComplete = 0X02, + EMsvCacheVisibleFolderClearComplete = 0XF9, + EMsvGetChildrenFromVisibleFolder = 0X04, + }; + +private: +#if (defined SYMBIAN_MESSAGESTORE_UNIT_TESTCODE) + friend class CTestVisibleFolder; //only for testing +#endif + }; + + +#include "msvcachevisiblefolder.Inl" + +#endif // __CMSVCACHEVISIBLEFOLDER_H__ + +