|
1 /* |
|
2 * Copyright (c) 2009 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: Browsing adapter between RemCon an MPX Framework. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <remconinterfaceselector.h> |
|
20 #include <mpxcollectionmessagedefs.h> |
|
21 #include <mpxmessagegeneraldefs.h> |
|
22 #include <mpxmediageneraldefs.h> |
|
23 #include <mpxsubscription.h> |
|
24 #include <mpxcommandgeneraldefs.h> |
|
25 #include <mpxcollectioncommanddefs.h> |
|
26 #include <mpxmediacontainerdefs.h> |
|
27 #include <e32cmn.h> |
|
28 #include <remconmediaerror.h> |
|
29 |
|
30 #include "btrccBrowsingAdapter.h" |
|
31 #include "debug.h" |
|
32 |
|
33 #ifdef BTRCCTEST_MPXCOLLECTIONSTUB |
|
34 #include <stubsrv/mpxcollectionstub.h> |
|
35 #endif |
|
36 |
|
37 |
|
38 // MODULE DATA STRUCTURES |
|
39 |
|
40 // ================= MEMBER FUNCTIONS ======================= |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CBTRCCBrowsingAdapter::NewL |
|
44 // Two-phased constructor. |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 CBTRCCBrowsingAdapter* CBTRCCBrowsingAdapter::NewL(CRemConInterfaceSelector& aInterfaceSelector) |
|
48 { |
|
49 CBTRCCBrowsingAdapter* self = new (ELeave) CBTRCCBrowsingAdapter(); |
|
50 CleanupStack::PushL(self); |
|
51 self->ConstructL(aInterfaceSelector); |
|
52 CleanupStack::Pop(self); |
|
53 return self; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CBTRCCBrowsingAdapter::CBTRCCBrowsingAdapter |
|
58 // C++ constructor. |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 CBTRCCBrowsingAdapter::CBTRCCBrowsingAdapter() |
|
62 { |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CBTRCCBrowsingAdapter::ConstructL |
|
67 // Symbian 2nd phase constructor. |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 void CBTRCCBrowsingAdapter::ConstructL(CRemConInterfaceSelector& aInterfaceSelector) |
|
71 { |
|
72 TRACE_FUNC |
|
73 iMediaBrowseTarget = CRemConDatabaseAwareMediaBrowseTarget::NewL( |
|
74 aInterfaceSelector, *this, *this, EFalse, |
|
75 iMlInterface, iNpInterface, iCookie); |
|
76 |
|
77 #ifdef BTRCCTEST_MPXCOLLECTIONSTUB |
|
78 iCollectionUtility = CMPXCollectionUtilityStubImpl::NewL(this, KMcModeDefault); |
|
79 #else |
|
80 iCollectionUtility = MMPXCollectionUtility::NewL(this, KMcModeDefault); |
|
81 #endif |
|
82 |
|
83 iCurrentOpenLOp = EOpenLOpOpen; |
|
84 iCollectionUtility->Collection().OpenL(EMPXOpenDefault); |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // Destructor. |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 CBTRCCBrowsingAdapter::~CBTRCCBrowsingAdapter() |
|
92 { |
|
93 TRACE_FUNC |
|
94 delete iMediaBrowseTarget; |
|
95 delete iCollectionUtility; |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CBTRCCBrowsingAdapter::MrcdamlboGetFolderListing |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 void CBTRCCBrowsingAdapter::MrcdamlboGetFolderListing(TRemConFolderScope aScope, |
|
103 TUint /*aStartItem*/, TUint /*aEndItem*/) |
|
104 { |
|
105 TRACE_FUNC |
|
106 |
|
107 // Check that the aScope is in filesystem scope. |
|
108 if (aScope != EBrowseFolder) |
|
109 { |
|
110 // Not supported. |
|
111 return; |
|
112 } |
|
113 |
|
114 // ToDo: Check that we don't have any other operation ongoing. |
|
115 // If we do, put the new operation in queue |
|
116 |
|
117 TInt err = KErrNone; |
|
118 CMPXCollectionPath* path = NULL; |
|
119 TRAP(err, path = iCollectionUtility->Collection().PathL()) |
|
120 |
|
121 if(!err) |
|
122 { |
|
123 TRAP(err, path->SelectAllL()) |
|
124 } |
|
125 if(!err) |
|
126 { |
|
127 RArray<TMPXAttribute> attrs; |
|
128 attrs.Append( KMPXMediaGeneralId ); |
|
129 attrs.Append( KMPXMediaGeneralTitle ); |
|
130 TRAP(err, iCollectionUtility->Collection().MediaL(*path, attrs.Array())) |
|
131 } |
|
132 if(!err) |
|
133 { |
|
134 iCurrentMediaLOp = EMediaLOpFolderListing; |
|
135 } |
|
136 TRACE_INFO((_L("Get folder listing %d"), err)) |
|
137 |
|
138 |
|
139 /* CMPXCollectionPath* path = iCollectionUtility->Collection().PathL(); |
|
140 CleanupStack::PushL( path ); |
|
141 if ( path->Levels() == KVcxMpxLevelVideos |
|
142 && path->Count() > aIndex |
|
143 && aIndex >= 0 ) |
|
144 { |
|
145 // Marks the item that will be handled |
|
146 path->SelectL( aIndex ); |
|
147 |
|
148 RArray<TMPXAttribute> dummy; // No need to set this parameter |
|
149 CleanupClosePushL( dummy ); |
|
150 iCollectionUtility->Collection().MediaL( *path, dummy.Array() ); |
|
151 CleanupStack::PopAndDestroy( &dummy ); |
|
152 } |
|
153 CleanupStack::PopAndDestroy( path ); */ |
|
154 |
|
155 } |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // CBTRCCBrowsingAdapter::MrcdamlboGetItem |
|
159 // This function is called to request for indicidual item's properties. |
|
160 // ----------------------------------------------------------------------------- |
|
161 // |
|
162 TInt CBTRCCBrowsingAdapter::MrcdamlboGetItem(TRemConFolderScope /*aScope*/, |
|
163 const TRemConItemUid& /*aItemId*/, |
|
164 TMediaAttributeIter& /*aIter*/, |
|
165 TUint16 /*aMediaLibraryStateCookie*/) |
|
166 { |
|
167 TRACE_FUNC |
|
168 |
|
169 return KErrNone; |
|
170 } |
|
171 |
|
172 // ----------------------------------------------------------------------------- |
|
173 // CBTRCCBrowsingAdapter::MrcdamlboFolderUp |
|
174 // ----------------------------------------------------------------------------- |
|
175 // |
|
176 void CBTRCCBrowsingAdapter::MrcdamlboFolderUp(TUint16 aMediaLibraryStateCookie) |
|
177 { |
|
178 TRACE_FUNC |
|
179 if(aMediaLibraryStateCookie == iCookie) |
|
180 { |
|
181 TRAPD( err, iCollectionUtility->Collection().BackL() ); |
|
182 if(err) |
|
183 { |
|
184 } |
|
185 // --> HandleOpenL will called |
|
186 } |
|
187 else |
|
188 { |
|
189 |
|
190 } |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // CBTRCCBrowsingAdapter::MrcdamlboFolderDown |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
|
197 void CBTRCCBrowsingAdapter::MrcdamlboFolderDown(const TRemConItemUid& aFolder, |
|
198 TUint16 aMediaLibraryStateCookie) |
|
199 { |
|
200 TRACE_FUNC |
|
201 if(aMediaLibraryStateCookie == iCookie) |
|
202 { |
|
203 TInt err = KErrNone; |
|
204 CMPXCollectionPath* path = NULL; |
|
205 TRAP( err, path = iCollectionUtility->Collection().PathL() ); |
|
206 if(!err) |
|
207 { |
|
208 TMPXItemId index = path->IdOfIndex((TInt)aFolder); |
|
209 if(index != KMPXInvalidItemId) |
|
210 { |
|
211 TRAP( err, iCollectionUtility->Collection().OpenL(index) ); |
|
212 // --> HandleOpenL will called. |
|
213 } |
|
214 } |
|
215 } |
|
216 else |
|
217 { |
|
218 |
|
219 } |
|
220 } |
|
221 |
|
222 // ----------------------------------------------------------------------------- |
|
223 // CBTRCCBrowsingAdapter::MrcdamlboGetPath |
|
224 // ----------------------------------------------------------------------------- |
|
225 // |
|
226 void CBTRCCBrowsingAdapter::MrcdamlboGetPath(RPointerArray<HBufC8>& /*aPath*/) |
|
227 { |
|
228 TRACE_FUNC |
|
229 TInt err = KErrNone; |
|
230 CMPXCollectionPath* browsePath = NULL; |
|
231 CMPXCollectionPath* container = NULL; |
|
232 |
|
233 TRAP( err, browsePath = iCollectionUtility->Collection().PathL() ); |
|
234 |
|
235 // Split path into levels until root level is reached. |
|
236 TRAP( err, container = browsePath->ContainerPathL() ); |
|
237 |
|
238 // Store the path information into received refToPath. |
|
239 // --> do something |
|
240 |
|
241 // Path information stored, inform RemCon |
|
242 //iMlInterface->MrcdamlbGetPathResult(TUint aItemCount, TUint16 aMediaLibraryStateCookie, TInt aResult); |
|
243 |
|
244 delete browsePath; |
|
245 delete container; |
|
246 } |
|
247 |
|
248 // ----------------------------------------------------------------------------- |
|
249 // CBTRCCBrowsingAdapter::MrcdanpboGetFolderListing |
|
250 // ----------------------------------------------------------------------------- |
|
251 // |
|
252 void CBTRCCBrowsingAdapter::MrcdanpboGetFolderListing(TUint /*aStartItem*/, TUint /*aEndItem*/) |
|
253 { |
|
254 TRACE_FUNC |
|
255 // Use the current path to |
|
256 // iCollectionUtility->Collection().MediaL(path, aAttrs, ) |
|
257 } |
|
258 |
|
259 // ----------------------------------------------------------------------------- |
|
260 // CBTRCCBrowsingAdapter::MrcdanpboGetItem |
|
261 // ----------------------------------------------------------------------------- |
|
262 // |
|
263 TInt CBTRCCBrowsingAdapter::MrcdanpboGetItem(const TRemConItemUid& /*aItemId*/, TMediaAttributeIter& /*aIter*/, TUint16 /*aMediaLibraryStateCookie*/) |
|
264 { |
|
265 TRACE_FUNC |
|
266 return KErrNone; |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // CBTRCCBrowsingAdapter::MrcdamlboSearch |
|
271 // ----------------------------------------------------------------------------- |
|
272 // |
|
273 void CBTRCCBrowsingAdapter::MrcdamlboSearch(const TDesC8& /*aSearch*/) |
|
274 { |
|
275 TRACE_FUNC |
|
276 } |
|
277 |
|
278 // ----------------------------------------------------------------------------- |
|
279 // CBTRCCBrowsingAdapter::HandleCollectionMessage |
|
280 // ----------------------------------------------------------------------------- |
|
281 // |
|
282 void CBTRCCBrowsingAdapter::HandleCollectionMessage(CMPXMessage* aMsg, TInt /*aErr*/) |
|
283 { |
|
284 TRACE_FUNC |
|
285 if(iMlInterface && aMsg) |
|
286 { |
|
287 if( aMsg->IsSupported(KMPXMessageMediaGeneralCategory) && |
|
288 aMsg->IsSupported(KMPXMessageChangeEventType) ) |
|
289 { |
|
290 TInt event( aMsg->ValueTObjectL<TInt>( KMPXMessageMediaGeneralCategory ) ); |
|
291 TInt op( aMsg->ValueTObjectL<TInt>( KMPXMessageChangeEventType ) ); |
|
292 |
|
293 if( event == EMPXCollection ) |
|
294 { |
|
295 if( op == EMPXItemDeleted || |
|
296 op == EMPXItemInserted || |
|
297 op == EMPXItemModified ) |
|
298 { |
|
299 // how cookie is really composed?? |
|
300 iCookie = op; |
|
301 iMlInterface->MrcdamlbMediaLibraryStateChange(iCookie); |
|
302 } |
|
303 } |
|
304 } |
|
305 } |
|
306 |
|
307 /* Example from mpxdeletehelper.cpp |
|
308 if( aMessage && |
|
309 aMessage->IsSupported(KMPXMessageGeneralEvent) && |
|
310 aMessage->IsSupported(KMPXMessageGeneralType) ) |
|
311 { |
|
312 TInt event( aMessage->ValueTObjectL<TInt>( KMPXMessageGeneralEvent ) ); |
|
313 TInt op( aMessage->ValueTObjectL<TInt>( KMPXMessageGeneralType ) ); |
|
314 |
|
315 MPX_DEBUG3( "CMPXDeleteHelper::HandleCollectionMessageL event = %d, type = %d", |
|
316 event, op ); |
|
317 |
|
318 if( event == TMPXCollectionMessage::EBroadcastEvent ) |
|
319 { |
|
320 if( op == EMcMsgFormatStart || |
|
321 op == EMcMsgDiskRemoved || |
|
322 op == EMcMsgUSBMassStorageStart || |
|
323 op == EMcMsgUSBMTPStart ) |
|
324 { |
|
325 iCancelled = ETrue; |
|
326 Cancel(); |
|
327 } |
|
328 } |
|
329 |
|
330 }*/ |
|
331 } |
|
332 |
|
333 // ----------------------------------------------------------------------------- |
|
334 // CBTRCCBrowsingAdapter::HandleOpenL |
|
335 // ----------------------------------------------------------------------------- |
|
336 // |
|
337 void CBTRCCBrowsingAdapter::HandleOpenL(const CMPXMedia& /*aEntries*/, TInt /*aIndex*/, TBool /*aComplete*/, TInt aError) |
|
338 { |
|
339 // This is called when a folder has been opened. We could store a path here. |
|
340 TRACE_FUNC |
|
341 if(!aError) |
|
342 { |
|
343 switch(iCurrentOpenLOp) |
|
344 { |
|
345 case EOpenLOpOpen: |
|
346 break; |
|
347 default: |
|
348 break; |
|
349 } |
|
350 } |
|
351 iCurrentOpenLOp = EOpenLOpIdle; |
|
352 } |
|
353 |
|
354 // ----------------------------------------------------------------------------- |
|
355 // CBTRCCBrowsingAdapter::HandleOpenL |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 void CBTRCCBrowsingAdapter::HandleOpenL(const CMPXCollectionPlaylist& /*aPlaylist*/,TInt /*aError*/) |
|
359 { |
|
360 TRACE_FUNC |
|
361 } |
|
362 |
|
363 // ----------------------------------------------------------------------------- |
|
364 // CBTRCCBrowsingAdapter::HandleCommandComplete |
|
365 // ----------------------------------------------------------------------------- |
|
366 // |
|
367 void CBTRCCBrowsingAdapter::HandleCommandComplete(CMPXCommand* /*aCommandResult*/, TInt /*aError*/) |
|
368 { |
|
369 TRACE_FUNC |
|
370 } |
|
371 |
|
372 // ----------------------------------------------------------------------------- |
|
373 // CBTRCCBrowsingAdapter::HandleCollectionMediaL |
|
374 // ----------------------------------------------------------------------------- |
|
375 // |
|
376 void CBTRCCBrowsingAdapter::HandleCollectionMediaL(const CMPXMedia& aMedia, TInt aError) |
|
377 { |
|
378 TRACE_FUNC |
|
379 RArray<TRemConItem> folderListing; |
|
380 TInt cookie = 0; |
|
381 if(!aError) |
|
382 { |
|
383 switch(iCurrentMediaLOp) |
|
384 { |
|
385 case EMediaLOpFolderListing: |
|
386 { |
|
387 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, EMediaLOpFolderListing"))) |
|
388 |
|
389 TMPXAttribute mediaArrayAttr( KMPXMediaIdContainer, EMPXMediaArrayContents ); |
|
390 // Check if there is more than one item in aMedia |
|
391 if( aMedia.IsSupported( mediaArrayAttr ) ) |
|
392 { |
|
393 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, media array is supported."))) |
|
394 const CMPXMediaArray* mediaArray = aMedia.ValueCObjectL<CMPXMediaArray>( mediaArrayAttr ); |
|
395 //User::LeaveIfNull( const_cast<CMPXMediaArray*>( mediaArray )); |
|
396 |
|
397 TInt error = KErrNone; |
|
398 if(mediaArray) |
|
399 { |
|
400 for(TInt i = 0; i < mediaArray->Count() ; ++i) |
|
401 { |
|
402 CMPXMedia* ptrToElement = mediaArray->AtL(i); |
|
403 TMPXAttribute uidAttr(KMPXMediaIdGeneral, EMPXMediaGeneralId); |
|
404 TMPXAttribute typeAttr(KMPXMediaIdGeneral, EMPXMediaGeneralType); |
|
405 if( ptrToElement->IsSupported(uidAttr) && ptrToElement->IsSupported(typeAttr) ) |
|
406 { |
|
407 TRemConItem item; |
|
408 const TUid& id = ptrToElement->ValueTObjectL<TUid>(uidAttr); |
|
409 item.iUid = id.iUid; |
|
410 const TMPXGeneralType& type = ptrToElement->ValueTObjectL<TMPXGeneralType>(typeAttr); |
|
411 |
|
412 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, id %d"), id)) |
|
413 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, type %d"), type)) |
|
414 |
|
415 if(type == EMPXGroup) |
|
416 { |
|
417 item.iType = ERemConFolderItem; |
|
418 } |
|
419 else if(type == EMPXItem) |
|
420 { |
|
421 item.iType = ERemConMediaItem; |
|
422 } |
|
423 else |
|
424 { |
|
425 continue; // skip appending if the type wasn't folder or item. |
|
426 } |
|
427 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, Append data"))) |
|
428 folderListing.Append(item); |
|
429 } |
|
430 else |
|
431 { |
|
432 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, Not supported, item index %d."), i)) |
|
433 } |
|
434 } |
|
435 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, pass media to RemCon"))) |
|
436 |
|
437 } |
|
438 else |
|
439 { |
|
440 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, No media!"))) |
|
441 error = KErrMediaBrowseInvalidOffset; |
|
442 } |
|
443 iMlInterface->MrcdamlbFolderListing(folderListing.Array(), cookie, error); |
|
444 } |
|
445 else |
|
446 { |
|
447 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, Array Content Not Supported."))) |
|
448 // "Single" elements should handled separately ?? |
|
449 } |
|
450 } |
|
451 break; |
|
452 } |
|
453 } |
|
454 else |
|
455 { |
|
456 TRACE_INFO((_L("CBTRCCBrowsingAdapter::HandleCollectionMediaL, error %d"), aError)) |
|
457 iMlInterface->MrcdamlbFolderListing(folderListing.Array(), cookie, aError); |
|
458 //HandleErrorL(aError); |
|
459 } |
|
460 folderListing.Close(); |
|
461 iCurrentMediaLOp = EMediaLOpIdle; |
|
462 } |
|
463 |
|
464 // ----------------------------------------------------------------------------- |
|
465 // CBTRCCBrowsingAdapter::SubscribeL |
|
466 // ----------------------------------------------------------------------------- |
|
467 // |
|
468 void CBTRCCBrowsingAdapter::SubscribeL() |
|
469 { |
|
470 TRACE_FUNC |
|
471 // Create subscription items |
|
472 CMPXSubscription* subscription( CMPXSubscription::NewL() ); |
|
473 CleanupStack::PushL( subscription ); |
|
474 |
|
475 CMPXSubscriptionItem* subItem1( CMPXSubscriptionItem::NewL() ); |
|
476 CleanupStack::PushL( subItem1 ); |
|
477 |
|
478 subItem1->SetTObjectValueL( KMPXMessageCollectionId, KMPXMessageGeneral ); |
|
479 subItem1->SetTObjectValueL( KMPXMessageMediaGeneralCategory, EMPXCollection ); |
|
480 subItem1->SetTObjectValueL( KMPXMessageChangeEventType, EMPXItemDeleted ); |
|
481 subscription->AddItemL( *subItem1 ); |
|
482 |
|
483 CMPXSubscriptionItem* subItem2( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
484 CleanupStack::PushL( subItem2 ); |
|
485 subItem2->SetTObjectValueL( KMPXMessageChangeEventType, EMPXItemInserted ); |
|
486 subscription->AddItemL( *subItem2 ); |
|
487 |
|
488 CMPXSubscriptionItem* subItem3( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
489 CleanupStack::PushL( subItem3 ); |
|
490 subItem3->SetTObjectValueL( KMPXMessageChangeEventType, EMPXItemModified ); |
|
491 subscription->AddItemL( *subItem3 ); |
|
492 |
|
493 iCollectionUtility->Collection().AddSubscriptionL( *subscription ); |
|
494 |
|
495 CleanupStack::PopAndDestroy( subItem3 ); |
|
496 CleanupStack::PopAndDestroy( subItem2 ); |
|
497 CleanupStack::PopAndDestroy( subItem1 ); |
|
498 CleanupStack::PopAndDestroy( subscription ); |
|
499 |
|
500 /* Example |
|
501 // Subscribe to only a few messages from collection utility |
|
502 subItem1->SetTObjectValueL( KMPXMessageGeneralId, KMPXMessageGeneral ); |
|
503 subItem1->SetTObjectValueL( KMPXMessageGeneralEvent, TMPXCollectionMessage::EBroadcastEvent ); |
|
504 subItem1->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgDiskRemoved ); |
|
505 subscription->AddItemL( *subItem1 ); |
|
506 |
|
507 CMPXSubscriptionItem* subItem2( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
508 CleanupStack::PushL( subItem2 ); |
|
509 subItem2->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgUSBMassStorageStart ); |
|
510 subscription->AddItemL( *subItem2 ); |
|
511 CMPXSubscriptionItem* subItem3( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
512 CleanupStack::PushL( subItem3 ); |
|
513 subItem3->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgUSBMTPStart ); |
|
514 subscription->AddItemL( *subItem3 ); |
|
515 CMPXSubscriptionItem* subItem4( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
516 CleanupStack::PushL( subItem4 ); |
|
517 subItem4->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgFormatStart ); |
|
518 subscription->AddItemL( *subItem4 ); |
|
519 CMPXSubscriptionItem* subItem5( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
520 CleanupStack::PushL( subItem5 ); |
|
521 subItem5->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgUSBMassStorageEnd ); |
|
522 subscription->AddItemL( *subItem5 ); |
|
523 CMPXSubscriptionItem* subItem6( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
524 CleanupStack::PushL( subItem6 ); |
|
525 subItem6->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgUSBMTPEnd ); |
|
526 subscription->AddItemL( *subItem6 ); |
|
527 CMPXSubscriptionItem* subItem7( CMPXSubscriptionItem::CopyL( *subItem1 )); |
|
528 CleanupStack::PushL( subItem7 ); |
|
529 subItem7->SetTObjectValueL( KMPXMessageGeneralType, EMcMsgFormatEnd ); |
|
530 subscription->AddItemL( *subItem7 ); |
|
531 CMPXSubscriptionItem* subItem8( CMPXSubscriptionItem::NewL() ); |
|
532 CleanupStack::PushL( subItem8 ); |
|
533 subItem8->SetTObjectValueL( KMPXMessageGeneralId, KMPXMessageGeneral ); |
|
534 subItem8->SetTObjectValueL( KMPXMessageGeneralEvent, TMPXCollectionMessage::EPathChanged ); |
|
535 subItem8->SetTObjectValueL( KMPXMessageGeneralType, EMcPathChangedByOpen ); |
|
536 subItem8->SetTObjectValueL( KMPXMessageGeneralData, EMcItemOpened ); |
|
537 subscription->AddItemL( *subItem8 ); |
|
538 iCollectionUtility->Collection().AddSubscriptionL( *subscription ); |
|
539 CleanupStack::PopAndDestroy( subItem8 ); |
|
540 CleanupStack::PopAndDestroy( subItem7 ); |
|
541 CleanupStack::PopAndDestroy( subItem6 ); |
|
542 CleanupStack::PopAndDestroy( subItem5 ); |
|
543 CleanupStack::PopAndDestroy( subItem4 ); |
|
544 CleanupStack::PopAndDestroy( subItem3 ); |
|
545 CleanupStack::PopAndDestroy( subItem2 ); |
|
546 CleanupStack::PopAndDestroy( subItem1 ); |
|
547 CleanupStack::PopAndDestroy( subscription ); */ |
|
548 } |