9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 // alarmalertwidget.h |
17 // alarmalertwidget.h |
18 |
18 |
19 #ifndef __ALARM_ALERT_WIDGET__ |
19 #ifndef __ALARM_ALERT_WIDGET__ |
20 #define __ALARM_ALERT_WIDGET__ |
20 #define __ALARM_ALERT_WIDGET__ |
21 |
21 |
22 // System includes |
22 // System includes |
23 #include <QObject> |
23 #include <QObject> |
24 #include <QVariantMap> |
24 #include <hbdevicedialogsymbian.h> |
25 #include <QDateTime> |
|
26 |
25 |
27 // User includes |
26 // User includes |
28 #include "alarmcommon.h" |
27 #include "alarmcommon.h" |
29 |
28 |
30 // Forward declarations |
29 // Forward declarations |
31 class HbDeviceDialog; |
30 class CHbDeviceDialogSymbian; |
32 class AlarmAlertObserver; |
31 class AlarmAlertObserver; |
|
32 class CHbSymbianVariantMap; |
|
33 class CHbSymbianVariant; |
33 |
34 |
34 // Class declaration |
35 // Class declaration |
35 /** |
36 /** |
36 * @class AlarmAlertWidget |
37 * @class AlarmAlertWidget |
37 * @brief This is the client side of the device dialog plugin. |
38 * @brief This is the client side of the device dialog plugin. |
38 * Contains API's to show, update and dismiss alarm dialogs |
39 * Contains API's to show, update and dismiss alarm dialogs |
39 */ |
40 */ |
40 class AlarmAlertWidget : public QObject |
41 class AlarmAlertWidget : public MHbDeviceDialogObserver |
41 { |
42 { |
42 Q_OBJECT |
|
43 |
|
44 public: |
43 public: |
45 |
44 |
46 /** |
45 /** |
47 * @brief Constructor |
46 * @brief Constructor |
48 * @param observer This is the observer of all user events |
47 * @param observer This is the observer of all user events |
49 */ |
48 */ |
50 AlarmAlertWidget(AlarmAlertObserver *observer); |
49 AlarmAlertWidget(AlarmAlertObserver *observer); |
51 |
50 |
52 /** |
51 /** |
53 * @brief Destructor |
52 * @brief Destructor |
54 */ |
53 */ |
55 ~AlarmAlertWidget(); |
54 ~AlarmAlertWidget(); |
56 |
55 |
57 /** |
56 /** |
58 * @brief Shows the alarm dialog |
57 * @brief Shows the alarm dialog |
59 * @param The alarm information to display |
58 * @param The alarm information to display |
60 * @return true on success, false otherwise |
59 * @return true on success, false otherwise |
61 */ |
60 */ |
62 bool showAlarmDialog(SAlarmInfo *alarmInfo); |
61 bool showAlarmDialog(SAlarmInfo *alarmInfo); |
63 |
62 |
64 /** |
63 /** |
65 * @brief Dismisses any alarm dialog that is being shown |
64 * @brief Dismisses any alarm dialog that is being shown |
66 * @return true on success, false otherwise |
65 * @return true on success, false otherwise |
67 */ |
66 */ |
68 bool dismissAlarmDialog(); |
67 void dismissAlarmDialog(); |
69 |
68 |
70 /** |
69 /** |
71 * @brief Updates the alarm dialog with new information |
70 * @brief Updates the alarm dialog with new information |
72 * @param The alarm information to update |
71 * @param The alarm information to update |
73 * @return true on success, false otherwise |
72 * @return true on success, false otherwise |
74 */ |
73 */ |
75 bool updateAlarmDialog(SAlarmInfo *alarmInfo); |
74 bool updateAlarmDialog(SAlarmInfo *alarmInfo); |
|
75 |
|
76 public: |
76 |
77 |
77 private slots: |
78 /** |
|
79 * @brief Inform the client about user interaction on dialog. |
|
80 * @param List of aruguemnts the dialog has sent. |
|
81 */ |
|
82 void DataReceived(CHbSymbianVariantMap& aData); |
|
83 |
|
84 /** |
|
85 * @brief Updates the alarm dialog with new information |
|
86 * @param The alarm information to update |
|
87 */ |
|
88 void DeviceDialogClosed(TInt aCompletionCode); |
|
89 |
|
90 private: |
|
91 /** |
|
92 * @brief Handle the events sent by dialog. |
|
93 * @param params List of arguments the dialog has sent |
|
94 */ |
|
95 void triggerAction(const CHbSymbianVariant* source); |
|
96 |
|
97 private: |
78 |
98 |
79 /** |
99 /** |
80 * @brief Slot to handle user interactions |
100 * @var mVariantMap |
81 * @param params List of arguments the dialog has sent |
101 * @brief Contain the parameters. |
82 */ |
102 */ |
83 void triggerAction(QVariantMap params); |
103 CHbSymbianVariantMap* mVariantMap; |
84 |
104 |
85 private: |
|
86 |
|
87 /** |
105 /** |
88 * @var mSubject |
106 * @var mSubject |
89 * @brief Holds the alarm subject |
107 * @brief Holds the alarm subject |
90 */ |
108 */ |
91 QString mSubject; |
109 CHbSymbianVariant* mAlarmSubject; |
92 |
110 |
93 /** |
111 /** |
94 * @var mLocation |
112 * @var mLocation |
95 * @brief Holds the alarm location (for calendar alerts only) |
113 * @brief Holds the alarm location (for calendar alerts only) |
96 */ |
114 */ |
97 QString mLocation; |
115 CHbSymbianVariant* mLocation; |
98 |
116 |
99 /** |
117 /** |
100 * @var mAlarmTime |
118 * @var mAlarmTime |
101 * @brief Holds the alarm expiry time |
119 * @brief Holds the alarm expiry time |
102 */ |
120 */ |
103 QDateTime mAlarmTime; |
121 CHbSymbianVariant* mAlarmTime; |
104 |
122 |
|
123 /** |
|
124 * @var mAlarmDate |
|
125 * @brief Holds the alarm expiry date |
|
126 */ |
|
127 CHbSymbianVariant* mAlarmDate; |
|
128 |
105 /** |
129 /** |
106 * @var mDeviceDialog |
130 * @var mDeviceDialog |
107 * @brief The interface to the device dialog server |
131 * @brief The interface to the device dialog server |
108 */ |
132 */ |
109 HbDeviceDialog *mDeviceDialog; |
133 CHbDeviceDialogSymbian *mDeviceDialog; |
110 |
134 |
111 /** |
135 /** |
112 * @var mAlarmAlertType |
136 * @var mAlarmAlertType |
113 * @brief Tells if the type of alert being displayed |
137 * @brief Tells if the type of alert being displayed |
114 * is a clock /calendar/to-do alert |
138 * is a clock /calendar/to-do alert |
115 */ |
139 */ |
116 int mAlarmAlertType; |
140 CHbSymbianVariant* mAlarmAlertType; |
117 |
141 |
118 /** |
142 /** |
119 * @var mCanSnooze |
143 * @var mCanSnooze |
120 * @brief Tells whether the current alert can be snoozed. |
144 * @brief Tells whether the current alert can be snoozed. |
121 * true->alarm can be snoozed |
145 * true->alarm can be snoozed |
122 * false->alarm cannot be snoozed |
146 * false->alarm cannot be snoozed |
123 */ |
147 */ |
124 bool mCanSnooze; |
148 CHbSymbianVariant* mCanSnooze; |
125 |
149 |
126 /** |
150 /** |
127 * @var mIsSilent |
151 * @var mIsSilent |
128 * @brief Indicates if the alarm is silent or not |
152 * @brief Indicates if the alarm is silent or not |
129 */ |
153 */ |
130 bool mIsSilent; |
154 CHbSymbianVariant* mIsSilent; |
131 |
155 |
132 /** |
156 /** |
133 * @var mIsTimedAlarm |
157 * @var mIsTimedAlarm |
134 * @brief Indicates if the alarm has time info or not |
158 * @brief Indicates if the alarm has time info or not |
135 */ |
159 */ |
136 bool mIsTimedAlarm; |
160 CHbSymbianVariant* mIsTimedAlarm; |
137 |
161 |
138 /** |
162 /** |
139 * @var mObserver |
163 * @var mObserver |
140 * @brief The observer for user responses |
164 * @brief The observer for user responses |
141 */ |
165 */ |
142 AlarmAlertObserver *mObserver; |
166 AlarmAlertObserver *mObserver; |