First public contribution.
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This file contains definitions of GlobalAudioSettings.
21 #ifndef GLOBALAUDIOSETTINGSIMPL_H
22 #define GLOBALAUDIOSETTINGSIMPL_H
24 #include <e32property.h>
27 #include "GlobalAudioSettingsData.h"
28 #include <GlobalAudioSettings.h>
29 #include <MAudioClientsListObserver.h>
31 class MAudioSettingsObserver;
32 class CGlobalAudioSettings;
33 class CWarningTonesObserverAO;
34 class CMessagingTonesObserverAO;
35 class CSilentProfileObserverAO;
36 class CVibraObserverAO;
37 class CAudioClientsListManagerAO;
38 class CMessageToneObserverAO;
39 class CEmailToneObserverAO;
40 class CRingingTypeObserverAO;
41 class CVideoCallToneObserverAO;
42 class CRingingTone1ObserverAO;
43 class CRingingTone2ObserverAO;
44 class CKeypadToneObserverAO;
45 class CSilenceModeObserverAO;
47 * Defines functions that client uses to set phone profile settings.
49 * @lib GlobalAudioSettings.lib
50 * @since Series 60 3.2
52 NONSHARABLE_CLASS(CGlobalAudioSettingsImpl): public CBase
56 * function for creating the GlobalAudioSettingsImpl
59 static CGlobalAudioSettingsImpl* NewL(
60 CGlobalAudioSettings& aGlobalAudioSettings,
61 MAudioSettingsObserver& aAudioSettingsObserver);
66 ~CGlobalAudioSettingsImpl();
68 * Returns warning tones status.
70 * @since Series 60 3.2
71 * @return TBool aEnable. ETrue if warning tones are enabled else EFalse.
73 TBool IsWarningTonesEnabled();
75 * Returns message tones status.
77 * @since Series 60 3.2
78 * @return TBool aEnable. ETrue if message tones are enabled else EFalse.
80 TBool IsMessageTonesEnabled();
82 * Returns silent profile status.
84 * @since Series 60 3.2
85 * @return TBool aEnable. ETrue if current profile is silent profile else EFalse.
87 TBool IsSilentProfileEnabled();
89 * Returns vibra is enabled or not in the current profile status.
91 * @since Series 60 3.2
92 * @return TBool aEnable. ETrue if current profile vibra active else EFalse.
94 TBool IsVibraEnabled();
96 * Returns PublicSilence is enabled or not status.
98 * @since Series 60 3.2
99 * @return TBool aEnable. ETrue if PublicSilence active else EFalse.
101 TBool IsPublicSilenceEnabled();
103 * Returns Message Alert Tone
106 * The filename selected as the message alert tone in the
111 * @return TDesC& aMessageAlertToneName. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename
116 TDesC& MessageAlertTone();
118 * Returns Email Alert Tone status
121 * The filename selected as the email alert tone in the
126 * @return TBool aEnable. ETrue if current profile message tone is on else EFalse.
128 TBool IsMessageAlertToneEnabled();
130 * Returns Email Alert Tone
133 * The filename selected as the email alert tone in the
138 * @return TDesC& aEmailAlertToneName. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename
141 TDesC& EmailAlertTone();
143 * Returns Email Alert Tone status
146 * The filename selected as the email alert tone in the
151 * @return TBool aEnable. ETrue if current profile email alert tone is on else EFalse.
153 TBool IsEmailAlertToneEnabled();
155 * Returns the RingingType
158 * Ringing type set in the current profile
163 * @return TGASRingingType aRingingType.
165 CGlobalAudioSettings::TGASRingingType RingingType();
167 * Returns Videocall Alert Tone
170 * The filename selected as the video call alert tone in the
175 * @return TDesC& aVideoCallAlertToneName. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename
178 TDesC& VideoCallAlertTone();
180 * Returns Videocall Alert Tone status
183 * The filename selected as the video call alert tone in the
188 * @return TBool aEnable. ETrue if current profile videocall alert tone is on else EFalse.
190 TBool IsVideoCallAlertToneEnabled();
192 * Returns Ringing Alert Tone
195 * The filename selected as the ringing alert tone in the
199 * @return TDesC& aRingingAlertTone1Name. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename
203 TDesC& RingingAlertTone1();
205 * Returns Ringing Alert Tone1 status
208 * The filename selected as the ringing alert tone in the
213 * @return TBool aEnable. ETrue if current profile ringing alert tone is on else EFalse.
215 TBool IsRingingAlertTone1Enabled();
217 * Returns Ringing Alert Tone 2
220 * The filename selected as the ringing alert tone in the
221 * current profile for the alternate line
225 * @return TDesC& aRingingAlertTone2Name. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename
228 TDesC& RingingAlertTone2();
230 * Returns Ringing Alert Tone 2
233 * The filename selected as the ringing alert tone in the
234 * current profile for the alternate line
238 * @return TBool aEnable. ETrue if current profile ringing alert tone of alternate line is on else EFalse.
240 TBool IsRingingAlertTone2Enabled();
242 * Returns Ringing Keypad Volume
245 * The key tone volume selected in the
250 * @return TGASKeypadVolume aKeypadToneVolume.returns EGASKeypadVolumeOff sound is off,else selected volume level
253 CGlobalAudioSettings::TGASKeypadVolume KeyPadToneVolume();
255 * Returns silent mode status.
258 * @return TBool aEnable. ETrue if the silent mode is enabled else EFalse.
260 TBool IsSilenceModeEnabled();
262 * Registers audio clients list observer.
264 * When registered successfully, the observer will start receiveing
265 * callback defined in MAudioClientsListObserver when audio clients list
269 * @param MAudioClientsListObserver& aObserver. A reference to class
270 * implementing MAudioClientsListObserver interface.
271 * @return TInt. KErrNone if successful. KErrAlreadyExists if the observer
272 * is already registered.
274 TInt RegisterAudioClientsListObserver(
275 MAudioClientsListObserver& aObserver );
278 * Unregisters audio clients list observer.
280 * When unregistered, the observer will no longer receive callback when
281 * audio clients list changes.
284 * @param MAudioClientsListObserver& aObserver. A reference to class
285 * implementing MAudioClientsListObserver interface.
286 * @return TInt. KErrNone if successful. KErrNotFound if the observer
289 TInt UnregisterAudioClientsListObserver(
290 MAudioClientsListObserver& aObserver);
293 * Gets audio clients list.
295 * On return of this function, the parameter aList will contain active
296 * audio client application process ids.
298 * The parameter aList will be reset in the case
301 * @param TAudioClientListType aFilter. Type of client list.
302 * @param RArray<TProcessId>& aList. A reference to RArray.
303 * @return TInt. KErrNone if successful. KErrBadName if
304 * aType is not one of the TAudioClientListType enumeration.
305 * Otherwise a systemwide error code.
306 * In case of error, the array aList will be reset.
308 TInt GetAudioClientsList(
309 CGlobalAudioSettings::TAudioClientListType aType,
310 RArray<TProcessId>& aList );
314 CGlobalAudioSettingsImpl(CGlobalAudioSettings &aGlobalAudioSettings,
315 MAudioSettingsObserver& aAudioSettingsObserver);
317 * Second Phase Costructor for GlobalAudioSettingsImpl Instance
324 TGlobalAudioSettings iGlobalAudioSettingsData;
325 CGlobalAudioSettings& iGlobalAudioSettings;
326 MAudioSettingsObserver& iAudioSettingsObserver;
327 CWarningTonesObserverAO* iWarningTonesObserverAO;
328 CMessagingTonesObserverAO* iMessagingTonesObserverAO;
329 CSilentProfileObserverAO* iSilentProfileObserverAO;
330 CVibraObserverAO* iVibraObserverAO;
331 // Object managing Audio Clients List implementation
332 CAudioClientsListManagerAO* iCAudioClientsListManagerAO;
333 // Object managing Paused Clients List implementation
334 CAudioClientsListManagerAO* iPausedClientsListManagerAO;
335 // List of Audio Clients List Observer objects
336 RPointerArray<MAudioClientsListObserver> iAudioClientsListObserverArray;
339 CMessageToneObserverAO* iMessageToneObserverAO;
340 CEmailToneObserverAO* iEmailToneObserverAO;
341 CRingingTypeObserverAO* iRingingTypeObserverAO;
342 CVideoCallToneObserverAO* iVideoCallObserverAO;
343 CRingingTone1ObserverAO* iRingingTone1ObserverAO;
344 CRingingTone2ObserverAO* iRingingTone2ObserverAO;
345 CKeypadToneObserverAO* iKeypadToneObserverAO;
346 CSilenceModeObserverAO* iSilenceModeObserverAO;
350 NONSHARABLE_CLASS(CWarningTonesObserverAO) : public CActive
353 // Ist Phase constr and Destr
354 static CWarningTonesObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
355 MAudioSettingsObserver& aAudioSettingsObserver,
356 TGlobalAudioSettings& aGlobalAudioSettingsData);
357 ~CWarningTonesObserverAO();
364 TInt RunError(TInt aError);
367 // Constr and IInd phase constr
368 CWarningTonesObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
369 MAudioSettingsObserver& aAudioSettingsObserver,
370 TGlobalAudioSettings& aGlobalAudioSettingsData);
372 CGlobalAudioSettings& iGlobalAudioSettings;
373 MAudioSettingsObserver& iAudioSettingsObserver;
374 RProperty iWarningTonesProperty;
375 TGlobalAudioSettings& iGlobalAudioSettingsData;
378 NONSHARABLE_CLASS(CMessagingTonesObserverAO) : public CActive
381 // Ist Phase constr and Destr
382 static CMessagingTonesObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
383 MAudioSettingsObserver& aAudioSettingsObserver,
384 TGlobalAudioSettings& aGlobalAudioSettingsData);
385 ~CMessagingTonesObserverAO();
392 TInt RunError(TInt aError);
395 // Constr and IInd phase constr
396 CMessagingTonesObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
397 MAudioSettingsObserver& aAudioSettingsObserver,
398 TGlobalAudioSettings& aGlobalAudioSettingsData);
400 CGlobalAudioSettings& iGlobalAudioSettings;
401 MAudioSettingsObserver& iAudioSettingsObserver;
402 RProperty iMessagingTonesProperty;
403 TGlobalAudioSettings& iGlobalAudioSettingsData;
406 NONSHARABLE_CLASS( CSilentProfileObserverAO) : public CActive
409 // Ist Phase constr and Destr
410 static CSilentProfileObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
411 MAudioSettingsObserver& aAudioSettingsObserver,
412 TGlobalAudioSettings& aGlobalAudioSettingsData);
413 ~CSilentProfileObserverAO();
420 TInt RunError(TInt aError);
423 // Constr and IInd phase constr
424 CSilentProfileObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
425 MAudioSettingsObserver& aAudioSettingsObserver,
426 TGlobalAudioSettings& aGlobalAudioSettingsData);
428 CGlobalAudioSettings& iGlobalAudioSettings;
429 MAudioSettingsObserver& iAudioSettingsObserver;
430 RProperty iSilentProfileProperty;
431 TGlobalAudioSettings& iGlobalAudioSettingsData;
434 NONSHARABLE_CLASS(CVibraObserverAO) : public CActive
437 // Ist Phase constr and Destr
438 static CVibraObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
439 MAudioSettingsObserver& aAudioSettingsObserver,
440 TGlobalAudioSettings& aGlobalAudioSettingsData);
448 TInt RunError(TInt aError);
451 // Constr and IInd phase constr
452 CVibraObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
453 MAudioSettingsObserver& aAudioSettingsObserver,
454 TGlobalAudioSettings& aGlobalAudioSettingsData);
456 CGlobalAudioSettings& iGlobalAudioSettings;
457 MAudioSettingsObserver& iAudioSettingsObserver;
458 RProperty iVibraProperty;
459 TGlobalAudioSettings& iGlobalAudioSettingsData;
463 NONSHARABLE_CLASS(CRingingTypeObserverAO) : public CActive
466 // Ist Phase constr and Destr
467 static CRingingTypeObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
468 MAudioSettingsObserver& aAudioSettingsObserver,
469 TGlobalAudioSettings& aGlobalAudioSettingsData);
470 ~CRingingTypeObserverAO();
477 TInt RunError(TInt aError);
480 // Constr and IInd phase constr
481 CRingingTypeObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
482 MAudioSettingsObserver& aAudioSettingsObserver,
483 TGlobalAudioSettings& aGlobalAudioSettingsData);
485 CGlobalAudioSettings& iGlobalAudioSettings;
486 MAudioSettingsObserver& iAudioSettingsObserver;
487 RProperty iRingingTypeProperty;
488 TGlobalAudioSettings& iGlobalAudioSettingsData;
491 NONSHARABLE_CLASS(CMessageToneObserverAO) : public CActive
494 // Ist Phase constr and Destr
495 static CMessageToneObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
496 MAudioSettingsObserver& aAudioSettingsObserver,
497 TGlobalAudioSettings& aGlobalAudioSettingsData);
498 ~CMessageToneObserverAO();
505 TInt RunError(TInt aError);
508 // Constr and IInd phase constr
509 CMessageToneObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
510 MAudioSettingsObserver& aAudioSettingsObserver,
511 TGlobalAudioSettings& aGlobalAudioSettingsData);
513 CGlobalAudioSettings& iGlobalAudioSettings;
514 MAudioSettingsObserver& iAudioSettingsObserver;
515 RProperty iMessageToneNameProperty;
516 TGlobalAudioSettings& iGlobalAudioSettingsData;
519 NONSHARABLE_CLASS(CEmailToneObserverAO) : public CActive
522 // Ist Phase constr and Destr
523 static CEmailToneObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
524 MAudioSettingsObserver& aAudioSettingsObserver,
525 TGlobalAudioSettings& aGlobalAudioSettingsData);
526 ~CEmailToneObserverAO();
533 TInt RunError(TInt aError);
536 // Constr and IInd phase constr
537 CEmailToneObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
538 MAudioSettingsObserver& aAudioSettingsObserver,
539 TGlobalAudioSettings& aGlobalAudioSettingsData);
541 CGlobalAudioSettings& iGlobalAudioSettings;
542 MAudioSettingsObserver& iAudioSettingsObserver;
543 RProperty iEmailToneNameProperty;
544 TGlobalAudioSettings& iGlobalAudioSettingsData;
547 NONSHARABLE_CLASS(CVideoCallToneObserverAO) : public CActive
550 // Ist Phase constr and Destr
551 static CVideoCallToneObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
552 MAudioSettingsObserver& aAudioSettingsObserver,
553 TGlobalAudioSettings& aGlobalAudioSettingsData);
554 ~CVideoCallToneObserverAO();
561 TInt RunError(TInt aError);
564 // Constr and IInd phase constr
565 CVideoCallToneObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
566 MAudioSettingsObserver& aAudioSettingsObserver,
567 TGlobalAudioSettings& aGlobalAudioSettingsData);
569 CGlobalAudioSettings& iGlobalAudioSettings;
570 MAudioSettingsObserver& iAudioSettingsObserver;
571 RProperty iVideoCallToneNameProperty;
572 TGlobalAudioSettings& iGlobalAudioSettingsData;
575 NONSHARABLE_CLASS(CRingingTone1ObserverAO) : public CActive
578 // Ist Phase constr and Destr
579 static CRingingTone1ObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
580 MAudioSettingsObserver& aAudioSettingsObserver,
581 TGlobalAudioSettings& aGlobalAudioSettingsData);
582 ~CRingingTone1ObserverAO();
589 TInt RunError(TInt aError);
592 // Constr and IInd phase constr
593 CRingingTone1ObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
594 MAudioSettingsObserver& aAudioSettingsObserver,
595 TGlobalAudioSettings& aGlobalAudioSettingsData);
597 CGlobalAudioSettings& iGlobalAudioSettings;
598 MAudioSettingsObserver& iAudioSettingsObserver;
599 RProperty iRingingTone1NameProperty;
600 TGlobalAudioSettings& iGlobalAudioSettingsData;
603 NONSHARABLE_CLASS(CRingingTone2ObserverAO) : public CActive
606 // Ist Phase constr and Destr
607 static CRingingTone2ObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
608 MAudioSettingsObserver& aAudioSettingsObserver,
609 TGlobalAudioSettings& aGlobalAudioSettingsData);
610 ~CRingingTone2ObserverAO();
617 TInt RunError(TInt aError);
620 // Constr and IInd phase constr
621 CRingingTone2ObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
622 MAudioSettingsObserver& aAudioSettingsObserver,
623 TGlobalAudioSettings& aGlobalAudioSettingsData);
625 CGlobalAudioSettings& iGlobalAudioSettings;
626 MAudioSettingsObserver& iAudioSettingsObserver;
627 RProperty iRingingTone2NameProperty;
628 TGlobalAudioSettings& iGlobalAudioSettingsData;
631 NONSHARABLE_CLASS(CKeypadToneObserverAO) : public CActive
634 // Ist Phase constr and Destr
635 static CKeypadToneObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
636 MAudioSettingsObserver& aAudioSettingsObserver,
637 TGlobalAudioSettings& aGlobalAudioSettingsData);
638 ~CKeypadToneObserverAO();
645 TInt RunError(TInt aError);
648 // Constr and IInd phase constr
649 CKeypadToneObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
650 MAudioSettingsObserver& aAudioSettingsObserver,
651 TGlobalAudioSettings& aGlobalAudioSettingsData);
653 CGlobalAudioSettings& iGlobalAudioSettings;
654 MAudioSettingsObserver& iAudioSettingsObserver;
655 RProperty iKeypadToneVolumeProperty;
656 TGlobalAudioSettings& iGlobalAudioSettingsData;
659 NONSHARABLE_CLASS(CSilenceModeObserverAO) : public CActive
662 // Ist Phase constr and Destr
663 static CSilenceModeObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
664 MAudioSettingsObserver& aAudioSettingsObserver,
665 TGlobalAudioSettings& aGlobalAudioSettingsData);
666 ~CSilenceModeObserverAO();
673 TInt RunError(TInt aError);
676 // Constr and IInd phase constr
677 CSilenceModeObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
678 MAudioSettingsObserver& aAudioSettingsObserver,
679 TGlobalAudioSettings& aGlobalAudioSettingsData);
681 CGlobalAudioSettings& iGlobalAudioSettings;
682 MAudioSettingsObserver& iAudioSettingsObserver;
683 RProperty iSilenceModeProperty;
684 TGlobalAudioSettings& iGlobalAudioSettingsData;
686 #endif // GLOBALAUDIOSETTINGSIMPL_H