email/imap4mtm/imapsession/inc/cimaplistbase.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 //
       
    15 
       
    16 #ifndef __CIMAPLISTBASE_H__
       
    17 #define __CIMAPLISTBASE_H__
       
    18 
       
    19 #include <e32std.h>
       
    20 
       
    21 #include "cimapcommand.h"
       
    22 #include "cimapsession.h"
       
    23 #include "cimaplistfolderinfo.h"
       
    24 
       
    25 class CImapAtomParser;
       
    26 class CImapAtomWalker;
       
    27 
       
    28 /**
       
    29 Provides the implementation for the sending, receiving and parsing of the IMAP LIST and LSUB commands.
       
    30 @internalTechnology
       
    31 @prototype
       
    32 */
       
    33 class CImapListBase : public CImapCommandEx
       
    34 	{
       
    35 public:
       
    36 	// Construction and Destruction
       
    37 	~CImapListBase();
       
    38 	
       
    39 protected:
       
    40 	CImapListBase(CImapFolderInfo* aSelectedFolderData, TInt aLogId, RArrayImapListFolderInfo& aFolderList, const CImapSettings& aImapSettings, const TDesC8& aSendMessageFormat, const TDesC8& aResponseIdentifier);
       
    41 	void ConstructL(const TDesC& aReferenceName, const TDesC& aMailboxName);
       
    42 
       
    43 private:
       
    44 	// Implements CImapCommand
       
    45 	void SendMessageL(TInt aTagId, MOutputStream& aStream);
       
    46 	
       
    47 	TParseBlockResult ParseUntaggedResponseL();
       
    48 	void ParseLiteralBlockL();
       
    49 	TBool ParseLineFollowingLiteralL();
       
    50 
       
    51 	CImapCommand::TParseBlockResult ParseResponseL();
       
    52 	void ProcessMailboxListL();
       
    53 	void ProcessMailboxListFlagsL(CImapListFolderInfo& aFolderInfo);
       
    54 	void ProcessHeirarchySeparatorL(CImapListFolderInfo& aFolderInfo);
       
    55 	void ProcessMailboxL(CImapListFolderInfo& aFolderInfo);
       
    56 
       
    57 private:
       
    58 	HBufC8* iReferenceName;
       
    59 	HBufC8* iMailboxName;
       
    60 	RArrayImapListFolderInfo& iFolderList;
       
    61 	
       
    62 	const TDesC8& iSendMessageFormat;
       
    63 	const TDesC8& iResponseIdentifier;
       
    64 	
       
    65 	CImapAtomParser* iAtomParser;
       
    66 	CImapAtomWalker* iAtomWalker;
       
    67 	
       
    68 	enum TListParseState {
       
    69 		EWaitingForResponse,	
       
    70 		EWaitingForLiteral,	
       
    71 		EWaitingForLine,	
       
    72 		} iListParseState;
       
    73 
       
    74 	const CImapSettings& iImapSettings;
       
    75 
       
    76 	};
       
    77 
       
    78 #endif // __CIMAPLISTBASE_H__