13 * |
13 * |
14 * Description: |
14 * Description: |
15 * This file defines the API for System Tone Service which is |
15 * This file defines the API for System Tone Service which is |
16 * implemented in the systemtoneservice.dll. |
16 * implemented in the systemtoneservice.dll. |
17 */ |
17 */ |
18 |
|
19 #ifndef SYSTEMTONESERVICE_H_ |
18 #ifndef SYSTEMTONESERVICE_H_ |
20 #define SYSTEMTONESERVICE_H_ |
19 #define SYSTEMTONESERVICE_H_ |
21 |
|
22 // System includes |
20 // System includes |
23 #include <e32base.h> |
21 #include <e32base.h> |
24 |
|
25 // Forward declarations |
22 // Forward declarations |
26 NONSHARABLE_CLASS( CStsImplementation); |
23 NONSHARABLE_CLASS( CStsImplementation); |
27 |
24 |
28 //Observer declaration |
25 //Observer declaration |
29 /** |
26 /** |
200 * alarm will be played. Alarms are tones that are long or not fixed duration such as a |
197 * alarm will be played. Alarms are tones that are long or not fixed duration such as a |
201 * calendar alarm that can be manually stopped by the client. The client is notified |
198 * calendar alarm that can be manually stopped by the client. The client is notified |
202 * when an alarm playback completes if it is not manually stopped by the client. |
199 * when an alarm playback completes if it is not manually stopped by the client. |
203 * |
200 * |
204 * @param[in] aAlarm The system alarm type to play. |
201 * @param[in] aAlarm The system alarm type to play. |
205 * @param[out] aAlarmContext A guaranteed globablly unique context representing this |
202 * @param[out] aAlarmContext A guaranteed globally unique context representing this |
206 * specific alarm playback that can be used for stopping the |
203 * specific alarm playback that can be used for stopping the |
207 * alarm or used to indicate to the observer which alarm playback |
204 * alarm or used to indicate to the observer which alarm playback |
208 * has completed. |
205 * has completed. |
209 * @param[in] aObserver A reference to the observer that is to be notified if this alarm |
206 * @param[in] aObserver A reference to the observer that is to be notified if this alarm |
210 * playback completes before StopAlarm is called. The same observer |
207 * playback completes before StopAlarm is called. The same observer |
212 * same time. It is the responsibility of the client to manage the |
209 * same time. It is the responsibility of the client to manage the |
213 * life cycle of the observer. However the observer must exist until |
210 * life cycle of the observer. However the observer must exist until |
214 * all alarms the observer is associated with are either completed |
211 * all alarms the observer is associated with are either completed |
215 * or stopped. |
212 * or stopped. |
216 */ |
213 */ |
217 IMPORT_C void PlayAlarm(TAlarmType aAlarm, unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver); |
214 IMPORT_C void PlayAlarm(TAlarmType aAlarm, unsigned int& aAlarmContext, |
|
215 MStsPlayAlarmObserver& aObserver); |
|
216 |
|
217 /** |
|
218 * Plays the specified system tone as an alarm. If the tone type is not recognized, a default |
|
219 * default tone will be played. Using this method allows the clients to stop the tone or get |
|
220 * a callback when the tone playback completes. |
|
221 * |
|
222 * @param[in] aTone The system tone type to play. |
|
223 * @param[out] aAlarmContext A guaranteed globally unique context representing this |
|
224 * specific tone playback that can be used for stopping the |
|
225 * tone or used to indicate to the observer which playback |
|
226 * has completed. |
|
227 * @param[in] aObserver A reference to the observer that is to be notified if this alarm |
|
228 * playback completes before StopAlarm is called. The same observer |
|
229 * can be used for multiple PlayAlarms, even for ones playing at the |
|
230 * same time. It is the responsibility of the client to manage the |
|
231 * life cycle of the observer. However the observer must exist until |
|
232 * all alarms the observer is associated with are either completed |
|
233 * or stopped. |
|
234 */ |
|
235 IMPORT_C void PlayAlarm(TToneType aTone, unsigned int& aAlarmContext, |
|
236 MStsPlayAlarmObserver& aObserver); |
218 |
237 |
219 /** |
238 /** |
220 * Stops the specified system alarm playback. If the playback has already completed or the |
239 * Stops the specified system alarm playback. If the playback has already completed or the |
221 * context is not valid, this method does nothing. |
240 * context is not valid, this method does nothing. |
222 * |
241 * |
223 * @param[in] aAlarmContext The context to the specific alarm that is to be stopped. |
242 * @param[in] aAlarmContext The context to the specific alarm that is to be stopped. |
224 */ |
243 */ |
225 IMPORT_C void StopAlarm(unsigned int aAlarmContext); |
244 IMPORT_C void StopAlarm(unsigned int aAlarmContext); |
226 |
|
227 IMPORT_C void PlayAlarm(TToneType aTone, unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver); |
|
228 |
245 |
229 protected: |
246 protected: |
230 // Protected constructors and destructors |
247 // Protected constructors and destructors |
231 CSystemToneService(CStsImplementation& aImplementation); |
248 CSystemToneService(CStsImplementation& aImplementation); |
232 ~CSystemToneService(); |
249 ~CSystemToneService(); |