email/pop3andsmtpmtm/imapservermtm/inc/FLDINDEX.H
changeset 25 84d9eb65b26f
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     1 // Copyright (c) 1998-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(__FLDINDEX_H__)
       
    19 #define __FLDINDEX_H__
       
    20 
       
    21 #if !defined(__E32STD_H__)
       
    22 #include <e32std.h>
       
    23 #endif
       
    24 #if !defined(__E32BASE_H__)
       
    25 #include <e32base.h>
       
    26 #endif
       
    27 
       
    28 // We need this for TMsvId
       
    29 #include <msvstd.h>
       
    30 
       
    31 // Actual entries stored in the index
       
    32 class CImImap4IndexEntry:public CBase
       
    33 /**
       
    34 @internalComponent
       
    35 @released
       
    36 */
       
    37 	{
       
    38 public:
       
    39 	CImImap4IndexEntry();
       
    40 	CImImap4IndexEntry(CImImap4IndexEntry& aFrom);
       
    41 
       
    42 	CImImap4IndexEntry& operator=(CImImap4IndexEntry& aFrom);
       
    43 
       
    44 public:
       
    45 	TUint32			iUid;
       
    46 	TMsvId			iMsvId;
       
    47 	};
       
    48 
       
    49 class CImImap4FolderIndex:public CBase
       
    50 /**
       
    51 @internalComponent
       
    52 @released
       
    53 */
       
    54 	{
       
    55 public:
       
    56 	CImImap4FolderIndex();
       
    57 	~CImImap4FolderIndex();
       
    58 
       
    59 	// Clear index
       
    60 	void Reset();
       
    61 
       
    62 	// Note number of entries
       
    63 	void SetSizeL(const TUint aEntries);
       
    64 	TInt Size();
       
    65 
       
    66 	// Access an entry directly
       
    67 	CImImap4IndexEntry& operator[] (const TInt aIndex);
       
    68 
       
    69 	// Sort index by UID
       
    70 	void Sort();
       
    71 
       
    72 	// Expunge a message
       
    73 	void Expunge(const TUint aMsgNr);
       
    74 
       
    75 private:
       
    76 	// Set a UID for a message number
       
    77 	void SetUid(const TUint aMsgNr, const TUint aMsgUid);
       
    78 
       
    79 	// Set a TMsvId for a message number
       
    80 	void SetMsvId(const TUint aMsgnr, const TMsvId aMsvId);
       
    81 
       
    82 	// Find a message number
       
    83 	TUint FindMsg(const TUint aMsgUid);
       
    84 
       
    85 private:
       
    86 	TInt								iSize;
       
    87 	CArrayFix<CImImap4IndexEntry>*		iIndex;
       
    88 	};
       
    89 #endif