email/imap4mtm/imapsession/inc/cimapidle.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 
       
    17 #ifndef __CIMAPIDLE_H__
       
    18 #define __CIMAPIDLE_H__
       
    19 
       
    20 #include <e32std.h>
       
    21 
       
    22 #include "cimapcommand.h"
       
    23 
       
    24 /**
       
    25 Provides implementation of the IDLE command, as specified in RFC 2177.
       
    26 All untagged responses are handled by the base class.
       
    27 @internalTechnology
       
    28 @prototype
       
    29 */
       
    30 class CImapIdle : public CImapCommandEx
       
    31 	{
       
    32 public:
       
    33 	enum TIdleState
       
    34 		{
       
    35 		/**
       
    36 		The IDLE command has been issued, and we are waiting for the server to 
       
    37 		send the continiation response.
       
    38 		Any untagged responses that are received before the continuation response
       
    39 		will be parsed but a notification will not be sent until the continuation response
       
    40 		has been received.
       
    41 		*/
       
    42 		EIdleWaitContinue,
       
    43 		/**
       
    44 		The continuation response has now been received, so every untagged response
       
    45 		will cause a notification.
       
    46 		*/
       
    47 		EIdleWaitResponse,
       
    48 		/**
       
    49 		The DONE command has been issued, and we are waiting for the tagged OK respose.
       
    50 		Any untagged responses that are received before the tagged OK response
       
    51 		will be parsed, but no notifications will be sent, other than the one for the tagged OK response.
       
    52 		*/
       
    53 		EIdleWaitDone
       
    54 		};
       
    55 
       
    56 	// Construction and Destruction
       
    57 	static CImapIdle* NewL(CImapFolderInfo* aSelectedFolderData, TInt aLogId);
       
    58 	~CImapIdle();
       
    59 	
       
    60 	void SendDone(MOutputStream& aStream);
       
    61 	TIdleState IdleState(); 
       
    62 	
       
    63 private:
       
    64 	CImapIdle(CImapFolderInfo* aSelectedFolderData, TInt aLogId);
       
    65 	void ConstructL();
       
    66 	
       
    67 	// Implements CImapCommand
       
    68 	void SendMessageL(TInt aTagId, MOutputStream& aStream);
       
    69 	void Cancel();
       
    70 	
       
    71 	void ParseContinuationResponseL();	
       
    72 	
       
    73 private:
       
    74 	// No data for send
       
    75 	// No data for receive (the only expected responses are unsolicited which are all handle by the base class)
       
    76 	
       
    77 	TIdleState iIdleState;	
       
    78 	};
       
    79 			 
       
    80 #endif // __CIMAPIDLE_H__