|
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: The header file for CClkUiAlarmModel class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CLKUI_ALARM_MODEL_H__ |
|
19 #define __CLKUI_ALARM_MODEL_H__ |
|
20 |
|
21 // System includes |
|
22 |
|
23 // User includes |
|
24 #include "clkuimdlbase.h" |
|
25 #include "clkcommon.h" |
|
26 |
|
27 // Forward declarations |
|
28 |
|
29 // Class declaration |
|
30 /** |
|
31 * @class CClkUiAlarmModel |
|
32 * @brief The model class for alarm server interface. |
|
33 * @dll clkuimodel.dll |
|
34 */ |
|
35 class CClkUiAlarmModel : public CClkUiModelBase |
|
36 { |
|
37 public: // Constructor and destructor |
|
38 |
|
39 /** |
|
40 * @brief 2-phased constructor. |
|
41 * @param aObserver MClkUiMdlObserver* |
|
42 * @param aListenerPriority The priority of this object. |
|
43 * @return CClkAlmModel* Pointer to the constructed alarm model. |
|
44 */ |
|
45 IMPORT_C static CClkUiAlarmModel* NewL( MClkModelObserver* aObserver, TInt aListenerPriority ); |
|
46 |
|
47 /** |
|
48 * @brief Destructor. |
|
49 */ |
|
50 IMPORT_C ~CClkUiAlarmModel(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * @brief Interpret the listener status. |
|
56 * @param aStatus The status. |
|
57 */ |
|
58 void ProcessListenerL( TInt aStatus ); |
|
59 |
|
60 /** |
|
61 * @brief Get the list of the alarms which belong to clock category |
|
62 * @param aAlarmIds A reference to the list of alarm ids. Filled by alarm server. |
|
63 */ |
|
64 IMPORT_C void GetClkAlarmIds( RArray< TAlarmId >& aAlarmIds ); |
|
65 |
|
66 /** |
|
67 * @brief Deletes a clock alarm with |
|
68 * @param aAlarmId The id of the alarm to be deleted. |
|
69 * @return TInt Symbian OS error code. |
|
70 */ |
|
71 IMPORT_C TInt DeleteClockAlarm( TAlarmId aAlarmId ); |
|
72 |
|
73 /** |
|
74 * @brief Enable or disable a clock alarm. |
|
75 * @param aAlarmId The id of the clock alarm. |
|
76 * @param aState The status to which the alarm has to be changed. |
|
77 * @return TInt Symbian OS error code. |
|
78 */ |
|
79 IMPORT_C TInt ClockAlarmEnable( TAlarmId aAlarmId, |
|
80 TAlarmStatus aState ); |
|
81 |
|
82 /** |
|
83 * @brief Get alarm status |
|
84 * @param aAlarmId The id of the clock alarm whose status is needed. |
|
85 * @return TAlarmStatus The current status. |
|
86 */ |
|
87 IMPORT_C TAlarmStatus ClockAlarmStatus( TAlarmId aAlarmId ) const; |
|
88 |
|
89 /** |
|
90 * @brief Get the category of the clock alarm. |
|
91 * @param aCategory The category of the alarm with id aAlarmId. |
|
92 * @param aAlarmId The id of the alarm. |
|
93 * @return TInt Symbian OS error code. |
|
94 */ |
|
95 IMPORT_C TInt ClockAlarmType( TAlarmCategory& aCategory, |
|
96 TAlarmId aAlarmId ) const; |
|
97 |
|
98 /** |
|
99 * @brief Set a new clock alarm. |
|
100 * @param aAlarmInfo The new information. |
|
101 * @return TInt Symbian OS error code. |
|
102 */ |
|
103 IMPORT_C TInt ClockAlarmSet( const SClkAlarmInfo& aAlarmInfo ); |
|
104 |
|
105 /** |
|
106 * @brief Gets the information about an alarm. |
|
107 * @param aAlarmId The id of the clock alarm. |
|
108 * @param aAlarmInfo The information of the alarm, filled by the alarm server. |
|
109 * @return TInt Symbian OS error code. |
|
110 */ |
|
111 IMPORT_C TInt ClockAlarmInfo( TAlarmId aAlarmId, |
|
112 SClkAlarmInfo& aAlarmInfo ) const; |
|
113 |
|
114 /** |
|
115 * @brief Get the alarm Id. |
|
116 * @return const TAlarmId |
|
117 */ |
|
118 IMPORT_C const TAlarmId& AlarmId(); |
|
119 |
|
120 /** |
|
121 * @brief Saves the latest alarm id. |
|
122 * @param aAlarmId The new alarm id. |
|
123 */ |
|
124 IMPORT_C void SaveLatestAlarmId( TAlarmId aAlarmId ); |
|
125 |
|
126 /** |
|
127 * @brief Gets the queued or snoozed alarm Id. |
|
128 * @param aAlarmId Queued or snoozed alarm Id. |
|
129 * @param aUpdatedId ETrue Update alarm Id. |
|
130 * @return ETrue queued or snoozed alarm is existed. |
|
131 */ |
|
132 IMPORT_C TBool GetAlarmQueuedOrSnoozedId( TAlarmId& aAlarmId, |
|
133 TBool aUpdatedId = EFalse ); |
|
134 |
|
135 private: // New functions |
|
136 |
|
137 /** |
|
138 * @brief Performs the second phase of the 2-phase construction. |
|
139 * @param aObserver MClkUiMdlObserver* |
|
140 * @param aListenerPriority The priority of this object. |
|
141 */ |
|
142 void ConstructL( MClkModelObserver* aObserver, |
|
143 TInt aListenerPriority ); |
|
144 |
|
145 private: // Data |
|
146 |
|
147 /** |
|
148 * @var iAlarmSrvSes |
|
149 * @brief Object of alarm server session. |
|
150 */ |
|
151 RASCliSession iAlarmSrvSes; |
|
152 |
|
153 /** |
|
154 * @var iAlarmObject |
|
155 * @brief To get the information related to set an alarm. |
|
156 */ |
|
157 TASShdAlarm iAlarmObject; |
|
158 |
|
159 /** |
|
160 * @var iAlarmId |
|
161 * @brief The id of an alarm. |
|
162 */ |
|
163 TAlarmId iAlarmId; |
|
164 }; |
|
165 |
|
166 #endif // __CLKUI_ALARM_MODEL_H__ |
|
167 |
|
168 // End of file |