|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMMAMMFRESOLVER_H |
|
19 #define CMMAMMFRESOLVER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <mmf/common/mmfcontrollerpluginresolver.h> |
|
23 #include "cmmaplayer.h" |
|
24 |
|
25 |
|
26 _LIT(KRmFileExtension, ".rm"); |
|
27 _LIT(KRaFileExtension, ".ra"); |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * This class can be used to get RMMFControllerImplInfoArray and content |
|
32 * types from MMF. |
|
33 */ |
|
34 NONSHARABLE_CLASS(CMMAMMFResolver): public CBase |
|
35 |
|
36 { |
|
37 public: // Construction |
|
38 /** |
|
39 * Constructs a new mmf resolver object. |
|
40 * @return The new object created. Note that the new object will be |
|
41 * left on the cleanup stack. |
|
42 */ |
|
43 static CMMAMMFResolver* NewLC(); |
|
44 |
|
45 public: // New methods. |
|
46 /** |
|
47 * Retrieves all controller plugins that support the requirements of |
|
48 * the caller. |
|
49 */ |
|
50 void ListImplementationsL(); |
|
51 |
|
52 /** |
|
53 * Returns implementations. |
|
54 * Array will not contain any implementation if ListImplementationsL() |
|
55 * is not called. |
|
56 * @return Found implementations. |
|
57 */ |
|
58 RMMFControllerImplInfoArray* Implementations(); |
|
59 |
|
60 /** |
|
61 * Returns implementations. Notice: Ownership is transferred to caller. |
|
62 * Array will not contain any implementation if ListImplementationsL() |
|
63 * is not called. |
|
64 * @return Found implementations. Ownership is transferred. |
|
65 */ |
|
66 RMMFControllerImplInfoArray* ImplementationsOwnership(); |
|
67 |
|
68 /** |
|
69 * Returns content type that was found in ListImplementationsL method. |
|
70 * Ownership is transfered. |
|
71 * @return Content type or NULL if type is not available. |
|
72 */ |
|
73 HBufC* ContentTypeOwnership(); |
|
74 |
|
75 /** |
|
76 * Returns content type that was found in ListImplementationsL method. |
|
77 * @return Content type or NULL if type is not available. |
|
78 */ |
|
79 HBufC* ContentType(); |
|
80 |
|
81 /** |
|
82 * Sets filename |
|
83 * @param aFileName File name to be set or NULL |
|
84 */ |
|
85 |
|
86 void SetFileNameL(const TDesC* aFileName); |
|
87 |
|
88 /** |
|
89 * Returns possible filename or NULL if not set |
|
90 * Ownership is transfered. |
|
91 * @return Content type or NULL if type is not available. |
|
92 */ |
|
93 HBufC* FileNameOwnership(); |
|
94 |
|
95 /** |
|
96 * Get all supported content types. |
|
97 * @param aMimeTypeArray Will contain supported mime types. |
|
98 */ |
|
99 void GetSupportedContentTypesL(CDesC16Array& aMimeTypeArray); |
|
100 |
|
101 /** |
|
102 * Return selection parameters. |
|
103 */ |
|
104 CMMFControllerPluginSelectionParameters* |
|
105 SelectionParameters(); |
|
106 |
|
107 /** |
|
108 * Sets the play format support required. |
|
109 * @param aRequiredSupport The play format support required. |
|
110 */ |
|
111 void SetRequiredPlayFormatSupportL( |
|
112 CMMFFormatSelectionParameters& aRequiredSupport); |
|
113 |
|
114 /** |
|
115 * Sets the record format support required. |
|
116 * @param aRequiredSupport The record format support required. |
|
117 */ |
|
118 void SetRequiredRecordFormatSupportL( |
|
119 CMMFFormatSelectionParameters& aRequiredSupport); |
|
120 |
|
121 private: |
|
122 /** |
|
123 * Returns record or play formats according to the setup. |
|
124 */ |
|
125 const RMMFFormatImplInfoArray* Formats( |
|
126 CMMFControllerImplementationInformation* aImplementation); |
|
127 /** |
|
128 * Finds content type from iImplementations array. |
|
129 */ |
|
130 void ResolveContentTypeL(); |
|
131 |
|
132 private: |
|
133 TBool IsRealVideoTypeL(const TDesC& aFileName); |
|
134 |
|
135 TBool IsRealMimeTypeSupported(const TDesC& aMimeType); |
|
136 |
|
137 protected: |
|
138 // C++ constructor |
|
139 CMMAMMFResolver(); |
|
140 void ConstructL(); |
|
141 |
|
142 private: |
|
143 ~CMMAMMFResolver(); |
|
144 |
|
145 private: |
|
146 // Owned. Ownership can be tranferred with ImplementationsOwnership |
|
147 // method. |
|
148 RMMFControllerImplInfoArray* iImplementations; |
|
149 |
|
150 // Owned. Ownership can be transferred with ContentType method. |
|
151 HBufC* iContentType; |
|
152 |
|
153 // Owned. Ownership can be transferred with FileName method. |
|
154 HBufC* iFileName; |
|
155 |
|
156 // Owned. |
|
157 CMMFControllerPluginSelectionParameters* iControllerSelection; |
|
158 |
|
159 // The required play format support |
|
160 CMMFFormatSelectionParameters* iRequiredPlayFormatSupport; |
|
161 |
|
162 // The required record format support |
|
163 CMMFFormatSelectionParameters* iRequiredRecordFormatSupport; |
|
164 }; |
|
165 |
|
166 #endif // CMMAMMFRESOLVER_H |