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