|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Contains declaration of CAlarmControlsManager class, which implements the |
|
15 // MEikServAlarmFactory mixin |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __ALARM_CONTROLS_MANAGER_H__ |
|
20 #define __ALARM_CONTROLS_MANAGER_H__ |
|
21 |
|
22 // User Includes |
|
23 #include "TestMultipleAlarmsServer.h" |
|
24 |
|
25 // System Includes |
|
26 #include <uikon/eiksvfty.h> |
|
27 #include <asshdalarm.h> |
|
28 #include <test/testexecutelog.h> |
|
29 #include <uikon/eiknotifyalert.h> |
|
30 |
|
31 namespace TestMultipleAlarms |
|
32 { |
|
33 enum TAlarmControlState |
|
34 { |
|
35 EConstructed, |
|
36 ERelease, |
|
37 EShowAlarm, |
|
38 EHideAlarm, |
|
39 ECurrentServerState, |
|
40 EUpdateSoundPauseTimeInterval, |
|
41 EUpdateForAlarmServerState, |
|
42 EUpdateAlarmInfo, |
|
43 EStartPlayAlarm, |
|
44 EStopPlayAlarm |
|
45 }; |
|
46 |
|
47 enum TAlarmAction |
|
48 { |
|
49 ESnooze, |
|
50 EClear, |
|
51 EStopActiveScheduler |
|
52 }; |
|
53 } |
|
54 |
|
55 class CDummyAlarmControl; |
|
56 class CAlarmActionPerformer; |
|
57 |
|
58 /** |
|
59 Class which implements the MEikServAlarmFactory mixin. |
|
60 @internalTechnology |
|
61 @test |
|
62 */ |
|
63 class CAlarmControlsManager : public CBase, public MEikServAlarmFactory |
|
64 { |
|
65 public: |
|
66 |
|
67 // 1st phase Construction |
|
68 static CAlarmControlsManager* CAlarmControlsManager::NewL(CTestMultipleAlarmsServer& aTestServer); |
|
69 |
|
70 // Destruction |
|
71 ~CAlarmControlsManager(); |
|
72 |
|
73 // From MEikServAlarmFactory |
|
74 MEikServAlarm* NewAlarmL(CEikAlmControlSupervisor& aSupervisor); |
|
75 |
|
76 // Other functions |
|
77 MEikServAlarm* GetAlarmControlObjectL(const TDesC& aAlarmMessage); |
|
78 void IncrementNoOfCurrentlyNotifyingAlarms(); |
|
79 void DecrementNoOfCurrentlyNotifyingAlarms(); |
|
80 void UpdateCurrentlyPlayingAlarmId(const TAlarmId& aAlarmId); |
|
81 TInt CurrentMaxAlarms(); |
|
82 const TDesC& GetFunctionName(TInt aCallBack); |
|
83 void PrintLog(const TDesC& aMessage) const; |
|
84 void RemoveFromList(CDummyAlarmControl* aDummyAlarmControl); |
|
85 TInt GetAlarmControlListCount(); |
|
86 RPointerArray<MEikServAlarm> GetAlarmControlListL(); |
|
87 void SnoozeAlarmL(const TDesC& aAlarmMessage, TRequestStatus* aStatus, const TInt& aMinsToSnooze); |
|
88 void ClearAlarmL(const TDesC& aAlarmMessage, TRequestStatus* aStatus); |
|
89 void EndAlertServerThreadL(TRequestStatus* aStatus); |
|
90 |
|
91 private: |
|
92 // Constructor |
|
93 CAlarmControlsManager(CTestMultipleAlarmsServer& aTestServer); |
|
94 // 2nd phase Construction |
|
95 void ConstructL(); |
|
96 |
|
97 void SignalAlertServerThread(); |
|
98 void SetAlarmActionCommonParamsL(const TDesC& aAlarmMessage, TRequestStatus* aStatus, const TestMultipleAlarms::TAlarmAction& aAlarmAction); |
|
99 |
|
100 private: |
|
101 RPointerArray<MEikServAlarm> iAlarmControlList; |
|
102 CTestMultipleAlarmsServer& iTestServer; |
|
103 CAlarmActionPerformer* iAlarmActionPerformer; |
|
104 }; |
|
105 |
|
106 #endif // __ALARM_CONTROLS_MANAGER_H__ |
|
107 |