|
1 // Copyright (c) 2003-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 // |
|
15 |
|
16 #ifndef __CONSOLEANTESTCLIENT_H__ |
|
17 #define __CONSOLEANTESTCLIENT_H__ |
|
18 |
|
19 #include <asshdalarm.h> |
|
20 #include <asshddefs.h> |
|
21 |
|
22 enum TASAltTestOpCode |
|
23 { |
|
24 EASAltTestOpCodeAcknowledgeAlarm = 0x1000, |
|
25 EASAltTestOpCodeGetAttachment, |
|
26 EASAltTestOpCodeGetIsNotifying, |
|
27 EASAltTestOpCodeSetExtendedMode, |
|
28 EASAltTestOpCodeUnsetExtendedMode, |
|
29 EASAltTestOpCodeSetUserTime, |
|
30 EASAltTestOpCodeSetMaxAlarms, |
|
31 EASAltTestOpCodeNotifyOnAlarm, |
|
32 EASAltTestOpCodeNotifyOnSoundStart, |
|
33 EASAltTestOpCodeNotifyOnSoundStop, |
|
34 EASAltTestOpCodeNotifyOnVisible, |
|
35 EASAltTestOpCodeNotifyOnState, |
|
36 EASAltTestOpCodeResponseSnoozeAlarm, |
|
37 EASAltTestOpCodeResponseSilenceAlarm, |
|
38 EASAltTestOpCodeResponseAcknowledgeAlarm, |
|
39 EASAltTestOpCodeResponsePauseSound, |
|
40 EASAltTestOpCodeCancelNotifications, |
|
41 EASAltTestOpCodeResponseAcknowledgeAll, |
|
42 EASAltTestOpCodeNotifyOnDelete, |
|
43 }; |
|
44 |
|
45 /** |
|
46 Session with the Console Alarm Alert Server. The Console Alarm Alert Server must be running before using this class. |
|
47 It provides methods program the behaviour of the Console Alarm Alert Server and wait for events in the Console Alarm Alert Server. |
|
48 Usage example: |
|
49 |
|
50 @code |
|
51 |
|
52 RANTestClient client; |
|
53 User::LeaveIfError(client.Connect()); |
|
54 CleanupClosePushL(client); |
|
55 |
|
56 User::LeaveIfError(client.SetExtendedMode()); |
|
57 |
|
58 TASShdAlarm alarm; |
|
59 TRequestStatus status; |
|
60 User::LeaveIfError(client.NotifyOnAlarm(alarm, status)); |
|
61 |
|
62 User::WaitForRequest(status); |
|
63 |
|
64 User::LeaveIfError(client.UnsetExtendedMode()); |
|
65 CleanupStack::PopAndDestroy(); |
|
66 |
|
67 @endcode |
|
68 |
|
69 @internalTechnology |
|
70 @test |
|
71 */ |
|
72 |
|
73 class RANTestClient: public RSessionBase |
|
74 { |
|
75 public: |
|
76 IMPORT_C RANTestClient(); |
|
77 IMPORT_C TInt Connect(); |
|
78 IMPORT_C void AcknowledgeAlarm(); |
|
79 IMPORT_C void GetAttachment(TDes8& buf); |
|
80 IMPORT_C TBool IsNotifying(); |
|
81 |
|
82 IMPORT_C TInt SetExtendedMode() const; |
|
83 IMPORT_C TInt UnsetExtendedMode() const; |
|
84 IMPORT_C TInt SetUserTime(const TTime& aTime) const; |
|
85 IMPORT_C TInt SetMaxAlarms(const TInt aMax) const; |
|
86 |
|
87 IMPORT_C TInt NotifyOnAlarm(TASShdAlarm& aAlarm, TFullName& aFullname, TDes8& aSink, TRequestStatus& aStatus); |
|
88 IMPORT_C TInt NotifyOnAlarm(TASShdAlarm& aAlarm, TFullName& aFullname, TRequestStatus& aStatus); |
|
89 IMPORT_C TInt NotifyOnAlarm(TASShdAlarm& aAlarm, TRequestStatus& aStatus); |
|
90 |
|
91 IMPORT_C TInt NotifyOnSoundStart(TAlarmId& aId, TDes& aFilename, TRequestStatus& aStatus); |
|
92 IMPORT_C TInt NotifyOnSoundStop(TAlarmId& aId, TRequestStatus& aStatus); |
|
93 IMPORT_C TInt NotifyOnVisible(TAlarmId& aId, TBool& aVisible, TRequestStatus& aStatus); |
|
94 IMPORT_C TInt NotifyOnState(TAlarmId& aId, TInt& aState, TRequestStatus& aStatus); |
|
95 IMPORT_C TInt NotifyOnDelete(TAlarmId& aId, TRequestStatus& aStatus); |
|
96 |
|
97 IMPORT_C TInt SnoozeAlarm(const TAlarmId& aId, const TTime& aTime) const; |
|
98 IMPORT_C TInt SilenceAlarm(const TAlarmId& aId) const; |
|
99 IMPORT_C TInt AcknowledgeAlarm(const TAlarmId& aId) const; |
|
100 IMPORT_C TInt AcknowledgeAll() const; |
|
101 IMPORT_C TInt PauseSoundForAlarm(const TAlarmId& aId, const TTime& aTime) const; |
|
102 |
|
103 IMPORT_C TInt CancelNotifications(); |
|
104 |
|
105 private: |
|
106 TPtr8 iAlarmPtr; |
|
107 TPtr8 iSoundStartIdPtr; |
|
108 TPtr8 iSoundStopIdPtr; |
|
109 TPtr8 iVisibleIdPtr; |
|
110 TPtr8 iVisibleBoolPtr; |
|
111 TPtr8 iStateIdPtr; |
|
112 TPtr8 iStateIntPtr; |
|
113 TPtr8 iDeleteIdPtr; |
|
114 }; |
|
115 |
|
116 |
|
117 #endif //__CONSOLEANTESTCLIENT_H__ |