|
1 /* |
|
2 * Copyright (c) 2005 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: Implements instant messaging services interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCAIMPSIMCLIENT_H |
|
21 #define CCAIMPSIMCLIENT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "MCAImpsImClient.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class RImpsEng; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Implements MCAImpsImClient. |
|
33 * Forwards requests to RImpsImClient |
|
34 * |
|
35 * @lib CAAdapter.dll |
|
36 * @since 1.2 |
|
37 */ |
|
38 class CCAImpsImClient : public CBase, public MCAImpsImClient |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @param aImpsEng Reference to RImpsEng. |
|
45 */ |
|
46 static CCAImpsImClient* NewL( RImpsEng& aImpsEng ); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 ~CCAImpsImClient(); |
|
52 |
|
53 public: // Functions from base classes |
|
54 |
|
55 /** |
|
56 * @see RImpsImClient2 |
|
57 */ |
|
58 void RegisterL( |
|
59 MImpsImHandler2* aImpsObserver, |
|
60 MImpsBlockingHandler2* aBlockingHandler, |
|
61 TUid aApplicationId, |
|
62 TInt aPriority = 0 ); |
|
63 |
|
64 /** |
|
65 * @see RImpsImClient2 |
|
66 */ |
|
67 void Unregister(); |
|
68 |
|
69 // MESSAGING |
|
70 |
|
71 /** |
|
72 * @see RImpsImClient2 |
|
73 */ |
|
74 // This is an adapter to IMPS Engine API, we cannot |
|
75 // influence the const descriptor pointer parameter passing |
|
76 // in the API. |
|
77 TInt SendTextMessageL( const TDesC* aSenderSn, // CSI: 17 # See description |
|
78 const MDesCArray* aUserIds, |
|
79 const TDesC* aGroupId, // CSI: 17 # See description |
|
80 const MDesCArray* aScreenNames, |
|
81 const TDesC& aContent, |
|
82 TBool aDeliveryReportWanted ); |
|
83 |
|
84 /** |
|
85 * @see RImpsImClient2 |
|
86 */ |
|
87 // This is an adapter to IMPS Engine API, we cannot |
|
88 // influence the const descriptor pointer parameter passing |
|
89 // in the API. |
|
90 TInt SendContentMessageL( const TDesC* aSenderSn, // CSI: 17 # See description |
|
91 const MDesCArray* aUserIds, |
|
92 const TDesC* aGroupId, // CSI: 17 # See description |
|
93 const MDesCArray* aScreenNames, |
|
94 const TDesC& aContentType, |
|
95 const TDesC8& aContent, |
|
96 TBool aDeliveryReportWanted ); |
|
97 |
|
98 /** |
|
99 * @see RImpsImClient2 |
|
100 */ |
|
101 TInt BlockEntityRequestL( const CDesCArray* aBlockEntity, |
|
102 const CDesCArray* aUnBlockEntity, |
|
103 TBool aBlockedListInUse, |
|
104 const CDesCArray* aGrantedEntityList, |
|
105 const CDesCArray* aUnGrantEntity, |
|
106 TBool aGrantedListInUse ); |
|
107 |
|
108 /** |
|
109 * @see RImpsImClient2 |
|
110 */ |
|
111 TInt GetBlockedListRequestL(); |
|
112 |
|
113 /** |
|
114 * Register an error event observer. |
|
115 * If this is not registered then a client does not |
|
116 * receive error events from WV engine. |
|
117 * An application may implement only one HandleErrorL method |
|
118 * and give pointer to it in each WV client instance. |
|
119 * @since 1.2 |
|
120 * @param aObs error event observer |
|
121 */ |
|
122 void RegisterErrorObserverL( MImpsErrorHandler2 &aObs ); |
|
123 |
|
124 /** |
|
125 * Registers the service status change observer. |
|
126 * This can be called any time |
|
127 * @since 1.2 |
|
128 * @param aObs status observer implementation. Ownership NOT transferred. |
|
129 */ |
|
130 void RegisterStatusObserverL( MImpsStatusHandler2* aObs ); |
|
131 |
|
132 /** |
|
133 * Unregisters an error observer. |
|
134 * Forwards the call to WV Engine always |
|
135 * This method is not necessary if unregister of the particular |
|
136 * client has been executed (Unregister). |
|
137 * @since 1.2 |
|
138 */ |
|
139 void UnregisterErrorObserverL(); |
|
140 |
|
141 /** |
|
142 * Get the maximum TransactionContent size that WV engine |
|
143 * and WV server can handle, related to ParserSize. |
|
144 * Note that if service negotiation is not finished, this |
|
145 * method returns 0. |
|
146 * |
|
147 * @since 3.0 |
|
148 * @return size or zero |
|
149 */ |
|
150 TInt MaxTransactionContentLengthL( ); |
|
151 |
|
152 /** |
|
153 * Unregisters the service status change observer. |
|
154 * Forwards the call to WV Engine always |
|
155 * This method is not necessary if unregister of the particular |
|
156 * client type has been executed (Unregister). |
|
157 * @since 1.2 |
|
158 */ |
|
159 void UnregisterStatusObserverL(); |
|
160 |
|
161 /** |
|
162 * Internal use only. |
|
163 * Error observer accessor |
|
164 * @since 1.2 |
|
165 * @return error observer pointer. Ownership NOT transferred. |
|
166 */ |
|
167 MImpsErrorHandler2* ErrorHandler() const; |
|
168 |
|
169 /** |
|
170 * Internal use only. |
|
171 * Status observer accessor. This is missing from WV Engine. |
|
172 * Introduced for consistency. |
|
173 * @since 1.2 |
|
174 * @return Status observer pointer. Ownership NOT transferred. |
|
175 */ |
|
176 MImpsStatusHandler2* StatusHandler() const; |
|
177 |
|
178 /** |
|
179 * Available services accessor |
|
180 * Notice that there are no services in NOT_LOGGED state, i.e. |
|
181 * before login has been executed successfully from any client. |
|
182 * @param aServices Service tree having all supported features |
|
183 * and functions. |
|
184 * @since 1.2 |
|
185 */ |
|
186 void GetServicesL( TImpsServices& aServices ); |
|
187 |
|
188 /** |
|
189 * Used to get the interface. Visible because we need |
|
190 * to force lazy initialization (i.e. CCAImpsImClient |
|
191 * needs to do non-lazy init actually). |
|
192 * @see MCAImpsImClient.h |
|
193 */ |
|
194 RImpsImClient2* InterfaceL(); |
|
195 |
|
196 |
|
197 private: |
|
198 |
|
199 /** |
|
200 * C++ default constructor. |
|
201 * @param aImpsEng Reference to RImpsEng. |
|
202 */ |
|
203 CCAImpsImClient( RImpsEng& aImpsEng ); |
|
204 |
|
205 private: // Data |
|
206 |
|
207 // WV Engine IM interface. |
|
208 RImpsImClient2 iClient; |
|
209 |
|
210 // Indicator if we are doing lazy initialization with WV Engine. |
|
211 TBool iLazyInitialization; |
|
212 |
|
213 // Indicator if we have registered WV Engine interface. |
|
214 TBool iRegistered; |
|
215 |
|
216 // Store priority if we are doing lazy initialization. |
|
217 TInt iPriority; |
|
218 |
|
219 // Store application id if we are doing lazy initialization. |
|
220 TUid iApplicationId; |
|
221 |
|
222 // IM observer, stored in lazy initialization. Doens't own. |
|
223 MImpsImHandler2* iImHandler; |
|
224 |
|
225 // Blocking observer, stored in lazy initialization. Doens't own. |
|
226 MImpsBlockingHandler2* iBlockingHandler; |
|
227 |
|
228 // Status observer, stored in lazy initialization. Doens't own. |
|
229 MImpsStatusHandler2* iStatusHandler; |
|
230 |
|
231 // Error observer, stored in lazy initialization. Doens't own. |
|
232 MImpsErrorHandler2* iErrorHandler; |
|
233 |
|
234 // Reference to IMPS engine server session instance. |
|
235 RImpsEng& iImpsEng; |
|
236 }; |
|
237 |
|
238 #endif // MCAIMPSIMCLIENT_H |
|
239 |
|
240 // End of File |