|
1 /** |
|
2 This file is part of CWRT package ** |
|
3 |
|
4 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** |
|
5 |
|
6 This program is free software: you can redistribute it and/or modify |
|
7 it under the terms of the GNU (Lesser) General Public License as |
|
8 published by the Free Software Foundation, version 2.1 of the License. |
|
9 This program is distributed in the hope that it will be useful, but |
|
10 WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 (Lesser) General Public License for more details. You should have |
|
13 received a copy of the GNU (Lesser) General Public License along |
|
14 with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef C_SERVICEIPC_SYMBIAH_H |
|
19 #define C_SERVICEIPC_SYMBIAH_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <serviceipc_p.h> |
|
23 #include "serviceipcsymbiansession.h" |
|
24 |
|
25 namespace WRT { |
|
26 |
|
27 class CServiceSymbianIPC : public CActive, public ServiceFwIPCPrivate |
|
28 { |
|
29 |
|
30 public: |
|
31 |
|
32 virtual ~CServiceSymbianIPC(); |
|
33 |
|
34 static CServiceSymbianIPC* NewL(); |
|
35 |
|
36 // From ServiceFwIPCPrivate |
|
37 protected: |
|
38 |
|
39 bool connect(const QString& aServerName); |
|
40 |
|
41 void disconnect(); |
|
42 |
|
43 bool startServer(const QString& aServerName, const QString& aExeName); |
|
44 |
|
45 bool sendSync(const QString& aRequestType, const QByteArray& aData); |
|
46 |
|
47 void sendAsync(const QString& aRequestType, const QByteArray& aData); |
|
48 |
|
49 QByteArray readAll(); |
|
50 |
|
51 bool waitForRead(); |
|
52 |
|
53 // From CActive |
|
54 protected: |
|
55 |
|
56 void RunL(); |
|
57 |
|
58 void DoCancel(); |
|
59 |
|
60 private: |
|
61 |
|
62 QByteArray doReadAllL(); |
|
63 |
|
64 int doMapErrors( TInt aError ); |
|
65 |
|
66 private: |
|
67 |
|
68 CServiceSymbianIPC(); |
|
69 |
|
70 void ConstructL(); |
|
71 |
|
72 private: |
|
73 RServiceIPCSession iSession; |
|
74 HBufC8* iAsyncData; // member variable to keep alive any data for async ops |
|
75 TPtrC8 iAsyncDataPtr; |
|
76 HBufC* iRequestData; |
|
77 TPtrC iRequestDataPtr; |
|
78 TInt iDataSize; |
|
79 }; |
|
80 } |
|
81 #endif // C_SERVICEIPC_SYMBIAH_H |