|
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: Implement the operation: SetObjectReferences |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "cabstractmediamtpdataprovidersetobjectreferences.h" |
|
20 #include "abstractmediamtpdataproviderconst.h" |
|
21 #include "cmmmtpdpmetadataaccesswrapper.h" |
|
22 #include "mmmtpdplogger.h" |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CAbstractMediaMtpDataProviderSetObjectReferences::NewL |
|
26 // Two-phase construction method |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 MMmRequestProcessor* CAbstractMediaMtpDataProviderSetObjectReferences::NewL( MMTPDataProviderFramework& aFramework, |
|
30 MMTPConnection& aConnection, |
|
31 MMmMtpDpConfig& aDpConfig ) |
|
32 { |
|
33 CAbstractMediaMtpDataProviderSetObjectReferences* self = |
|
34 new ( ELeave ) CAbstractMediaMtpDataProviderSetObjectReferences( aFramework, |
|
35 aConnection, |
|
36 aDpConfig ); |
|
37 CleanupStack::PushL( self ); |
|
38 self->ConstructL(); |
|
39 CleanupStack::Pop( self ); |
|
40 |
|
41 return self; |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CAbstractMediaMtpDataProviderSetObjectReferences::ConstructL |
|
46 // Two-phase construction method |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 void CAbstractMediaMtpDataProviderSetObjectReferences::ConstructL() |
|
50 { |
|
51 |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CAbstractMediaMtpDataProviderSetObjectReferences::~CAbstractMediaMtpDataProviderSetObjectReferences |
|
56 // Destructor |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CAbstractMediaMtpDataProviderSetObjectReferences::~CAbstractMediaMtpDataProviderSetObjectReferences() |
|
60 { |
|
61 |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CAbstractMediaMtpDataProviderSetObjectReferences::CAbstractMediaMtpDataProviderSetObjectReferences |
|
66 // Standard c++ constructor |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 CAbstractMediaMtpDataProviderSetObjectReferences::CAbstractMediaMtpDataProviderSetObjectReferences( MMTPDataProviderFramework& aFramework, |
|
70 MMTPConnection& aConnection, |
|
71 MMmMtpDpConfig& aDpConfig ) : |
|
72 CSetObjectReferences( aFramework, aConnection, aDpConfig ) |
|
73 { |
|
74 |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CAbstractMediaMtpDataProviderSetObjectReferences::DoSetObjectReferencesL |
|
79 // set references to DB |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 void CAbstractMediaMtpDataProviderSetObjectReferences::DoSetObjectReferencesL( CMmMtpDpMetadataAccessWrapper& aWrapper, |
|
83 TUint16 aObjectFormat, |
|
84 const TDesC& aSrcFileName, |
|
85 CDesCArray& aRefFileArray ) |
|
86 { |
|
87 TInt count = sizeof( KAbstractMediaMtpDataProviderSupportedFormats ) / sizeof (TUint16); |
|
88 TBool supported = EFalse; |
|
89 |
|
90 for( TInt i = 0; i < count; i++ ) |
|
91 { |
|
92 if( KAbstractMediaMtpDataProviderSupportedFormats[i] == aObjectFormat ) |
|
93 { |
|
94 supported = ETrue; |
|
95 break; |
|
96 } |
|
97 } |
|
98 |
|
99 if ( supported ) |
|
100 { |
|
101 aWrapper.SetPlaylistL( aSrcFileName, aRefFileArray ); |
|
102 } |
|
103 } |
|
104 |
|
105 // end of file |