26
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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 CMMAEMCRESOLVER_H
|
|
19 |
#define CMMAEMCRESOLVER_H
|
|
20 |
|
|
21 |
#include <MimeTypes.h>
|
|
22 |
#include "cmmaplayer.h"
|
|
23 |
|
|
24 |
//Supported file extensions
|
|
25 |
|
|
26 |
_LIT(K3g2FileExtension, ".3g2");
|
|
27 |
_LIT(K3gpFileExtension, ".3gp");
|
|
28 |
_LIT(KAacFileExtension, ".aac");
|
|
29 |
_LIT(KAmrFileExtension, ".amr");
|
|
30 |
_LIT(KAwbFileExtension, ".awb");
|
|
31 |
_LIT(KM4aFileExtension, ".m4a");
|
|
32 |
_LIT(KMp3FileExtension, ".mp3");
|
|
33 |
_LIT(KMp4FileExtension, ".mp4");
|
|
34 |
_LIT(KWmaFileExtension, ".wma");
|
|
35 |
_LIT(KRmFileExtension, ".rm");
|
|
36 |
_LIT(KRaFileExtension, ".ra");
|
|
37 |
|
|
38 |
const TInt KContentTypeMaxLength = 30;
|
|
39 |
|
|
40 |
|
|
41 |
// CLASS DECLARATION
|
|
42 |
|
|
43 |
NONSHARABLE_CLASS(CMMAEMCResolver): public CBase
|
|
44 |
|
|
45 |
{
|
|
46 |
public: // Construction
|
|
47 |
/**
|
|
48 |
* Constructs a new mmf resolver object.
|
|
49 |
* @return The new object created. Note that the new object will be
|
|
50 |
* left on the cleanup stack.
|
|
51 |
*/
|
|
52 |
static CMMAEMCResolver* NewLC();
|
|
53 |
|
|
54 |
public: // New methods.
|
|
55 |
|
|
56 |
HBufC* ContentTypeOwnership();
|
|
57 |
|
|
58 |
HBufC8* MimeTypeOwnership();
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Returns content type
|
|
62 |
*/
|
|
63 |
HBufC* ContentType();
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Sets filename
|
|
67 |
* @param aFileName File name to be set or NULL
|
|
68 |
*/
|
|
69 |
|
|
70 |
void SetFileNameL(const TDesC* aFileName);
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Returns possible filename or NULL if not set
|
|
74 |
* Ownership is transfered.
|
|
75 |
* @return Content type or NULL if type is not available.
|
|
76 |
*/
|
|
77 |
HBufC* FileNameOwnership();
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Get all supported content types.
|
|
81 |
* @param aMimeTypeArray Will contain supported mime types.
|
|
82 |
*/
|
|
83 |
void GetSupportedContentTypesL(CDesC16Array& aMimeTypeArray);
|
|
84 |
|
|
85 |
|
|
86 |
private:
|
|
87 |
|
|
88 |
/** Finds content type from given File name.
|
|
89 |
*/
|
|
90 |
void ResolveContentTypeL(const TDesC& aFileName, TDes8& aMimeType);
|
|
91 |
|
|
92 |
void ResolveContentTypeL();
|
|
93 |
|
|
94 |
private:
|
|
95 |
~CMMAEMCResolver();
|
|
96 |
|
|
97 |
void ConstructL();
|
|
98 |
|
|
99 |
private:
|
|
100 |
|
|
101 |
// Owned. Ownership can be transferred with ContentType method.
|
|
102 |
HBufC* iContentType;
|
|
103 |
|
|
104 |
// Owned. Ownership can be transferred with MimeType method.
|
|
105 |
HBufC8* iMimeType;
|
|
106 |
|
|
107 |
// Owned. Ownership can be transferred with FileName method.
|
|
108 |
HBufC* iFileName;
|
|
109 |
|
|
110 |
public: // new method
|
|
111 |
void SetSourceInfoL(const HBufC8* aHeaderData);
|
|
112 |
|
|
113 |
private:
|
|
114 |
TBool IsRealVideoTypeL(const TDesC8& aHeader);
|
|
115 |
|
|
116 |
TBool IsRealMimeTypeSupported(const TDesC& aMimeType);
|
|
117 |
|
|
118 |
private: // Data
|
|
119 |
const HBufC8* iHeaderData; // not owned
|
|
120 |
};
|
|
121 |
|
|
122 |
#endif // CMMAEMCRESOLVER_H
|