|
1 /* |
|
2 * Copyright (c) 2006 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: XIMP Framework PSC Server context session. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef XIMPSRVCONTEXTCLIENT_H__ |
|
19 #define XIMPSRVCONTEXTCLIENT_H__ |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <ximpbase.h> |
|
23 |
|
24 |
|
25 class CXIMPContextEventFilter; |
|
26 class CXIMPServiceInfoImp; |
|
27 class CXIMPFeatureInfoImp; |
|
28 class CBufFlat; |
|
29 |
|
30 |
|
31 /** |
|
32 * XIMP Framework server context session. |
|
33 * |
|
34 * @lib ximpsrvclient.dll |
|
35 * @since S60 v3.2 |
|
36 */ |
|
37 class RXIMPSrvContextClient : public RSessionBase |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Default constructor. |
|
43 */ |
|
44 IMPORT_C RXIMPSrvContextClient(); |
|
45 |
|
46 |
|
47 /** |
|
48 * Session connection method. |
|
49 * @param aProtocolImpUid The UID of protocol to associate with |
|
50 * this context client. |
|
51 */ |
|
52 IMPORT_C void ConnectL( TUid aProtocolImpUid ); |
|
53 |
|
54 |
|
55 /** |
|
56 * Closes server connection. |
|
57 */ |
|
58 IMPORT_C void Close(); |
|
59 |
|
60 |
|
61 /** |
|
62 * Issues context operation request to server. |
|
63 * |
|
64 * @param aOperationType In parameter identifying the operation. |
|
65 * @param aOperationParams In parameter package for operation. |
|
66 * @param aReqId Request ID identifying started request. |
|
67 * @return Error from issuing the request. |
|
68 */ |
|
69 IMPORT_C TInt DoQueueOperation( |
|
70 TInt aOperationType, |
|
71 const TDesC8& aOperationParams, |
|
72 TXIMPRequestId& aReqId ); |
|
73 |
|
74 |
|
75 /** |
|
76 * Issues context operation request to server. |
|
77 * To be used when binding with settings id |
|
78 * |
|
79 * @param aOperationType In parameter identifying the operation. |
|
80 * @param aOperationParams In parameter package for operation. |
|
81 * @param aReqId Request ID identifying started request. |
|
82 * @return Error from issuing the request. |
|
83 */ |
|
84 IMPORT_C TInt DoQueueOperation2( |
|
85 TInt aOperationType, |
|
86 const TDesC8& aOperationParams, |
|
87 TXIMPRequestId& aReqId ); |
|
88 |
|
89 /** |
|
90 * Gets presence contexts features. |
|
91 * |
|
92 * @return Presence context features as an externalized |
|
93 * CXIMPFeatureInfoImp. Object ownership is returned to caller. |
|
94 */ |
|
95 IMPORT_C HBufC8* GetContextFeaturesL() const; |
|
96 |
|
97 |
|
98 /** |
|
99 * Issues asynchronous request to listen presence context |
|
100 * events. |
|
101 * |
|
102 * @param aStatus Request status to complete |
|
103 * when new event object is available. |
|
104 */ |
|
105 IMPORT_C void ListenEvent( TRequestStatus& aStatus ); |
|
106 |
|
107 |
|
108 /** |
|
109 * Cancels event listen request. |
|
110 */ |
|
111 IMPORT_C void CancelListening(); |
|
112 |
|
113 |
|
114 /** |
|
115 * Installs new event filter for presence context event queue. |
|
116 * |
|
117 * @return aFilterData Event filter data to use. |
|
118 */ |
|
119 IMPORT_C void InstallEventFilterL( const TDesC8& aFilterData ); |
|
120 |
|
121 |
|
122 /** |
|
123 * Gets event data from event queue. |
|
124 * |
|
125 * @return Event object data from event queue. |
|
126 * Object ownership is returned to caller. |
|
127 * Leaves with KErrNotFound if there isn't |
|
128 * any event available in event queue. |
|
129 */ |
|
130 IMPORT_C HBufC8* FetchTopEventDataLC(); |
|
131 |
|
132 |
|
133 /** |
|
134 * Fetch top event req id. |
|
135 * |
|
136 * @param aReqId On the return contains, the top event req id. |
|
137 * |
|
138 * @return Error from req id fetch. |
|
139 */ |
|
140 IMPORT_C TInt FetchTopEventReqId( TXIMPRequestId& aReqId ); |
|
141 |
|
142 |
|
143 /** |
|
144 * Drops top event from event queue. |
|
145 * |
|
146 * @return Error from drop. |
|
147 */ |
|
148 IMPORT_C TInt DropTopEvent(); |
|
149 |
|
150 |
|
151 private: |
|
152 |
|
153 /** |
|
154 * Helper to prepare and get data from server side. |
|
155 * |
|
156 * @return Externalized object to be passed onward |
|
157 */ |
|
158 HBufC8* PrepareAndGetDataL( TInt aMsg ) const; |
|
159 |
|
160 |
|
161 private: |
|
162 |
|
163 /** |
|
164 * UID of the used protocol. |
|
165 */ |
|
166 TUid iMyUid; |
|
167 |
|
168 }; |
|
169 |
|
170 |
|
171 #endif // XIMPSRVCONTEXTCLIENT_H__ |
|
172 |
|
173 |
|
174 |