equal
deleted
inserted
replaced
20 #include <QDateTime> |
20 #include <QDateTime> |
21 #include <hbdialog.h> |
21 #include <hbdialog.h> |
22 #include <hbdevicedialoginterface.h> |
22 #include <hbdevicedialoginterface.h> |
23 #include <hbeffect.h> |
23 #include <hbeffect.h> |
24 |
24 |
|
25 // User includes |
|
26 #include "alarmalert.h" |
|
27 |
25 // Forward declarations |
28 // Forward declarations |
26 class QGraphicsWidget; |
29 class QGraphicsWidget; |
27 class QEvent; |
30 class QEvent; |
28 class QTranslator; |
31 class QTranslator; |
29 class HbMainWindow; |
32 class HbMainWindow; |
30 class HbDocumentLoader; |
33 class HbDocumentLoader; |
31 class HbLabel; |
34 class HbLabel; |
32 class HbPushButton; |
35 class HbAction; |
33 |
36 class AlarmAlertDocLoader; |
34 const QString alarmSwipeUIDocml(":/xml/alarmalert.docml"); |
37 |
35 const QString alarmNormalUIDocml(":/xml/alarmalert_unlocked.docml"); |
38 const QString alarmNormalUICalendarDocml(":/xml/alarmalert_calendar_unlocked.docml"); |
|
39 const QString alarmNormalUIClockDocml(":/xml/alarmalert_clock_unlocked.docml"); |
|
40 const QString alarmNormalUITodoDocml(":/xml/alarmalert_todo_unlocked.docml"); |
36 |
41 |
37 // Class declaration |
42 // Class declaration |
38 /** |
43 /** |
39 * @class AlarmAlertDialogPrivate |
44 * @class AlarmAlertDialogPrivate |
40 * @brief The device dialog implementation for alarm alert |
45 * @brief The device dialog implementation for alarm alert |
79 /** |
84 /** |
80 * @brief Returns the device dialog instance |
85 * @brief Returns the device dialog instance |
81 */ |
86 */ |
82 HbDialog *deviceDialogWidget() const; |
87 HbDialog *deviceDialogWidget() const; |
83 |
88 |
|
89 /** |
|
90 * @brief Sets up the normal ui for alarms. |
|
91 * This UI is shown when the screen is unlocked |
|
92 */ |
|
93 void setupNormalUI(AlarmAlertDocLoader *alertDocLoader); |
|
94 |
84 protected: |
95 protected: |
85 |
96 |
86 /** |
97 /** |
87 * @brief From QGraphicsWidget |
98 * @brief From QGraphicsWidget |
88 * @see QGraphicsWidget |
99 * @see QGraphicsWidget |
91 |
102 |
92 /** |
103 /** |
93 * @brief From QGraphicsWidget |
104 * @brief From QGraphicsWidget |
94 * @see QGraphicsWidget |
105 * @see QGraphicsWidget |
95 */ |
106 */ |
96 bool sceneEvent(QEvent *event); |
|
97 |
|
98 /** |
|
99 * @brief From QGraphicsWidget |
|
100 * @see QGraphicsWidget |
|
101 */ |
|
102 void closeEvent(QCloseEvent *event); |
107 void closeEvent(QCloseEvent *event); |
103 |
108 |
104 /** |
|
105 * @brief From QGraphicsWidget |
|
106 * @see QGraphicsWidget |
|
107 */ |
|
108 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
109 |
|
110 /** |
|
111 * @brief From QGraphicsWidget |
|
112 * @see QGraphicsWidget |
|
113 */ |
|
114 void mouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
115 |
|
116 signals: |
109 signals: |
117 |
110 |
118 /** |
111 /** |
119 * @brief Emitted when the dialog is about to be closed |
112 * @brief Emitted when the dialog is about to be closed |
120 */ |
113 */ |
125 */ |
118 */ |
126 void deviceDialogData(QVariantMap data); |
119 void deviceDialogData(QVariantMap data); |
127 |
120 |
128 private slots: |
121 private slots: |
129 |
122 |
130 /** |
|
131 * @brief Callback function that gets called when the |
|
132 * slider animation ends |
|
133 * @param status The status of the animation |
|
134 */ |
|
135 void animationComplete(const HbEffect::EffectStatus &status); |
|
136 |
|
137 /** |
123 /** |
138 * @brief Callback function for handling orientation changes |
124 * @brief Callback function for handling orientation changes |
139 */ |
125 */ |
140 void handleOrientationChange(); |
126 void handleOrientationChange(); |
141 |
127 |
160 * @var parameters List of parameters |
146 * @var parameters List of parameters |
161 */ |
147 */ |
162 void parseAndFetchParams(const QVariantMap ¶meters); |
148 void parseAndFetchParams(const QVariantMap ¶meters); |
163 |
149 |
164 /** |
150 /** |
165 * @brief Sets up the swipe ui for alarms. |
|
166 * This UI is shown only when the screen is locked |
|
167 */ |
|
168 void setupSwipeUI(); |
|
169 |
|
170 /** |
|
171 * @brief Sets up the normal ui for alarms. |
|
172 * This UI is shown when the screen is unlocked |
|
173 */ |
|
174 void setupNormalUI(); |
|
175 |
|
176 /** |
|
177 * @brief Checks if the screen is locked |
|
178 * @return true if screen is locked, false otherwise |
|
179 */ |
|
180 bool isScreenLocked(); |
|
181 |
|
182 /** |
|
183 * @brief handles the calendar alarms |
151 * @brief handles the calendar alarms |
184 */ |
152 */ |
185 void handleCalendarAlarms(); |
153 void handleCalendarAlarms(); |
186 |
154 |
187 /** |
155 /** |
188 * @brief handles the clock alarms |
156 * @brief handles the clock alarms |
189 */ |
157 */ |
190 void handleClockAlarms(); |
158 void handleClockAlarms(); |
|
159 |
|
160 /** |
|
161 * @brief handles to-do alarms |
|
162 */ |
|
163 void handleToDoAlarms(); |
191 |
164 |
192 private: |
165 private: |
193 Q_DISABLE_COPY(AlarmAlertDialogPrivate) |
166 Q_DISABLE_COPY(AlarmAlertDialogPrivate) |
194 |
167 |
195 /** |
168 /** |
251 * Required for getting orientation change events |
224 * Required for getting orientation change events |
252 */ |
225 */ |
253 HbMainWindow *mMainWindow; |
226 HbMainWindow *mMainWindow; |
254 |
227 |
255 /** |
228 /** |
256 * @var mDocLoader |
229 * @var mAlertDocLoader |
257 * @brief The document loader for loading docml's |
230 * @brief The document loader for loading docml's |
258 */ |
231 */ |
259 HbDocumentLoader *mDocLoader; |
232 AlarmAlertDocLoader* mAlertDocLoader; |
260 |
233 |
261 /** |
234 /** |
262 * @var mSnoozeButton |
235 * @var mSnoozeAction |
263 * @brief snooze button for alarm |
236 * @brief snooze softkey for alarm |
264 */ |
237 */ |
265 HbPushButton *mSnoozeButton; |
238 HbAction *mSnoozeAction; |
266 |
239 |
267 /** |
240 /** |
268 * @var mUserResponse |
241 * @var mUserResponse |
269 * @brief Stores the user response |
242 * @brief Stores the user response |
270 */ |
243 */ |
271 int mUserResponse; |
244 int mUserResponse; |
272 |
245 |
273 /** |
246 /** |
274 * @var mIsClockAlarm |
247 * @var mAlarmAlertType |
275 * @brief Tells if the current alert being displayed |
248 * @brief Tells if the type of alert being displayed |
276 * is a clock (true) or calendar alert (false) |
249 * is a clock /calendar/to-do alert |
277 */ |
250 */ |
278 bool mIsClockAlarm; |
251 AlarmType mAlarmAlertType; |
279 |
252 |
280 /** |
253 /** |
281 * @var mCanSnooze |
254 * @var mCanSnooze |
282 * @brief Tells whether the current alert can be snoozed. |
255 * @brief Tells whether the current alert can be snoozed. |
283 * true->alarm can be snoozed |
256 * true->alarm can be snoozed |
290 * @brief Indicates if the alarm is silent or not |
263 * @brief Indicates if the alarm is silent or not |
291 */ |
264 */ |
292 bool mIsSilent; |
265 bool mIsSilent; |
293 |
266 |
294 /** |
267 /** |
|
268 * @var mIsTimedAlarm |
|
269 * @brief Indicates if the alarm is has time info or not |
|
270 */ |
|
271 bool mIsTimedAlarm; |
|
272 |
|
273 /** |
295 * @var mClosedByClient |
274 * @var mClosedByClient |
296 * @brief Indicates if the alarm dialog is closed by the client |
275 * @brief Indicates if the alarm dialog is closed by the client |
297 */ |
276 */ |
298 bool mClosedByClient; |
277 bool mClosedByClient; |
299 |
278 |
300 /** |
279 /** |
301 * @var mIsSilenceButton |
280 * @var mIsSilenceKey |
302 * @brief Indicates if the silence button is shown for alarm |
281 * @brief Indicates if the silence softkey is shown for alarm |
303 */ |
282 */ |
304 bool mIsSilenceButton; |
283 bool mIsSilenceKey; |
305 }; |
284 }; |