1 /* |
|
2 * Copyright (c) 2002-2006 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: A wrapper interface around MMF (Multimedia Framework) to get |
|
15 * information about MIME-types supported by MMF. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // CLASS HEADER |
|
22 #include "ProfileMmfInfoUtility.h" |
|
23 |
|
24 // INTERNAL INCLUDES |
|
25 |
|
26 // EXTERNAL INCLUDES |
|
27 #include <e32std.h> |
|
28 #include <badesca.h> |
|
29 #include <mmf/common/mmfcontrollerpluginresolver.h> |
|
30 |
|
31 namespace |
|
32 { |
|
33 // CONSTANTS |
|
34 _LIT8( KProfileRngMimeType, "application/vnd.nokia.ringing-tone" ); |
|
35 //_LIT8( KProfilePlainTextType, "text/plain" ); |
|
36 } |
|
37 |
|
38 // ============================ MEMBER FUNCTIONS =============================== |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CProfileMmfInfoUtility::IsMimeTypeSupported |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 TBool ProfileMmfInfoUtility::IsMimeTypeSupportedL( const TDesC8& aMimeType ) |
|
45 { |
|
46 |
|
47 //if( aMimeType.CompareF( KProfilePlainTextType ) == 0 ) |
|
48 // { |
|
49 // return EFalse; |
|
50 // } |
|
51 |
|
52 if( aMimeType.CompareF( KProfileRngMimeType ) == 0 ) |
|
53 { |
|
54 return ETrue; |
|
55 } |
|
56 |
|
57 TBool result( EFalse ); |
|
58 |
|
59 CMMFFormatSelectionParameters* formatPrms = |
|
60 CMMFFormatSelectionParameters::NewLC(); |
|
61 CMMFControllerPluginSelectionParameters* controllerPrms = |
|
62 CMMFControllerPluginSelectionParameters::NewLC(); |
|
63 |
|
64 // Empty format parameters means: "get all the supported formats" |
|
65 controllerPrms->SetRequiredPlayFormatSupportL( *formatPrms ); |
|
66 RMMFControllerImplInfoArray cntrlArray; |
|
67 controllerPrms->ListImplementationsL( cntrlArray ); |
|
68 |
|
69 for( TInt i( cntrlArray.Count() - 1 ); i >= 0 && !result; --i ) |
|
70 { |
|
71 const RMMFFormatImplInfoArray& |
|
72 infoArray( cntrlArray[i]->PlayFormats() ); |
|
73 |
|
74 for( TInt j( infoArray.Count() - 1 ); j >= 0; --j ) |
|
75 { |
|
76 if( infoArray[j]->SupportsMimeType( aMimeType ) ) |
|
77 { |
|
78 result = ETrue; |
|
79 break; |
|
80 } |
|
81 } |
|
82 } |
|
83 |
|
84 cntrlArray.ResetAndDestroy(); |
|
85 cntrlArray.Close(); |
|
86 CleanupStack::PopAndDestroy( 2, formatPrms ); |
|
87 |
|
88 return result; |
|
89 } |
|
90 |
|
91 // End of File |
|
92 |
|