|
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: 'Set Assigntone' component for retrieving ringtone. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef EVTMGMTUIRINGTONECOMPONENT_H_ |
|
20 #define EVTMGMTUIRINGTONECOMPONENT_H_ |
|
21 |
|
22 #include <e32base.h> // CBase |
|
23 |
|
24 /** |
|
25 * @class CEvtMgmtUiRingtoneComponent |
|
26 * Class that represents 'Set tone' component of editor |
|
27 * |
|
28 * This class acts as 'set tone' component of editor. |
|
29 * It is used to retrieve tones from memory. |
|
30 * It is also used to record new ringtone and to pass its path to editor |
|
31 * |
|
32 * @since S60 v9.1 |
|
33 */ |
|
34 class CAknIconArray; |
|
35 class CNewFileServiceClient; |
|
36 class CFLDFileListContainer; |
|
37 |
|
38 class CEvtMgmtUiRingtoneComponent: public CBase |
|
39 { |
|
40 private: |
|
41 /* |
|
42 * 'Set tone' popup dialog options |
|
43 */ |
|
44 enum TEvtMgmtUiAssignedTone |
|
45 { |
|
46 /* |
|
47 * It indicates that 'select tone from existing' is selected |
|
48 * from popup dialog |
|
49 */ |
|
50 EEvtMgmtUiAssignedToneTone, |
|
51 /* |
|
52 * It indicates that 'record new tone' is selected |
|
53 * from popup dialog |
|
54 */ |
|
55 EvtMgmtUiAssignedToneRecordNew |
|
56 }; |
|
57 |
|
58 public: // Constructor and destructor |
|
59 /** |
|
60 * Static Two phase constructor |
|
61 * @param [in] aPrevRingtone - previous ringtone of the existing event |
|
62 * - null for newly created event |
|
63 */ |
|
64 static CEvtMgmtUiRingtoneComponent* NewL( const TPtrC aPrevRingtone ); |
|
65 /** |
|
66 * Static Two phase constructor |
|
67 * @param [in] aPrevRingtone - previous ringtone of the existing event |
|
68 * - null for newly created event |
|
69 */ |
|
70 static CEvtMgmtUiRingtoneComponent* NewLC( const TPtrC aPrevRingtone ); |
|
71 |
|
72 /** |
|
73 * Virtual destructor |
|
74 */ |
|
75 virtual ~CEvtMgmtUiRingtoneComponent(); |
|
76 |
|
77 public:// new functions |
|
78 |
|
79 /** |
|
80 * It is used to retrieve the selected ringtone's absolute path. |
|
81 * |
|
82 * @since S60 v9.1 |
|
83 * |
|
84 * @ret absolute path of the selected ringtone |
|
85 */ |
|
86 TPtrC Ringtone() const; |
|
87 |
|
88 /** |
|
89 * It is used to retrieve the default ringtone's absolute path. |
|
90 * |
|
91 * @since S60 v9.1 |
|
92 * |
|
93 * @ret absolute path of the default ringtone |
|
94 */ |
|
95 TPtrC DefaultRingtoneL(); |
|
96 |
|
97 /** |
|
98 * It is used to display 'Set tone' popup dialog and to retrieve ringtone. |
|
99 * |
|
100 * @since S60 v9.1 |
|
101 * |
|
102 * @ret error if there is any error |
|
103 * KErrNone if it is successful |
|
104 */ |
|
105 TInt DisplayAudioTonePopupDlgL(); |
|
106 |
|
107 |
|
108 private: // Constructor |
|
109 /** |
|
110 * C++ Default constructor |
|
111 */ |
|
112 CEvtMgmtUiRingtoneComponent(); |
|
113 |
|
114 /** |
|
115 * Second phase of the two phase constructor |
|
116 * @param [in] aPrevRingtone - previous ringtone of the existing event |
|
117 */ |
|
118 void ConstructL( const TPtrC aPrevRingtone ); |
|
119 |
|
120 private: // new functions |
|
121 |
|
122 /** |
|
123 * It is used to display generic popup dialog. |
|
124 * |
|
125 * @since S60 v9.1 |
|
126 * |
|
127 * @ret index of item selected if OK is pressed |
|
128 * KErrCancel if Cancel is pressed |
|
129 */ |
|
130 TInt DisplayPopupDlgL(); |
|
131 |
|
132 /* |
|
133 * It is used to record new ringtone. |
|
134 * |
|
135 * @since S60 v5.0 |
|
136 * |
|
137 * @ret KErrNone if recording is succesful. |
|
138 * error code if it is failed. |
|
139 */ |
|
140 TInt RecordNewToneL(); |
|
141 |
|
142 /* |
|
143 * It is used to generate filename for recording new file. |
|
144 * |
|
145 * @since S60 v5.0 |
|
146 * |
|
147 * @param[out] aFileName - it will contain generated file-name |
|
148 * @ret KErrNone if recording is succesful. |
|
149 * error code if it is failed. |
|
150 */ |
|
151 TInt FileNameForRecordingL( TDes& aFileName ); |
|
152 |
|
153 /** |
|
154 * It is used display system's 'select tone' dialog. |
|
155 * |
|
156 * @since S60 v5.0 |
|
157 * |
|
158 * @ret error while displaying 'select tone' dialog and |
|
159 * retrieving ringtone from it. |
|
160 * KErrNone if it is successful |
|
161 */ |
|
162 TInt DisplayRingtoneSelectionDlgL(); |
|
163 |
|
164 /** |
|
165 * It is used to update icons |
|
166 */ |
|
167 void UpdateIconsL( CAknListQueryDialog& aDialog ); |
|
168 |
|
169 /** |
|
170 * Append icon to icon array. CAknIconArray owns icons so it is |
|
171 * easier to it leave safely. |
|
172 * @param aIcons icon array |
|
173 * @param aIconFileWithPath icon file name with path |
|
174 * @param aSkinID skin id of the icon |
|
175 * @param aIconGraphicsIndex picture index |
|
176 * @param aIconGraphicsMaskIndex mask index |
|
177 */ |
|
178 void AddIconL( CAknIconArray& aIcons, |
|
179 const TDesC& aIconFileWithPath, |
|
180 TAknsItemID aSkinID, |
|
181 TInt aIconGraphicsIndex, |
|
182 TInt aIconGraphicsMaskIndex ); |
|
183 |
|
184 /** |
|
185 * Gets Events Management UI icon file path and name. Ownership |
|
186 * is transferred, item is left in the cleanup stack. |
|
187 * @return TFileName* The full name of the Events UI icon file. |
|
188 */ |
|
189 TFileName* IconFileNameLC() const; |
|
190 |
|
191 private: |
|
192 /** |
|
193 * Ringtone value |
|
194 * owns |
|
195 */ |
|
196 HBufC* iRingtone; |
|
197 |
|
198 /** |
|
199 * New File Service Instance |
|
200 * owns |
|
201 */ |
|
202 CNewFileServiceClient* iRecorderClient; |
|
203 |
|
204 /** |
|
205 * File List component |
|
206 * owns |
|
207 */ |
|
208 CFLDFileListContainer* iSelectRingtoneDlg; |
|
209 }; |
|
210 |
|
211 #endif //EVTMGMTUIRINGTONECOMPONENT_H_ |