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: GetInterdenpendentPropDesc |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <mtp/tmtptyperequest.h> |
|
20 #include <mtp/mtpdatatypeconstants.h> |
|
21 #include <mtp/mmtpdataproviderframework.h> |
|
22 #include <mtp/mmtpobjectmgr.h> |
|
23 #include <mtp/cmtpobjectmetadata.h> |
|
24 #include <mtp/cmtptypestring.h> |
|
25 #include <mtp/cmtptypeobjectpropdesc.h> |
|
26 #include <mtp/cmtptypeinterdependentpropdesc.h> |
|
27 |
|
28 #include "cabstractmediamtpdataprovidergetinterdependentpropdesc.h" |
|
29 #include "cmmmtpdpmetadataaccesswrapper.h" |
|
30 #include "tmmmtpdppanic.h" |
|
31 #include "abstractmediamtpdataproviderconst.h" |
|
32 #include "mmmtpdplogger.h" |
|
33 #include "mmmtpdpconfig.h" |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CAbstractMediaMtpDataProviderGetInterdependentPropDesc::NewL |
|
37 // Two-phase construction method |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 MMmRequestProcessor* CAbstractMediaMtpDataProviderGetInterdependentPropDesc::NewL( MMTPDataProviderFramework& aFramework, |
|
41 MMTPConnection& aConnection, |
|
42 MMmMtpDpConfig& /*aDpConfig*/ ) |
|
43 { |
|
44 CAbstractMediaMtpDataProviderGetInterdependentPropDesc* self = |
|
45 new ( ELeave ) CAbstractMediaMtpDataProviderGetInterdependentPropDesc( aFramework, |
|
46 aConnection ); |
|
47 CleanupStack::PushL( self ); |
|
48 self->ConstructL(); |
|
49 CleanupStack::Pop( self ); |
|
50 |
|
51 return self; |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ConstructL |
|
56 // Two-phase construction method |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 void CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ConstructL() |
|
60 { |
|
61 |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CAbstractMediaMtpDataProviderGetInterdependentPropDesc::~CAbstractMediaMtpDataProviderGetInterdependentPropDesc |
|
66 // Destructor |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 CAbstractMediaMtpDataProviderGetInterdependentPropDesc::~CAbstractMediaMtpDataProviderGetInterdependentPropDesc() |
|
70 { |
|
71 delete iDataset; |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CMTPGetInterdependentPropDesc::CMTPGetInterdependentPropDesc |
|
76 // Standard c++ constructor |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 CAbstractMediaMtpDataProviderGetInterdependentPropDesc::CAbstractMediaMtpDataProviderGetInterdependentPropDesc( MMTPDataProviderFramework& aFramework, |
|
80 MMTPConnection& aConnection ) : |
|
81 CRequestProcessor( aFramework, aConnection, 0, NULL ) |
|
82 { |
|
83 PRINT( _L( "Operation: GetInterdependentPropDesc(0x9807)" ) ); |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CAbstractMediaMtpDataProviderGetInterdependentPropDesc::CheckRequestL |
|
88 // Verify the reqeust and returns it |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 TMTPResponseCode CAbstractMediaMtpDataProviderGetInterdependentPropDesc::CheckRequestL() |
|
92 { |
|
93 TMTPResponseCode responseCode = CRequestProcessor::CheckRequestL(); |
|
94 iFormatCode = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); |
|
95 |
|
96 if ( EMTPRespCodeOK == responseCode ) |
|
97 { |
|
98 TInt count = sizeof( KAbstractMediaMtpDataProviderSupportedFormats ) / sizeof( TUint16 ); |
|
99 |
|
100 responseCode = EMTPRespCodeInvalidObjectFormatCode; |
|
101 |
|
102 for ( TInt i = 0; i < count; i++ ) |
|
103 { |
|
104 if ( iFormatCode == KAbstractMediaMtpDataProviderSupportedFormats[i] ) |
|
105 { |
|
106 responseCode = EMTPRespCodeOK; |
|
107 break; |
|
108 } |
|
109 } |
|
110 } |
|
111 |
|
112 return responseCode; |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL |
|
117 // service a request at request phase |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 void CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL() |
|
121 { |
|
122 PRINT( _L( "MM MTP => CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL" ) ); |
|
123 |
|
124 // Clear the data set. |
|
125 delete iDataset; |
|
126 iDataset = NULL; |
|
127 iDataset = CMTPTypeInterdependentPropDesc::NewL(); |
|
128 |
|
129 PRINT( _L( "MM MTP <> CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL don't have interdependent properties!" ) ); |
|
130 |
|
131 // Send the dataset. |
|
132 SendDataL( *iDataset ); |
|
133 PRINT( _L( "MM MTP <= CAbstractMediaMtpDataProviderGetInterdependentPropDesc::ServiceL" ) ); |
|
134 } |
|
135 |
|
136 // end of file |
|