|
1 /* |
|
2 * Copyright (c) 2006-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 * Name : stdiosesion.h |
|
16 * Part of : stdio server |
|
17 * To implement the stdio session |
|
18 * |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef __STDIOSESSION_H__ |
|
26 #define __STDIOSESSION_H__ |
|
27 |
|
28 |
|
29 #include "inidata.h" //CIniData |
|
30 #include "StdioServer.h" //CStdioServer |
|
31 #include "streambase.h" //CStreamBase2 |
|
32 #include "ReadRequestHandler.h" |
|
33 |
|
34 |
|
35 //ini file path and name |
|
36 _LIT(KFileName, "\\system\\data\\config.ini"); |
|
37 |
|
38 class CStreamFactoryBase; |
|
39 |
|
40 |
|
41 //----------------------------------------------------------------------- |
|
42 //Class name: CStdioSession |
|
43 //Description: Implement a session for the stdio redirection server. |
|
44 // This class contains the handle stream class for a |
|
45 // particular media type. The type of media is read from the |
|
46 // config.ini file. |
|
47 //----------------------------------------------------------------------- |
|
48 |
|
49 class CStdioSession : public CSession2 |
|
50 { |
|
51 public: |
|
52 static CSession2* NewL(); |
|
53 void ServiceL(const RMessage2&); |
|
54 virtual void CreateL(); |
|
55 ~CStdioSession(); |
|
56 |
|
57 private: |
|
58 CStdioSession() |
|
59 { |
|
60 // nada |
|
61 } |
|
62 |
|
63 void ReadIniL(CIniData* aIniData,TPtrC& aMedia, |
|
64 CStreamBase*& aStream,TBool aIsWrite); |
|
65 void ConstructL(); |
|
66 CStdioServer& Server(); |
|
67 TInt WriteStream(const RMessage2& aMessage); |
|
68 CStreamBase* iStreamRead; |
|
69 CStreamBase* iStreamWrite; |
|
70 CIniData* iIniData; |
|
71 CReadRequestHandler* iReadRequestHandler; |
|
72 TBuf8<256> iErrInBuf; |
|
73 TBuf8<256> iErrOutBuf; |
|
74 TBool iIsInputConsole; |
|
75 TBool iIsInMediaFile; |
|
76 }; |
|
77 |
|
78 |
|
79 #endif //__STDIOSESSION_H__ |