|
1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Manasij Roy, Nalina Hariharan |
|
14 */ |
|
15 |
|
16 #ifndef SMFCLIENTSYMBIANSESSION_H_ |
|
17 #define SMFCLIENTSYMBIANSESSION_H_ |
|
18 |
|
19 #include <e32cmn.h> |
|
20 #include <QByteArray> |
|
21 #include <QString> |
|
22 #include <QVariant> |
|
23 #include <QList> |
|
24 #include "smfglobal.h" |
|
25 |
|
26 /** |
|
27 * Corresponds to client session in Symbian |
|
28 */ |
|
29 class RSmfClientSymbianSession : public RSessionBase |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Constructs |
|
34 */ |
|
35 RSmfClientSymbianSession(); |
|
36 /** |
|
37 * Creates the server process if not already running and creates session |
|
38 * @return Error code while creating server process/ creating session |
|
39 */ |
|
40 TInt connectToServer(); |
|
41 TVersion Version() const{return TVersion(0,0,1);}; |
|
42 /** |
|
43 * Calls SendReceive with requestType opcode and packaged data |
|
44 * depending on requestType |
|
45 */ |
|
46 TInt sendRequest(SmfRequestTypeID requestType); |
|
47 void Close(){}; |
|
48 bool isConnected(); |
|
49 bool connected; |
|
50 void sendAsyncRequest(QByteArray& aSerializedData, |
|
51 QString aInterfaceName, |
|
52 SmfRequestTypeID aRequestType, |
|
53 TRequestStatus& aStatus); |
|
54 /** |
|
55 * This for getservices only |
|
56 */ |
|
57 TPtr8 sendSyncRequest(QString aInterfaceName, |
|
58 SmfRequestTypeID aRequestType); |
|
59 void writeLog(QString log) const; |
|
60 /** |
|
61 * Returns data,used to return back the data received from server |
|
62 */ |
|
63 TPtr8 getData() |
|
64 { |
|
65 return iDataPtr; |
|
66 } |
|
67 TInt getLastRequest() |
|
68 { |
|
69 return iLastRequest; |
|
70 } |
|
71 /** |
|
72 * Following are to form message body. |
|
73 */ |
|
74 QByteArray iBaseProvider; |
|
75 TBuf8<525> iProviderSymbian; |
|
76 TBuf<125> iInterfaceSymbian; |
|
77 TBuf8<125> iInterfaceSymbian8; |
|
78 QString iInterfaceName; |
|
79 QByteArray iInterfaceNamebyte; |
|
80 |
|
81 TPtr8 iDataPtr; |
|
82 TPtr iDataPtr16; |
|
83 HBufC8* iBuffer; |
|
84 HBufC* iBuffer16; |
|
85 HBufC* iIntfNameBuffer; |
|
86 HBufC8* iIntfNameBuffer8; |
|
87 HBufC8* iProviderBuf; |
|
88 TPtr8 iPtrProvider; |
|
89 TPtr iIntfNamePtr; |
|
90 TPtr8 iIntfNamePtr8; |
|
91 |
|
92 TInt iMaxMessageSize; |
|
93 /** |
|
94 * Last request opcode |
|
95 */ |
|
96 TInt iLastRequest; |
|
97 |
|
98 private: |
|
99 QList<QVariant*> result; |
|
100 |
|
101 |
|
102 |
|
103 }; |
|
104 #endif /* SMFCLIENTSYMBIANSESSION_H_ */ |