|
1 /* |
|
2 * Copyright (c) 2002 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: This class is used for creating MMF-based players. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMAMMFPLAYERFACTORY_H |
|
20 #define CMMAMMFPLAYERFACTORY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <mmf/common/mmfcontrollerpluginresolver.h> |
|
24 #include "mmmaplayerfactory.h" |
|
25 |
|
26 class CMMAMMFResolver; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 /** |
|
30 * This class is used for creating MMF-based players. |
|
31 * |
|
32 * |
|
33 */ |
|
34 class CMMAMMFPlayerFactory: public CBase, public MMMAPlayerFactory |
|
35 { |
|
36 public: // Constructor and destructor |
|
37 IMPORT_C CMMAMMFPlayerFactory(); |
|
38 IMPORT_C ~CMMAMMFPlayerFactory(); |
|
39 |
|
40 public: // From MMMAPlayerFactory |
|
41 CMMAPlayer* CreatePlayerL(const TDesC& aContentType); |
|
42 |
|
43 CMMAPlayer* CreatePlayerL(const TDesC& aProtocol, |
|
44 const TDesC& aMiddlePart, |
|
45 const TDesC& aParameters); |
|
46 |
|
47 CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData); |
|
48 |
|
49 void GetSupportedContentTypesL(const TDesC& aProtocol, |
|
50 CDesC16Array& aMimeTypeArray); |
|
51 |
|
52 void GetSupportedProtocolsL(const TDesC& aContentType, |
|
53 CDesC16Array& aProtocolArray); |
|
54 |
|
55 protected: |
|
56 |
|
57 /** |
|
58 * Creates new CMMAPlayer instance with given resolver. |
|
59 * @param aResolver Resolver that contains needed mmf controller infos |
|
60 * for creating player. |
|
61 */ |
|
62 virtual CMMAPlayer* CreatePlayerL(CMMAMMFResolver* aResolver) = 0; |
|
63 |
|
64 /** |
|
65 * Returns list of allowed media IDs |
|
66 */ |
|
67 virtual void MediaIdsL(RArray<TUid>& aMediaIds) = 0; |
|
68 |
|
69 /** |
|
70 * Returns Match type for media IDs. |
|
71 * CMMFPluginSelectionParameters::EAllowOnlySuppliedMediaIds is the default. |
|
72 */ |
|
73 virtual CMMFPluginSelectionParameters::TMediaIdMatchType |
|
74 MediaIdMatchType(); |
|
75 |
|
76 /** |
|
77 * This method is called before mmf controller implementation array |
|
78 * is created. With this the actual factories can e.g. select either |
|
79 * set required play or record format support. Play format support is |
|
80 * the default. |
|
81 */ |
|
82 IMPORT_C virtual void PreparePluginSelectionParametersL( |
|
83 CMMAMMFResolver* aResolver, |
|
84 CMMFFormatSelectionParameters* aFormatSelection); |
|
85 |
|
86 /** |
|
87 * Creates CMMAPlayer with given format selection parameters |
|
88 */ |
|
89 IMPORT_C virtual CMMAPlayer* CreatePlayerL(CMMFFormatSelectionParameters* aFormatSelect, |
|
90 const TDesC* aFileName = NULL); |
|
91 |
|
92 /** |
|
93 * Checks that is this protocol supported by this factory |
|
94 */ |
|
95 TBool IsSupportedProtocolL(const TDesC& aProtocol); |
|
96 |
|
97 /** |
|
98 * Checks that is this content-type supported by this factory |
|
99 */ |
|
100 TBool IsSupportedContentTypeL(const TDesC& aContentType); |
|
101 private: |
|
102 /** |
|
103 * File version of creating player from content type |
|
104 */ |
|
105 |
|
106 CMMAPlayer* CreatePlayerL(const TDesC& aContentType, |
|
107 const TDesC* aFileName); |
|
108 #ifndef RD_JAVA_OMA_DRM_V2 |
|
109 /** |
|
110 * Tries to open DRM file |
|
111 */ |
|
112 CMMAPlayer* TryOpenDRMFileL(const TDesC& aFileName); |
|
113 #endif // RD_JAVA_OMA_DRM_V2 |
|
114 |
|
115 }; |
|
116 |
|
117 #endif // CMMAMMFPLAYERFACTORY_H |