|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "LogServOperations.h" |
|
17 #include "logservpanic.h" |
|
18 #include "LogServView.h" |
|
19 #include "LogServTaskInterface.h" |
|
20 |
|
21 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
22 ////////////////////////////// CLogServOpEventAdd //////////////////////////////////////////////////////////// |
|
23 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
24 |
|
25 // |
|
26 // Create an operation to add an event to the log |
|
27 // |
|
28 CLogServOpEventAdd::CLogServOpEventAdd(MLogServTaskInterface& aTaskInterface, |
|
29 MLogServOperationManager& aOperationManager, |
|
30 const RMessage2& aMessage, |
|
31 CLogPackage& aPackage, |
|
32 const TLogClientServerData& aCliServData, |
|
33 TLogServSessionId aSessionId): |
|
34 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
35 { |
|
36 } |
|
37 |
|
38 CLogServOpEventAdd::~CLogServOpEventAdd() |
|
39 { |
|
40 delete iEvent; |
|
41 } |
|
42 |
|
43 // |
|
44 // Get stuff from the client and start doing the work |
|
45 // |
|
46 void CLogServOpEventAdd::StartL(TRequestStatus& aStatus) |
|
47 { |
|
48 // Read stuff from the client |
|
49 const TInt length = Message().GetDesLengthL(1); |
|
50 |
|
51 Package().ResizeL(length); |
|
52 TPtr8 pPackage(Package().Ptr()); |
|
53 Message().ReadL(1,pPackage); |
|
54 |
|
55 // Decode the parameters we've read from the client |
|
56 iEvent = CLogEvent::NewL(); |
|
57 Package().GetLogEventL(*iEvent); |
|
58 |
|
59 // Do the actual work |
|
60 TaskInterface().TaskEventAddL(aStatus, *iEvent, Message()); |
|
61 } |
|
62 |
|
63 // |
|
64 // Complete the client request - we need to wait for the client to request a response |
|
65 // |
|
66 CLogServOperationBase::TCompletionStatus CLogServOpEventAdd::CompleteProcessingL(TInt /*aFinalCompletionCode*/) |
|
67 { |
|
68 Package().SetLogEventL(*iEvent); |
|
69 const TInt size = Package().Ptr().Size(); |
|
70 Complete(size); |
|
71 // |
|
72 return CLogServOperationBase::EOperationCompleteWaitForClient; |
|
73 } |
|
74 |
|
75 // |
|
76 // Write stuff back to the client |
|
77 // |
|
78 void CLogServOpEventAdd::WriteL(const RMessage2& aMessage) |
|
79 { |
|
80 aMessage.WriteL(1, Package().Ptr()); |
|
81 } |
|
82 |
|
83 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
84 ////////////////////////////// CLogServOpEventChange ///////////////////////////////////////////////////////// |
|
85 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
86 |
|
87 // |
|
88 // Create an operation to change an event in the log |
|
89 // |
|
90 CLogServOpEventChange::CLogServOpEventChange(MLogServTaskInterface& aTaskInterface, |
|
91 MLogServOperationManager& aOperationManager, |
|
92 const RMessage2& aMessage, |
|
93 CLogPackage& aPackage, |
|
94 const TLogClientServerData& aCliServData, |
|
95 TLogServSessionId aSessionId) : |
|
96 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
97 { |
|
98 } |
|
99 |
|
100 CLogServOpEventChange::~CLogServOpEventChange() |
|
101 { |
|
102 delete iEvent; |
|
103 } |
|
104 |
|
105 // |
|
106 // Get stuff from the client and start doing the work |
|
107 // |
|
108 void CLogServOpEventChange::StartL(TRequestStatus& aStatus) |
|
109 { |
|
110 // Read stuff from the client |
|
111 Package().ResizeL(Message().GetDesLengthL(1)); |
|
112 Message().ReadL(1, Package().Ptr()); |
|
113 |
|
114 // Decode the parameters we've read from the client |
|
115 iEvent = CLogEvent::NewL(); |
|
116 Package().GetLogEventL(*iEvent); |
|
117 |
|
118 // Do the actual work |
|
119 TaskInterface().TaskEventChangeL(aStatus, *iEvent, Message()); |
|
120 } |
|
121 |
|
122 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
123 ////////////////////////////// CLogServOpEventGet //////////////////////////////////////////////////////////// |
|
124 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
125 |
|
126 // |
|
127 // Create an operation to get an event in the log |
|
128 // |
|
129 CLogServOpEventGet::CLogServOpEventGet(MLogServTaskInterface& aTaskInterface, |
|
130 MLogServOperationManager& aOperationManager, |
|
131 const RMessage2& aMessage, |
|
132 CLogPackage& aPackage, |
|
133 const TLogClientServerData& aCliServData, |
|
134 TLogServSessionId aSessionId) : |
|
135 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
136 { |
|
137 } |
|
138 |
|
139 CLogServOpEventGet::~CLogServOpEventGet() |
|
140 { |
|
141 delete iEvent; |
|
142 } |
|
143 |
|
144 // |
|
145 // Get stuff from the client and start doing the work |
|
146 // |
|
147 void CLogServOpEventGet::StartL(TRequestStatus& aStatus) |
|
148 { |
|
149 // Setup the event |
|
150 iEvent = CLogEvent::NewL(); |
|
151 iEvent->SetId((TLogId)Message().Ptr1()); |
|
152 |
|
153 // Do the actual work |
|
154 TaskInterface().TaskEventGetL(aStatus, *iEvent, Message()); |
|
155 } |
|
156 |
|
157 // |
|
158 // Complete the client request - we need to wait for the client to request a response |
|
159 // |
|
160 CLogServOperationBase::TCompletionStatus CLogServOpEventGet::CompleteProcessingL(TInt /*aFinalCompletionCode*/) |
|
161 { |
|
162 Package().SetLogEventL(*iEvent); |
|
163 const TInt size = Package().Ptr().Size(); |
|
164 Complete(size); |
|
165 // |
|
166 return CLogServOperationBase::EOperationCompleteWaitForClient; |
|
167 } |
|
168 |
|
169 // |
|
170 // Write stuff back to the client |
|
171 // |
|
172 void CLogServOpEventGet::WriteL(const RMessage2& aMessage) |
|
173 { |
|
174 aMessage.WriteL(1, Package().Ptr()); |
|
175 } |
|
176 |
|
177 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
178 ////////////////////////////// CLogServOpEventDelete ///////////////////////////////////////////////////////// |
|
179 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
180 |
|
181 // |
|
182 // Create an operation to delete an event from the log |
|
183 // |
|
184 CLogServOpEventDelete::CLogServOpEventDelete(MLogServTaskInterface& aTaskInterface, |
|
185 MLogServOperationManager& aOperationManager, |
|
186 const RMessage2& aMessage, |
|
187 CLogPackage& aPackage, |
|
188 const TLogClientServerData& aCliServData, |
|
189 TLogServSessionId aSessionId) : |
|
190 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
191 { |
|
192 } |
|
193 |
|
194 void CLogServOpEventDelete::StartL(TRequestStatus& aStatus) |
|
195 { |
|
196 // Do the actual work |
|
197 const TLogId eventId = static_cast<TLogId>(Message().Int1()); |
|
198 TaskInterface().TaskEventDeleteL(aStatus, eventId, Message()); |
|
199 } |
|
200 |
|
201 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
202 ////////////////////////////// CLogServOpTypeAdd ///////////////////////////////////////////////////////////// |
|
203 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
204 |
|
205 // |
|
206 // Add a new event type to the database |
|
207 // |
|
208 CLogServOpTypeAdd::CLogServOpTypeAdd(MLogServTaskInterface& aTaskInterface, |
|
209 MLogServOperationManager& aOperationManager, |
|
210 const RMessage2& aMessage, |
|
211 CLogPackage& aPackage, |
|
212 const TLogClientServerData& aCliServData, |
|
213 TLogServSessionId aSessionId) : |
|
214 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
215 { |
|
216 } |
|
217 |
|
218 CLogServOpTypeAdd::~CLogServOpTypeAdd() |
|
219 { |
|
220 delete iEventType; |
|
221 } |
|
222 |
|
223 // |
|
224 // Get stuff from the client and start doing the work |
|
225 // |
|
226 void CLogServOpTypeAdd::StartL(TRequestStatus& aStatus) |
|
227 { |
|
228 // Read stuff from the client |
|
229 Package().ResizeL(Message().GetDesLengthL(1)); |
|
230 Message().ReadL(1, Package().Ptr()); |
|
231 |
|
232 |
|
233 // Decode the parameters we've read from the client |
|
234 iEventType = CLogEventType::NewL(); |
|
235 Package().GetLogEventTypeL(*iEventType); |
|
236 |
|
237 // Do the actual work |
|
238 TaskInterface().TaskEventTypeAddL(aStatus, *iEventType); |
|
239 } |
|
240 |
|
241 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
242 ////////////////////////////// CLogServOpTypeGet ///////////////////////////////////////////////////////////// |
|
243 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
244 |
|
245 // |
|
246 // Get event type details from the database |
|
247 // |
|
248 CLogServOpTypeGet::CLogServOpTypeGet(MLogServTaskInterface& aTaskInterface, |
|
249 MLogServOperationManager& aOperationManager, |
|
250 const RMessage2& aMessage, |
|
251 CLogPackage& aPackage, |
|
252 const TLogClientServerData& aCliServData, |
|
253 TLogServSessionId aSessionId) : |
|
254 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
255 { |
|
256 } |
|
257 |
|
258 // |
|
259 // Get stuff from the client and start doing the work |
|
260 // |
|
261 void CLogServOpTypeGet::StartL(TRequestStatus& aStatus) |
|
262 { |
|
263 // Do the actual work |
|
264 const TUid eventTypeUid = { Message().Int1() }; |
|
265 const CLogEventType *eventType; |
|
266 TaskInterface().TaskEventTypeGetL(aStatus, eventType, eventTypeUid); |
|
267 iEventType = const_cast<CLogEventType*>(eventType); |
|
268 } |
|
269 |
|
270 // |
|
271 // Complete the client request - we need to wait for the client to request a response |
|
272 // |
|
273 CLogServOperationBase::TCompletionStatus CLogServOpTypeGet::CompleteProcessingL(TInt /*aFinalCompletionCode*/) |
|
274 { |
|
275 Package().SetLogEventTypeL(*iEventType); |
|
276 const TInt size = Package().Ptr().Size(); |
|
277 Complete(size); |
|
278 // |
|
279 return CLogServOperationBase::EOperationCompleteWaitForClient; |
|
280 } |
|
281 |
|
282 // |
|
283 // Write stuff back to the client |
|
284 // |
|
285 void CLogServOpTypeGet::WriteL(const RMessage2& aMessage) |
|
286 { |
|
287 aMessage.WriteL(1, Package().Ptr()); |
|
288 } |
|
289 |
|
290 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
291 ////////////////////////////// CLogServOpTypeChange ////////////////////////////////////////////////////////// |
|
292 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
293 |
|
294 // |
|
295 // Change event type details in the database |
|
296 // |
|
297 CLogServOpTypeChange::CLogServOpTypeChange(MLogServTaskInterface& aTaskInterface, |
|
298 MLogServOperationManager& aOperationManager, |
|
299 const RMessage2& aMessage, |
|
300 CLogPackage& aPackage, |
|
301 const TLogClientServerData& aCliServData, |
|
302 TLogServSessionId aSessionId) : |
|
303 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
304 { |
|
305 } |
|
306 |
|
307 CLogServOpTypeChange::~CLogServOpTypeChange() |
|
308 { |
|
309 delete iEventType; |
|
310 } |
|
311 |
|
312 // |
|
313 // Get stuff from the client and start doing the work |
|
314 // |
|
315 void CLogServOpTypeChange::StartL(TRequestStatus& aStatus) |
|
316 { |
|
317 // Read stuff from the client |
|
318 Package().ResizeL(Message().GetDesLengthL(1)); |
|
319 Message().ReadL(1, Package().Ptr()); |
|
320 |
|
321 // Decode the parameters we've read from the client |
|
322 iEventType = CLogEventType::NewL(); |
|
323 Package().GetLogEventTypeL(*iEventType); |
|
324 |
|
325 // Do the actual work |
|
326 TaskInterface().TaskEventTypeChangeL(aStatus, *iEventType); |
|
327 } |
|
328 |
|
329 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
330 ////////////////////////////// CLogServOpTypeDelete ////////////////////////////////////////////////////////// |
|
331 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
332 |
|
333 // |
|
334 // Delete event type details from the database |
|
335 // |
|
336 CLogServOpTypeDelete::CLogServOpTypeDelete(MLogServTaskInterface& aTaskInterface, |
|
337 MLogServOperationManager& aOperationManager, |
|
338 const RMessage2& aMessage, |
|
339 CLogPackage& aPackage, |
|
340 const TLogClientServerData& aCliServData, |
|
341 TLogServSessionId aSessionId) : |
|
342 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
343 { |
|
344 } |
|
345 |
|
346 // |
|
347 // Get stuff from the client and start doing the work |
|
348 // |
|
349 void CLogServOpTypeDelete::StartL(TRequestStatus& aStatus) |
|
350 { |
|
351 // Do the actual work |
|
352 const TUid eventTypeUid = { Message().Int1() }; |
|
353 TaskInterface().TaskEventTypeDeleteL(aStatus, eventTypeUid); |
|
354 } |
|
355 |
|
356 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
357 ////////////////////////////// CLogServOpConfigGet /////////////////////////////////////////////////////////// |
|
358 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
359 |
|
360 // |
|
361 // Get database config |
|
362 // |
|
363 CLogServOpConfigGet::CLogServOpConfigGet(MLogServTaskInterface& aTaskInterface, |
|
364 MLogServOperationManager& aOperationManager, |
|
365 const RMessage2& aMessage, |
|
366 CLogPackage& aPackage, |
|
367 const TLogClientServerData& aCliServData, |
|
368 TLogServSessionId aSessionId) : |
|
369 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
370 { |
|
371 } |
|
372 |
|
373 // |
|
374 // Start doing the work |
|
375 // |
|
376 void CLogServOpConfigGet::StartL(TRequestStatus& aStatus) |
|
377 { |
|
378 // Do the actual work |
|
379 TaskInterface().TaskConfigGetL(aStatus, iConfig); |
|
380 } |
|
381 |
|
382 // |
|
383 // Complete the client request - we need to wait for the client to request a response |
|
384 // |
|
385 CLogServOperationBase::TCompletionStatus CLogServOpConfigGet::CompleteProcessingL(TInt /*aFinalCompletionCode*/) |
|
386 { |
|
387 Package().SetLogConfigL(iConfig); |
|
388 const TInt size = Package().Ptr().Size(); |
|
389 Complete(size); |
|
390 // |
|
391 return CLogServOperationBase::EOperationCompleteWaitForClient; |
|
392 } |
|
393 |
|
394 // Write stuff back to the client |
|
395 void CLogServOpConfigGet::WriteL(const RMessage2& aMessage) |
|
396 { |
|
397 aMessage.WriteL(1, Package().Ptr()); |
|
398 } |
|
399 |
|
400 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
401 ////////////////////////////// CLogServOpConfigChange //////////////////////////////////////////////////////// |
|
402 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
403 |
|
404 // |
|
405 // Change database config |
|
406 // |
|
407 CLogServOpConfigChange::CLogServOpConfigChange(MLogServTaskInterface& aTaskInterface, |
|
408 MLogServOperationManager& aOperationManager, |
|
409 const RMessage2& aMessage, |
|
410 CLogPackage& aPackage, |
|
411 const TLogClientServerData& aCliServData, |
|
412 TLogServSessionId aSessionId) : |
|
413 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
414 { |
|
415 } |
|
416 |
|
417 // |
|
418 // Decode parameters from a client and start doing the work |
|
419 // |
|
420 void CLogServOpConfigChange::StartL(TRequestStatus& aStatus) |
|
421 { |
|
422 // Read stuff from the client |
|
423 Package().ResizeL(Message().GetDesLengthL(1)); |
|
424 Message().ReadL(1, Package().Ptr()); |
|
425 |
|
426 // Decode the parameters we've read from the client |
|
427 Package().GetLogConfigL(iConfig); |
|
428 |
|
429 // Do the actual work |
|
430 TaskInterface().TaskConfigChangeL(aStatus, iConfig); |
|
431 } |
|
432 |
|
433 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
434 ////////////////////////////// CLogServOpClearLog //////////////////////////////////////////////////////////// |
|
435 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
436 |
|
437 // |
|
438 // Clear the event log |
|
439 // |
|
440 CLogServOpClearLog::CLogServOpClearLog(MLogServTaskInterface& aTaskInterface, |
|
441 MLogServOperationManager& aOperationManager, |
|
442 const RMessage2& aMessage, |
|
443 CLogPackage& aPackage, |
|
444 const TLogClientServerData& aCliServData, |
|
445 TLogServSessionId aSessionId) : |
|
446 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
447 { |
|
448 } |
|
449 |
|
450 // |
|
451 // Decode parameters from the client and start doing the work |
|
452 // |
|
453 void CLogServOpClearLog::StartL(TRequestStatus& aStatus) |
|
454 { |
|
455 // Do the actual work |
|
456 TUint p2 = (TUint)Message().Ptr2(); |
|
457 TUint p1 = (TUint)Message().Ptr1(); |
|
458 const TTime time(MAKE_TINT64(p2, p1)); |
|
459 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
|
460 TSimId simId = (TSimId)Message().Int3(); |
|
461 TaskInterface().TaskClearLogL(aStatus, time, simId); |
|
462 #else |
|
463 TaskInterface().TaskClearLogL(aStatus, time); |
|
464 #endif |
|
465 } |
|
466 |
|
467 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
468 ////////////////////////////// CLogServOpClearRecent ///////////////////////////////////////////////////////// |
|
469 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
470 |
|
471 // |
|
472 // Clear a recent list |
|
473 // |
|
474 CLogServOpClearRecent::CLogServOpClearRecent(MLogServTaskInterface& aTaskInterface, |
|
475 MLogServOperationManager& aOperationManager, |
|
476 const RMessage2& aMessage, |
|
477 CLogPackage& aPackage, |
|
478 const TLogClientServerData& aCliServData, |
|
479 TLogServSessionId aSessionId) : |
|
480 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
481 { |
|
482 } |
|
483 |
|
484 // |
|
485 // Decode parameters from the client and start doing the work |
|
486 // |
|
487 void CLogServOpClearRecent::StartL(TRequestStatus& aStatus) |
|
488 { |
|
489 // Do the actual work |
|
490 const TLogRecentList recentList = static_cast<TLogRecentList>(Message().Int1()); |
|
491 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM |
|
492 TSimId simId = (TSimId)Message().Int2(); |
|
493 TaskInterface().TaskClearRecentL(aStatus, recentList, simId); |
|
494 #else |
|
495 TaskInterface().TaskClearRecentL(aStatus, recentList); |
|
496 #endif |
|
497 } |
|
498 |
|
499 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
500 ////////////////////////////// CLogServOpMaintenance ///////////////////////////////////////////////////////// |
|
501 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
502 |
|
503 // |
|
504 // Kicks the server to perform a maintain on the database. |
|
505 // Always done after an op as necessary |
|
506 // |
|
507 CLogServOpMaintenance::CLogServOpMaintenance(MLogServTaskInterface& aTaskInterface, |
|
508 MLogServOperationManager& aOperationManager, |
|
509 const RMessage2& aMessage, |
|
510 CLogPackage& aPackage, |
|
511 const TLogClientServerData& aCliServData, |
|
512 TLogServSessionId aSessionId) : |
|
513 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId) |
|
514 { |
|
515 } |
|
516 |
|
517 // |
|
518 // Just complete ourselves |
|
519 // |
|
520 void CLogServOpMaintenance::StartL(TRequestStatus& aStatus) |
|
521 { |
|
522 TRequestStatus* status = &aStatus; |
|
523 User::RequestComplete(status, KErrNone); |
|
524 } |
|
525 |
|
526 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
527 ////////////////////////////// CLogServOpViewSetup /////////////////////////////////////////////////////////// |
|
528 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
529 |
|
530 // Setup a view |
|
531 CLogServOpViewSetup::CLogServOpViewSetup(MLogServTaskInterface& aTaskInterface, |
|
532 MLogServOperationManager& aOperationManager, |
|
533 const RMessage2& aMessage, |
|
534 CLogPackage& aPackage, |
|
535 CLogServViewBase& aView, |
|
536 const TLogClientServerData& aCliServData, |
|
537 TLogServSessionId aSessionId) : |
|
538 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId), |
|
539 iView(aView) |
|
540 { |
|
541 } |
|
542 |
|
543 // |
|
544 // Decode parameters from the client and start doing the work |
|
545 // |
|
546 void CLogServOpViewSetup::StartL(TRequestStatus& aStatus) |
|
547 { |
|
548 // Read the filter construction type from the shared data slot |
|
549 const TInt filterConstructionType = ClientServerData().iDataSlot1; |
|
550 if (filterConstructionType == ELogFilterConstructFilterByFilterFieldByField || filterConstructionType == ELogFilterConstructFieldByFieldFilterByFilter) |
|
551 { |
|
552 // Do the actual work |
|
553 iView.SetupL(Message(), static_cast<TLogFilterConstructionType>(filterConstructionType)); |
|
554 TRequestStatus* status = &aStatus; |
|
555 User::RequestComplete(status, KErrNone); |
|
556 } |
|
557 else |
|
558 ::PanicClientL(Message(), ELogBadFilterConstructionType); |
|
559 } |
|
560 |
|
561 // |
|
562 // Complete the client request telling it the number of entries in the view |
|
563 // |
|
564 CLogServOperationBase::TCompletionStatus CLogServOpViewSetup::CompleteProcessingL(TInt /*aFinalCompletionCode*/) |
|
565 { |
|
566 const TInt viewCount = iView.Count(); |
|
567 Complete(viewCount); |
|
568 // |
|
569 return CLogServOperationBase::EOperationComplete; |
|
570 } |
|
571 |
|
572 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
573 ////////////////////////////// CLogServOpViewEventRemove ///////////////////////////////////////////////////// |
|
574 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
575 |
|
576 // |
|
577 // Remove an event from a view |
|
578 // |
|
579 CLogServOpViewEventRemove::CLogServOpViewEventRemove(MLogServTaskInterface& aTaskInterface, |
|
580 MLogServOperationManager& aOperationManager, |
|
581 const RMessage2& aMessage, |
|
582 CLogPackage& aPackage, |
|
583 CLogServViewBase& aView, |
|
584 const TLogClientServerData& aCliServData, |
|
585 TLogServSessionId aSessionId): |
|
586 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId), |
|
587 iView(aView) |
|
588 { |
|
589 } |
|
590 |
|
591 // |
|
592 // Decode parameters from the client and start doing the work |
|
593 // |
|
594 void CLogServOpViewEventRemove::StartL(TRequestStatus& aStatus) |
|
595 { |
|
596 iView.RemoveL(Message()); |
|
597 TRequestStatus* status = &aStatus; |
|
598 User::RequestComplete(status, KErrNone); |
|
599 } |
|
600 |
|
601 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
602 ////////////////////////////// CLogServOpViewClearDuplicates ///////////////////////////////////////////////// |
|
603 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
604 |
|
605 CLogServOpViewClearDuplicates::CLogServOpViewClearDuplicates(MLogServTaskInterface& aTaskInterface, |
|
606 MLogServOperationManager& aOperationManager, |
|
607 const RMessage2& aMessage, |
|
608 CLogPackage& aPackage, |
|
609 CLogServViewBase& aView, |
|
610 const TLogClientServerData& aCliServData, |
|
611 TLogServSessionId aSessionId): |
|
612 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId), |
|
613 iView(aView) |
|
614 { |
|
615 } |
|
616 |
|
617 void CLogServOpViewClearDuplicates::StartL(TRequestStatus& aStatus) |
|
618 { |
|
619 iView.ClearDuplicatesL(Message()); |
|
620 TRequestStatus* status = &aStatus; |
|
621 User::RequestComplete(status, KErrNone); |
|
622 } |
|
623 |
|
624 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
625 ////////////////////////////// CLogServOpViewSetFlags //////////////////////////////////////////////////////// |
|
626 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
627 |
|
628 CLogServOpViewSetFlags::CLogServOpViewSetFlags(MLogServTaskInterface& aTaskInterface, |
|
629 MLogServOperationManager& aOperationManager, |
|
630 const RMessage2& aMessage, |
|
631 CLogPackage& aPackage, |
|
632 CLogServViewBase& aView, |
|
633 const TLogClientServerData& aCliServData, |
|
634 TLogServSessionId aSessionId) : |
|
635 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId), |
|
636 iView(aView) |
|
637 { |
|
638 } |
|
639 |
|
640 void CLogServOpViewSetFlags::StartL(TRequestStatus& aStatus) |
|
641 { |
|
642 iView.SetFlagsL(Message()); |
|
643 TRequestStatus* status = &aStatus; |
|
644 User::RequestComplete(status, KErrNone); |
|
645 } |
|
646 |
|
647 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
648 ////////////////////////////// CLogServOpViewWindowFetcher /////////////////////////////////////////////////// |
|
649 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
650 |
|
651 CLogServOpViewWindowFetcher::CLogServOpViewWindowFetcher(MLogServTaskInterface& aTaskInterface, |
|
652 MLogServOperationManager& aOperationManager, |
|
653 const RMessage2& aMessage, |
|
654 CLogPackage& aPackage, |
|
655 CLogServViewBase& aView, |
|
656 const TLogClientServerData& aCliServData, |
|
657 TLogServSessionId aSessionId) : |
|
658 CLogServOperationBase(aTaskInterface, aOperationManager, aMessage, aPackage, aCliServData, aSessionId), |
|
659 iView(aView) |
|
660 { |
|
661 } |
|
662 |
|
663 void CLogServOpViewWindowFetcher::StartL(TRequestStatus& aStatus) |
|
664 { |
|
665 // Get the window |
|
666 TLogTransferWindow window; |
|
667 TPckg<TLogTransferWindow> pWindow(window); |
|
668 Message().ReadL(2, pWindow); |
|
669 |
|
670 // Do the actual work |
|
671 TaskInterface().TaskBuildWindowL(aStatus, iView, window, Message()); |
|
672 } |
|
673 |
|
674 // |
|
675 // Complete the client request - the final completion code tells us, in this instance, how many records were |
|
676 // read from the view. |
|
677 // |
|
678 CLogServOperationBase::TCompletionStatus CLogServOpViewWindowFetcher::CompleteProcessingL(TInt aFinalCompletionCode) |
|
679 { |
|
680 Complete(aFinalCompletionCode); |
|
681 |
|
682 // Don't need to wait for anything - we've already written back to the client's address space |
|
683 // when we built the window. |
|
684 return CLogServOperationBase::EOperationComplete; |
|
685 } |