1 /* |
|
2 * Copyright (c) 2010 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: Class representing ringing tone |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TMSRTCONTAINER_H |
|
19 #define TMSRTCONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 namespace TMS { |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Ringtone wrapper for file name. In addtion, provides methods for ringtone |
|
30 * type identification. |
|
31 */ |
|
32 class TMSRtContainer : public CBase |
|
33 { |
|
34 public: |
|
35 // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * @param aFileName Ringing tone file name with path. |
|
40 * @param aDrmInPlayback ETrue to use IsFileDrmProtected(). |
|
41 */ |
|
42 static TMSRtContainer* NewL(const TDesC& aFileName, |
|
43 TBool aDrmInPlayback = EFalse); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~TMSRtContainer(); |
|
49 |
|
50 public: |
|
51 /** |
|
52 * Sets the file name including path. |
|
53 * @param aFileName file name plus path. |
|
54 */ |
|
55 void SetFileName(const TDesC& aFileName); |
|
56 |
|
57 /** |
|
58 * Returns file name including path. |
|
59 * @return File name. |
|
60 */ |
|
61 const TDesC& FileName() const; |
|
62 |
|
63 /** |
|
64 * Returns MIME type. |
|
65 * @return MIME type. |
|
66 */ |
|
67 const TDesC& MimeType() const; |
|
68 |
|
69 /** |
|
70 * Checks if video ringing tone. |
|
71 * @return ETrue if video ringing tone. |
|
72 */ |
|
73 TBool IsVideoRingingTone(); |
|
74 |
|
75 /** |
|
76 * Checks if the file is a DCF file. |
|
77 * @return ETrue if files is DRM protected. |
|
78 */ |
|
79 TBool IsFileDrmProtected() const; |
|
80 |
|
81 /** |
|
82 * Checks if the file is in ROM. |
|
83 */ |
|
84 TBool IsFileInRom() const; |
|
85 |
|
86 /** |
|
87 * Refresh MIME type. This must be called |
|
88 * before using MimeType(). |
|
89 */ |
|
90 TInt RefreshMime(); |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * Refresh MIME type. |
|
96 */ |
|
97 void RefreshMimeL(); |
|
98 |
|
99 /** |
|
100 * Checks if file is located in video directory. |
|
101 */ |
|
102 TBool IsFileInVideoDirectory() const; |
|
103 |
|
104 private: |
|
105 |
|
106 /** |
|
107 * C++ default constructor. |
|
108 */ |
|
109 TMSRtContainer(TBool aDrmInPlayback); |
|
110 |
|
111 /** |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 */ |
|
114 void ConstructL(const TDesC& aFileName); |
|
115 |
|
116 private: |
|
117 // Data |
|
118 |
|
119 // File name with path |
|
120 HBufC* iFileName; |
|
121 |
|
122 // MIME type |
|
123 HBufC* iMimeType; |
|
124 |
|
125 // Extended security |
|
126 TBool iDrmInPlayback; |
|
127 }; |
|
128 |
|
129 } //namespace TMS { |
|
130 |
|
131 #endif // TMSRTCONTAINER_H |
|
132 |
|
133 // End of File |
|