applayerprotocols/telnetengine/SRC/IOBUFFER.H
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 /**
       
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Buffer class declarations
       
    16 * Contains I/O Buffer class declaration
       
    17 * 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  @file Iobuffer.h
       
    25  @internalComponent 
       
    26 */
       
    27 
       
    28 #ifndef __IO_BUFFERS_H
       
    29 #define __IO_BUFFERS_H
       
    30 
       
    31 #include <telsess.h>
       
    32 
       
    33 class MIONotifier
       
    34 /**
       
    35 @internalComponent
       
    36 */
       
    37 	{
       
    38 public:
       
    39 	
       
    40 	virtual void WriteComplete() = 0;
       
    41 	virtual void WriteError(TInt aError) = 0;
       
    42 	virtual void ReadComplete(TInt aError) = 0;
       
    43 	virtual void ReadCompleteL() = 0;
       
    44 	virtual void Event(TInt aEvent,TInt aEventCode) = 0;
       
    45 	};
       
    46 
       
    47 class CActiveWriter;
       
    48 class CActiveReader;
       
    49 
       
    50 NONSHARABLE_CLASS(CIOBufferControl) : public CBase , public MIONotifier
       
    51 /**
       
    52 @internalComponent
       
    53 */
       
    54 	{ 
       
    55 public:
       
    56 	CIOBufferControl();
       
    57 	~CIOBufferControl();
       
    58 
       
    59 	static CIOBufferControl* NewL(MIONotifier* aNotifier);
       
    60 	void ConstructL(MIONotifier* aNotifier);
       
    61 	TInt WriteUrgent(HBufC8* aBuffer);
       
    62 	
       
    63 	TInt Write(HBufC8* aBuffer);
       
    64 	TInt Read(TDes8& aBuffer);
       
    65 	void SetWriter(CActiveWriter* aWriter);
       
    66 	void SetReader(CActiveReader* aReader);
       
    67 
       
    68 	void Reset();
       
    69 
       
    70 	// MIONotifier
       
    71 	void WriteComplete();
       
    72 	void WriteError(TInt aError);
       
    73 	void ReadCompleteL();
       
    74 	void ReadComplete(TInt aError);
       
    75 	void Event(TInt aEvent,TInt aEventCode);
       
    76 
       
    77 public:
       
    78 
       
    79 private:
       
    80 	CActiveWriter*								iWriter;
       
    81 	CActiveReader*								iReader;
       
    82 	MIONotifier*								iNotifier;
       
    83 
       
    84 	HBufC8*										iWriteBuffers[2];
       
    85 	TInt iLiveIndex;
       
    86 	TInt iQueueIndex;
       
    87 	HBufC8*										iUrgent;
       
    88 
       
    89 	};
       
    90 
       
    91 #endif