|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 // alarmalertwidget.h |
|
18 |
|
19 #ifndef __ALARM_ALERT_WIDGET__ |
|
20 #define __ALARM_ALERT_WIDGET__ |
|
21 |
|
22 // System includes |
|
23 #include <QObject> |
|
24 #include <QVariantMap> |
|
25 #include <QDateTime> |
|
26 |
|
27 // User includes |
|
28 #include "alarmcommon.h" |
|
29 |
|
30 // Forward declarations |
|
31 class HbDeviceDialog; |
|
32 class AlarmAlertObserver; |
|
33 |
|
34 // Class declaration |
|
35 /** |
|
36 * @class AlarmAlertWidget |
|
37 * @brief This is the client side of the device dialog plugin. |
|
38 * Contains API's to show, update and dismiss alarm dialogs |
|
39 */ |
|
40 class AlarmAlertWidget : public QObject |
|
41 { |
|
42 Q_OBJECT |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * @brief Constructor |
|
48 * @param observer This is the observer of all user events |
|
49 */ |
|
50 AlarmAlertWidget(AlarmAlertObserver *observer); |
|
51 |
|
52 /** |
|
53 * @brief Destructor |
|
54 */ |
|
55 ~AlarmAlertWidget(); |
|
56 |
|
57 /** |
|
58 * @brief Shows the alarm dialog |
|
59 * @param The alarm information to display |
|
60 * @return true on success, false otherwise |
|
61 */ |
|
62 bool showAlarmDialog(SAlarmInfo *alarmInfo); |
|
63 |
|
64 /** |
|
65 * @brief Dismisses any alarm dialog that is being shown |
|
66 * @return true on success, false otherwise |
|
67 */ |
|
68 bool dismissAlarmDialog(); |
|
69 |
|
70 /** |
|
71 * @brief Updates the alarm dialog with new information |
|
72 * @param The alarm information to update |
|
73 * @return true on success, false otherwise |
|
74 */ |
|
75 bool updateAlarmDialog(SAlarmInfo *alarmInfo); |
|
76 |
|
77 private slots: |
|
78 |
|
79 /** |
|
80 * @brief Slot to handle user interactions |
|
81 * @param params List of arguments the dialog has sent |
|
82 */ |
|
83 void triggerAction(QVariantMap params); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * @var mSubject |
|
89 * @brief Holds the alarm subject |
|
90 */ |
|
91 QString mSubject; |
|
92 |
|
93 /** |
|
94 * @var mLocation |
|
95 * @brief Holds the alarm location (for calendar alerts only) |
|
96 */ |
|
97 QString mLocation; |
|
98 |
|
99 /** |
|
100 * @var mAlarmTime |
|
101 * @brief Holds the alarm expiry time |
|
102 */ |
|
103 QDateTime mAlarmTime; |
|
104 |
|
105 /** |
|
106 * @var mDeviceDialog |
|
107 * @brief The interface to the device dialog server |
|
108 */ |
|
109 HbDeviceDialog *mDeviceDialog; |
|
110 |
|
111 /** |
|
112 * @var mIsClockAlarm |
|
113 * @brief Tells if the current alert being displayed |
|
114 * is a clock (true) or calendar alert (false) |
|
115 */ |
|
116 bool mIsClockAlarm; |
|
117 |
|
118 /** |
|
119 * @var mCanSnooze |
|
120 * @brief Tells whether the current alert can be snoozed. |
|
121 * true->alarm can be snoozed |
|
122 * false->alarm cannot be snoozed |
|
123 */ |
|
124 bool mCanSnooze; |
|
125 |
|
126 /** |
|
127 * @var mIsSilent |
|
128 * @brief Indicates if the alarm is silent or not |
|
129 */ |
|
130 bool mIsSilent; |
|
131 |
|
132 /** |
|
133 * @var mObserver |
|
134 * @brief The observer for user responses |
|
135 */ |
|
136 AlarmAlertObserver *mObserver; |
|
137 }; |
|
138 |
|
139 |
|
140 #endif |