|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: IPC Server class using Symbian client-server |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef C_XQSERVICEIPCSERVER_APA_SYMBIAN_SESSION_H |
|
23 #define C_XQSERVICEIPCSERVER_APA_SYMBIAN_SESSION_H |
|
24 |
|
25 #include <QtCore/qobject.h> |
|
26 #include <e32base.h> |
|
27 #include <e32cmn.h> |
|
28 #include <apaserverapp.h> |
|
29 #include "xqserviceipcserversession.h" |
|
30 #include "xqsharablefile.h" |
|
31 |
|
32 namespace QtService { |
|
33 |
|
34 // Utilities |
|
35 bool AdoptSharableFile(const RMessage2& aMsg, XQSharableFile *file); |
|
36 quint32 ClientCapabilities(const RMessage2& aMsg); |
|
37 |
|
38 class CApaServerSymbianSession : public CApaAppServiceBase, public ServiceIPCSession |
|
39 { |
|
40 public: |
|
41 |
|
42 static CApaServerSymbianSession* NewL( MServiceIPCObserver* aObserver ); |
|
43 |
|
44 virtual ~CApaServerSymbianSession(); |
|
45 |
|
46 // From ServiceIPCSession |
|
47 protected: |
|
48 |
|
49 bool write(const QByteArray& aData); |
|
50 |
|
51 bool completeRequest(); |
|
52 |
|
53 void close(); |
|
54 |
|
55 // From CSession2 |
|
56 protected: |
|
57 |
|
58 void ServiceL(const RMessage2& aMessage); |
|
59 |
|
60 void Disconnect(const RMessage2 &aMessage); |
|
61 |
|
62 // Service methods |
|
63 private: |
|
64 |
|
65 void handleRequestL(const RMessage2& aMessage); |
|
66 |
|
67 void handleGetBufferL(const RMessage2& aMessage); |
|
68 |
|
69 HBufC* ReadDesLC(const RMessage2& aMessage, TInt aMsgSlot); |
|
70 |
|
71 HBufC8* ReadDes8LC(const RMessage2& aMessage, TInt aMsgSlot); |
|
72 private: |
|
73 |
|
74 CApaServerSymbianSession(MServiceIPCObserver* aObserver); |
|
75 |
|
76 void ConstructL(); |
|
77 |
|
78 private: |
|
79 // data |
|
80 RMessage2 iMessage; |
|
81 QByteArray iData; |
|
82 }; |
|
83 } |
|
84 #endif // C_XQSERVICEIPCSERVER_APA_SYMBIAN_SESSION_H |