sl@0: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: // Abstract stream classes for Stdio Redirection app sl@0: // sl@0: #ifndef _REDIRSTR_H_ sl@0: #define _REDIRSTR_H_ sl@0: sl@0: #include sl@0: #include sl@0: /** sl@0: Maximum size of TBuf<> data member in the CStreamFactoryBase2 class. sl@0: @see CStreamFactoryBase2 sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: const TInt KMaxStatusTextLength = 128; sl@0: sl@0: // The following functions are defined to replace previous exports so def file sl@0: // does not need reordering. sl@0: IMPORT_C void DummyReserved9(); sl@0: IMPORT_C void DummyReserved10(); sl@0: IMPORT_C void DummyReserved11(); sl@0: sl@0: /** sl@0: Abstract class that defines stream like objects. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class CStreamBase2 : public CBase sl@0: { sl@0: public: sl@0: virtual void Write(TDes8& aDes) = 0; sl@0: virtual void Read(const RMessage2& aMessage) = 0; sl@0: protected: sl@0: TBuf8<256> iBuf; // buffer for holding stdin characters sl@0: IMPORT_C void CompleteRead(const RMessage2 &aMessage); sl@0: }; sl@0: sl@0: /** sl@0: Abstract Factory class for creating stream-like classes. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class CStreamFactoryBase2 : public CBase sl@0: { sl@0: public: sl@0: virtual CStreamBase2* GetStream() = 0; sl@0: virtual void Configure() = 0; sl@0: IMPORT_C virtual const TDesC& GetStatus() const; sl@0: protected: sl@0: IMPORT_C void AppendToStatus(const TDesC& aMsg); sl@0: private: sl@0: TBuf iStatusMsg; sl@0: }; sl@0: sl@0: sl@0: #endif