sl@0: /*
sl@0: * Copyright (c) 2006-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: * Name        : stdioserver.h
sl@0: * Part of     : stdio server
sl@0: * To implement the server
sl@0: * 
sl@0: *
sl@0: */
sl@0: 
sl@0: 
sl@0: 
sl@0:  
sl@0: 
sl@0: #ifndef __STDIOSERVER_H__
sl@0: #define __STDIOSERVER_H__
sl@0: 
sl@0: #include <f32file.h>
sl@0: #include <c32comm.h>
sl@0: 
sl@0: #include "ShutDown.h"
sl@0: 
sl@0: /*
sl@0: Messages supported by server.
sl@0: */
sl@0: enum TRedirStream 
sl@0: 	{
sl@0: 	ERead,
sl@0: 	EWrite,
sl@0: 	EFlush,
sl@0: 	ECheckMedia,
sl@0: 	ENotifyActivity,
sl@0: 	ECancelNotify,
sl@0: 	EEcho
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /*
sl@0: server name
sl@0: */
sl@0: _LIT(KServerName,"StdioServer");
sl@0: 
sl@0: 
sl@0: /*
sl@0: A version must be specified when creating a session with the server
sl@0: */
sl@0: const TUint KStdioServMajorVersionNumber=1;
sl@0: 
sl@0: const TUint KStdioServMinorVersionNumber=0;
sl@0: 
sl@0: const TUint KStdioServBuildVersionNumber=0;
sl@0: 
sl@0: 
sl@0: //-----------------------------------------------------------------------
sl@0: //Class name: 	CStdioServer
sl@0: //Description: 	Implements the STDIO redirection server.
sl@0: //				This class handles all redirection requests from client
sl@0: //				process.
sl@0: //-----------------------------------------------------------------------
sl@0:  
sl@0: class CStdioServer : public CServer2
sl@0: 	{
sl@0: public:
sl@0: 	static CServer2* NewL();
sl@0: 	static RFs& FsSession();
sl@0: 	static RCommServ& CsSession();
sl@0: 	void AddSession();
sl@0: 	void RemoveSession();
sl@0: 	void SetStreamFactory();
sl@0: 	~CStdioServer();
sl@0: 	
sl@0: private:
sl@0: 	CStdioServer(CActive::TPriority aPriority);
sl@0: 	CSession2* NewSessionL(const TVersion&,const RMessage2&)const;
sl@0: 	void ConstructL();
sl@0: 	static RFs iFs;
sl@0: 	static RCommServ iCs;
sl@0: 	TInt iSessionCount;
sl@0: 	CShutDown *iShutDown;
sl@0: 	};
sl@0: 
sl@0: #endif //__STDIOSERVER_H__
sl@0: 
sl@0: 
sl@0: 
sl@0: