|
1 /* |
|
2 * Copyright (c) 2002-2004 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 to read the variated features concerning |
|
15 * different mime types of media files. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPROENGMEDIAVARIATION_H |
|
21 #define CPROENGMEDIAVARIATION_H |
|
22 |
|
23 |
|
24 // INCLUDE FILES |
|
25 #include <e32base.h> |
|
26 #include <apgcli.h> // RApaLsSession |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MProfilesLocalFeatures; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * This class is used to read the variated features concerning different mime |
|
35 * types of media files. |
|
36 * |
|
37 * @lib ProfileEngine.lib |
|
38 * @since 3.1 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CProEngMediaVariation ) : public CBase |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CProEngMediaVariation* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CProEngMediaVariation(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Returns the MIME type of the given file. |
|
58 * @param aFileName the file the MIME type of which should be found out. |
|
59 * @param aDataType contains the MIME type of aFileName on return. |
|
60 */ |
|
61 void GetDataTypeL( const TDesC& aFileName, TDes16& aDataType ) const; |
|
62 |
|
63 /** |
|
64 * Checks if files of the given MIME type are supported to be used as |
|
65 * alert tones. |
|
66 * @param aMimeType the MIME type to be checked |
|
67 * @return ETrue if aMimeType is supported, EFalse otherwise. |
|
68 */ |
|
69 TBool IsSupported( const TDesC16& aMimeType ); |
|
70 |
|
71 /** |
|
72 * Checks if files of the given MIME type are allowed to be used as |
|
73 * alert tones if they are DRM-protected. |
|
74 * @param aMimeType the MIME type to be checked |
|
75 * @return ETrue if files of the given type are allowed, |
|
76 * EFalse otherwise. |
|
77 */ |
|
78 TBool IsAllowedProtected( const TDesC16& aMimeType ) const; |
|
79 |
|
80 /** |
|
81 * Checks if files of the given MIME type are allowed to be used as |
|
82 * alert tones if they are NOT DRM-protected. |
|
83 * @param aMimeType the MIME type to be checked |
|
84 * @return ETrue if files of the given type are allowed, |
|
85 * EFalse otherwise. |
|
86 */ |
|
87 TBool IsAllowedUnProtected( const TDesC16& aMimeType ) const; |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * C++ default constructor. |
|
93 */ |
|
94 CProEngMediaVariation(); |
|
95 |
|
96 /** |
|
97 * By default Symbian 2nd phase constructor is private. |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 private: // Data |
|
102 |
|
103 /// Needed to get the MIME-type of the files |
|
104 RApaLsSession iApaLsSession; |
|
105 |
|
106 /// Not owned: Profiles local features |
|
107 MProfilesLocalFeatures* iLocalFeatures; |
|
108 |
|
109 /// Array holding the MIME types supported by MMF (and DevSound) |
|
110 CDesC8ArrayFlat* iSupportedMimeTypes; |
|
111 |
|
112 /// 8-bit helper buffer needed in IsSupported() |
|
113 RBuf8 iMimeTypeBuf; |
|
114 }; |
|
115 |
|
116 #endif // CPROENGMEDIAVARIATION_H |
|
117 |
|
118 // End of File |
|
119 |