|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Oss Protocol im conversation implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <ximpbase.h> |
|
19 #include <ximpidentity.h> |
|
20 #include <ximpprotocolconnectionhost.h> |
|
21 #include "cossprotocolimconversation.h" |
|
22 #include "cossprotocolconnectionmanager.h" |
|
23 #include "cosssendmessagerequest.h" |
|
24 #include "mossprotocolconnectionmanager.h" |
|
25 #include "ossprotocolpluginpanics.h" |
|
26 #include <imconversationinfo.h> |
|
27 |
|
28 // ======== MEMBER FUNCTIONS ======== |
|
29 |
|
30 // --------------------------------------------------------------------------- |
|
31 // COSSProtocolImConversation::GetInterface() |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 TAny* COSSProtocolImConversation::GetInterface ( TInt32 aInterfaceId, |
|
35 TIfGetOps aOptions ) |
|
36 { |
|
37 //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() Start" ) ); |
|
38 |
|
39 if ( aInterfaceId == MProtocolImConversation::KInterfaceId ) |
|
40 { |
|
41 MProtocolImConversation* self = this; |
|
42 return self; |
|
43 } |
|
44 |
|
45 if ( aOptions == MXIMPBase::EPanicIfUnknown ) |
|
46 |
|
47 { |
|
48 User::Panic ( KOSSProtocolConversation, KErrExtensionNotSupported ); |
|
49 } |
|
50 |
|
51 //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() End" ) ); |
|
52 |
|
53 return NULL; |
|
54 } |
|
55 |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // COSSProtocolImConversation::GetInterface() |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 const TAny* COSSProtocolImConversation::GetInterface ( TInt32 aInterfaceId, |
|
62 TIfGetOps aOptions ) const |
|
63 { |
|
64 //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() Start" ) ); |
|
65 |
|
66 if ( aInterfaceId == MProtocolImConversation::KInterfaceId ) |
|
67 { |
|
68 const MProtocolImConversation* self = this; |
|
69 return self; |
|
70 } |
|
71 |
|
72 if ( aOptions == MXIMPBase::EPanicIfUnknown ) |
|
73 |
|
74 { |
|
75 User::Panic ( KOSSProtocolConversation, KErrExtensionNotSupported ); |
|
76 } |
|
77 |
|
78 //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() End" ) ); |
|
79 |
|
80 return NULL; |
|
81 } |
|
82 |
|
83 |
|
84 // --------------------------------------------------------------------------- |
|
85 // COSSProtocolImConversation::GetInterfaceId() |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 TInt32 COSSProtocolImConversation::GetInterfaceId() const |
|
89 { |
|
90 //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterfaceId() Start-End" ) ); |
|
91 return MProtocolImConversation::KInterfaceId; |
|
92 } |
|
93 |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // COSSProtocolImConversation::COSSProtocolImConversation() |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 COSSProtocolImConversation::COSSProtocolImConversation ( |
|
100 MOSSProtocolConnectionManager& aConnMan ) |
|
101 : iConnMan ( aConnMan ) |
|
102 { |
|
103 //LOGGER ( TXT ( "Groups::COSSProtocolImConversation() Start-End" ) ); |
|
104 } |
|
105 |
|
106 |
|
107 // --------------------------------------------------------------------------- |
|
108 // COSSProtocolImConversation::ConstructL() |
|
109 // --------------------------------------------------------------------------- |
|
110 // |
|
111 void COSSProtocolImConversation::ConstructL() |
|
112 { |
|
113 //LOGGER ( TXT ( "COSSProtocolImConversation::ConstructL() Start" ) ); |
|
114 //LOGGER ( TXT ( "COSSProtocolImConversation::ConstructL() End" ) ); |
|
115 } |
|
116 |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // COSSProtocolImConversation::NewL() |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 COSSProtocolImConversation* COSSProtocolImConversation::NewL ( |
|
123 MOSSProtocolConnectionManager& aConnMan ) |
|
124 { |
|
125 //LOGGER ( TXT ( "COSSProtocolImConversation::NewL() Start" ) ); |
|
126 |
|
127 COSSProtocolImConversation* self = |
|
128 new ( ELeave ) COSSProtocolImConversation ( aConnMan ); |
|
129 CleanupStack::PushL ( self ); |
|
130 self->ConstructL( ); |
|
131 CleanupStack::Pop ( self ); |
|
132 |
|
133 //LOGGER ( TXT ( "COSSProtocolImConversation::NewL() End" ) ); |
|
134 return self; |
|
135 } |
|
136 |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // COSSProtocolImConversation::~COSSProtocolImConversation() |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 COSSProtocolImConversation::~COSSProtocolImConversation() |
|
143 { |
|
144 //LOGGER ( TXT ( "Groups::~COSSProtocolImConversation() Start" ) ); |
|
145 |
|
146 //LOGGER ( TXT ( "Groups::~COSSProtocolImConversation() End" ) ); |
|
147 } |
|
148 |
|
149 |
|
150 |
|
151 // --------------------------------------------------------------------------- |
|
152 // COSSProtocolImConversation::DoSendMessageL() |
|
153 // --------------------------------------------------------------------------- |
|
154 // |
|
155 void COSSProtocolImConversation::DoSendMessageL ( |
|
156 const MImConversationInfo& aImMessage, |
|
157 TXIMPRequestId aReqId ) |
|
158 { |
|
159 _LIT(KInvaliedReciepient,"Invalied Recipient"); //String to be sent |
|
160 //LOGGER ( TXT ( "Groups::DoSendMessageL() Start" ) ); |
|
161 TPtrC16 message = aImMessage.TextMessage(); |
|
162 const MDesCArray& recipients = aImMessage.RecipientL(); |
|
163 if(message == KInvaliedReciepient) |
|
164 { |
|
165 iConnMan.HandleToHost().HandleRequestCompleted ( aReqId, KErrArgument ); |
|
166 return; |
|
167 } |
|
168 |
|
169 iConnMan.HandleToHost().HandleRequestCompleted ( aReqId, KErrNone ); |
|
170 |
|
171 |
|
172 //LOGGER ( TXT ( "Groups::DoSendMessageL() End" ) ); |
|
173 } |
|
174 |
|
175 // --------------------------------------------------------------------------- |
|
176 // COSSProtocolImConversation::DoForwardMessageL() |
|
177 // --------------------------------------------------------------------------- |
|
178 // |
|
179 void COSSProtocolImConversation::DoForwardMessageL ( |
|
180 const MImConversationInfo& /*aImMessage*/, |
|
181 TXIMPRequestId /*aReqId*/ ) |
|
182 { |
|
183 |
|
184 } |
|
185 |
|
186 // --------------------------------------------------------------------------- |
|
187 // COSSProtocolImConversation::DoSendMessageToGroupL() |
|
188 // --------------------------------------------------------------------------- |
|
189 // |
|
190 void COSSProtocolImConversation::DoSendMessageToGroupL ( |
|
191 const MImConversationInfo& /*aImMessage*/, |
|
192 const TDesC* /*aGroupId*/, TXIMPRequestId /*aReqId*/ ) |
|
193 { |
|
194 |
|
195 } |
|
196 |
|
197 // --------------------------------------------------------------------------- |
|
198 // COSSProtocolImConversation::DoBlockUsersL() |
|
199 // --------------------------------------------------------------------------- |
|
200 // |
|
201 TXIMPRequestId COSSProtocolImConversation::DoBlockUsersL ( |
|
202 const MDesCArray* /*aUserIds*/, |
|
203 TXIMPRequestId aReqId ) |
|
204 { |
|
205 return aReqId; |
|
206 } |
|
207 |
|
208 // --------------------------------------------------------------------------- |
|
209 // COSSProtocolImConversation::DoUnBlockUsersL() |
|
210 // --------------------------------------------------------------------------- |
|
211 // |
|
212 TXIMPRequestId COSSProtocolImConversation::DoUnBlockUsersL ( |
|
213 const MDesCArray* /*aUserIds*/, |
|
214 TXIMPRequestId aReqId ) |
|
215 { |
|
216 return aReqId; |
|
217 } |
|
218 |
|
219 // --------------------------------------------------------------------------- |
|
220 // COSSProtocolImConversation::DoGetBlockedListRequestL() |
|
221 // --------------------------------------------------------------------------- |
|
222 // |
|
223 void COSSProtocolImConversation::DoGetBlockedListRequestL ( |
|
224 const MXIMPIdentity& /*aImMessageId*/, |
|
225 TXIMPRequestId /*aReqId*/ ) |
|
226 { |
|
227 |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------------------------- |
|
231 // COSSProtocolImConversation::DoGetMessageListL() |
|
232 // --------------------------------------------------------------------------- |
|
233 // |
|
234 void COSSProtocolImConversation::DoGetMessageListL ( |
|
235 const MXIMPIdentity& /*aImMessageId*/, |
|
236 const TDesC* /*aGroupId*/, |
|
237 const TInt /*aMessageCount*/, |
|
238 TBool /*aDeliveryReportWanted*/, |
|
239 TXIMPRequestId /*aReqId*/ ) |
|
240 { |
|
241 |
|
242 } |
|
243 |
|
244 // --------------------------------------------------------------------------- |
|
245 // COSSProtocolImConversation::DoRejectMessageL() |
|
246 // --------------------------------------------------------------------------- |
|
247 // |
|
248 void COSSProtocolImConversation::DoRejectMessageL ( |
|
249 const MXIMPIdentity& /*aImMessageId*/, |
|
250 const TDesC& /*aMessageID*/, |
|
251 TXIMPRequestId /*aReqId*/ ) |
|
252 { |
|
253 |
|
254 } |
|
255 |
|
256 // --------------------------------------------------------------------------- |
|
257 // COSSProtocolImConversation::CreateDataHandlerL() |
|
258 // --------------------------------------------------------------------------- |
|
259 // |
|
260 void COSSProtocolImConversation::CreateDataHandlerL() |
|
261 { |
|
262 //LOGGER ( TXT ( "COSSProtocolImConversation::CreateDataHandler() Start" ) ); |
|
263 |
|
264 //LOGGER ( TXT ( "COSSProtocolImConversation::CreateDataHandler() End" ) ); |
|
265 } |
|
266 |
|
267 // End of file |
|
268 |