email/imap4mtm/imapsyncmanager/inc/cimapfolderindex.h
changeset 31 ebfee66fde93
parent 0 72b543305e3a
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     1 // Copyright (c) 2006-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 // IMAP Folder indexing header
       
    15 // 
       
    16 //
       
    17 
       
    18 #if !defined(__CIMAPFOLDERINDEX_H__)
       
    19 #define __CIMAPFOLDERINDEX_H__
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <e32base.h>
       
    23 #include <msvstd.h>
       
    24 
       
    25 /**
       
    26 Actual entries stored in the index
       
    27 @internalComponent
       
    28 @prototype
       
    29 */
       
    30 class CImapFolderIndexEntry:public CBase
       
    31 	{
       
    32 public:
       
    33 	CImapFolderIndexEntry();
       
    34 	CImapFolderIndexEntry(CImapFolderIndexEntry& aFrom);
       
    35 
       
    36 	CImapFolderIndexEntry& operator=(CImapFolderIndexEntry& aFrom);
       
    37 
       
    38 public:
       
    39 	TUint32			iUid;
       
    40 	TMsvId			iMsvId;
       
    41 	};
       
    42 
       
    43 class CImapFolderIndex:public CBase
       
    44 /**
       
    45 @internalComponent
       
    46 @released
       
    47 */
       
    48 	{
       
    49 public:
       
    50 	CImapFolderIndex();
       
    51 	~CImapFolderIndex();
       
    52 
       
    53 	// Clear index
       
    54 	void Reset();
       
    55 
       
    56 	// Note number of entries
       
    57 	void SetSizeL(const TUint aEntries);
       
    58 	TInt Size() const;
       
    59 
       
    60 	// Access an entry directly
       
    61 	CImapFolderIndexEntry& operator[] (const TInt aIndex);
       
    62 
       
    63 	// Sort index by UID
       
    64 	void Sort();
       
    65 
       
    66 	// Expunge a message
       
    67 	void Expunge(const TUint aMsgNr);
       
    68 
       
    69 	// Find a message number
       
    70 	TUint FindMsg(const TUint aMsgUid);
       
    71 
       
    72 private:
       
    73 	// Set a UID for a message number
       
    74 	void SetUid(const TUint aMsgNr, const TUint aMsgUid);
       
    75 
       
    76 	// Set a TMsvId for a message number
       
    77 	void SetMsvId(const TUint aMsgnr, const TMsvId aMsvId);
       
    78 
       
    79 private:
       
    80 	TInt								iSize;
       
    81 	CArrayFix<CImapFolderIndexEntry>*	iIndex;
       
    82 	};
       
    83 
       
    84 #endif //__CIMAPFOLDERINDEX_H__
       
    85