author | hgs |
Mon, 06 Sep 2010 10:12:45 +0530 | |
changeset 70 | a5ed90760192 |
parent 55 | 2c54b51f39c4 |
child 81 | ce92091cbd61 |
permissions | -rw-r--r-- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
45 | 14 |
* Description: |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
// alarmalertwidget.cpp |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
// System includes |
45 | 20 |
#include <hbsymbianvariant.h> |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
// User includes |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "alarmalertwidget.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "alarmalert.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include "alarmalertobserver.h" |
55 | 26 |
#include "OstTraceDefinitions.h" |
27 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
28 |
#include "alarmalertwidgetTraces.h" |
|
29 |
#endif |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
45 | 31 |
// Constants. |
32 |
const TInt KMaxlength=30; |
|
33 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
// AlarmAlertWidget::AlarmAlertWidget |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
// rest of the details are commented in the header |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
AlarmAlertWidget::AlarmAlertWidget(AlarmAlertObserver *observer) : |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
mObserver(observer) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
{ |
55 | 42 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_ALARMALERTWIDGET_ENTRY ); |
43 |
OstTraceFunctionExit0( ALARMALERTWIDGET_ALARMALERTWIDGET_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// AlarmAlertWidget::~AlarmAlertWidget |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// rest of the details are commented in the header |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
AlarmAlertWidget::~AlarmAlertWidget() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
{ |
55 | 53 |
OstTraceFunctionEntry0( DUP1_ALARMALERTWIDGET_ALARMALERTWIDGET_ENTRY ); |
45 | 54 |
// Cleanup |
55 |
||
56 |
if (mAlarmSubject) { |
|
57 |
delete mAlarmSubject; |
|
58 |
} |
|
59 |
||
60 |
if (mLocation) { |
|
61 |
delete mLocation; |
|
62 |
} |
|
63 |
||
64 |
if (mAlarmTime) { |
|
65 |
delete mAlarmTime; |
|
66 |
} |
|
67 |
||
68 |
if (mAlarmDate) { |
|
69 |
delete mAlarmDate; |
|
70 |
} |
|
71 |
||
72 |
if (mAlarmAlertType) { |
|
73 |
delete mAlarmAlertType; |
|
74 |
} |
|
75 |
||
76 |
if (mCanSnooze) { |
|
77 |
delete mCanSnooze; |
|
78 |
} |
|
79 |
||
80 |
if (mIsSilent) { |
|
81 |
delete mIsSilent; |
|
82 |
} |
|
83 |
||
84 |
if (mIsTimedAlarm) { |
|
85 |
delete mIsTimedAlarm; |
|
86 |
} |
|
87 |
||
88 |
if (mVariantMap) { |
|
89 |
delete mVariantMap; |
|
90 |
} |
|
91 |
||
92 |
if (mDeviceDialog) { |
|
93 |
delete mDeviceDialog; |
|
94 |
} |
|
55 | 95 |
OstTraceFunctionExit0( DUP1_ALARMALERTWIDGET_ALARMALERTWIDGET_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
// AlarmAlertWidget::ShowAlarmDialog |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
// rest of the details are commented in the header |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
bool AlarmAlertWidget::showAlarmDialog(SAlarmInfo *alarmInfo) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
{ |
55 | 105 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_SHOWALARMDIALOG_ENTRY ); |
45 | 106 |
// Get the alarm date and time |
107 |
TBuf<KMaxlength> timeString; |
|
108 |
TBuf<KMaxlength> dateString; |
|
109 |
||
110 |
TBuf<KMaxlength> timeFormat(_L("%-B%:0%J%:1%T%:3%+B")); |
|
111 |
TBuf<KMaxlength> dateFormat; |
|
112 |
TLocale locale; |
|
113 |
switch (locale.DateFormat()) { |
|
114 |
case EDateEuropean: |
|
115 |
dateFormat.Copy(_L("%F%/0%D%/1%M%/2%Y%/3")); |
|
116 |
break; |
|
117 |
case EDateAmerican: |
|
118 |
dateFormat.Copy(_L("%F%/0%M%/1%D%/2%Y%/3")); |
|
119 |
break; |
|
120 |
case EDateJapanese: |
|
121 |
dateFormat.Copy(_L("%F%/0%Y%/1%M%/2%D%/3")); |
|
122 |
break; |
|
123 |
default: |
|
124 |
// Nothing yet. |
|
125 |
break; |
|
126 |
} |
|
127 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
|
45 | 129 |
alarmInfo->iTime.FormatL(timeString, timeFormat); |
70 | 130 |
alarmInfo->iDate.FormatL(dateString, dateFormat); |
45 | 131 |
|
132 |
// Create a session with the device dialog server |
|
133 |
mDeviceDialog = CHbDeviceDialogSymbian::NewL(); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
|
45 | 135 |
|
136 |
// Package the different parameters to send |
|
137 |
mVariantMap = CHbSymbianVariantMap::NewL(); |
|
138 |
||
139 |
// Get the subject of the alarm (description for clock alarms |
|
140 |
// and subject for calendar alarms) |
|
141 |
mAlarmSubject = CHbSymbianVariant::NewL( |
|
142 |
alarmInfo->iSubject, CHbSymbianVariant::EDes ); |
|
143 |
mVariantMap->Add(alarmSubjectSymbian, mAlarmSubject); |
|
144 |
||
145 |
// Get the location (for calendar alarms) |
|
146 |
mLocation = CHbSymbianVariant::NewL( |
|
147 |
alarmInfo->iLocation, CHbSymbianVariant::EDes); |
|
148 |
mVariantMap->Add(alarmLocationSymbian, mLocation); |
|
149 |
||
150 |
mAlarmTime = CHbSymbianVariant::NewL( |
|
151 |
&timeString, CHbSymbianVariant::EDes); |
|
152 |
mVariantMap->Add(alarmTimeSymbian, mAlarmTime); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
|
45 | 154 |
mAlarmDate = CHbSymbianVariant::NewL( |
155 |
&dateString, CHbSymbianVariant::EDes); |
|
156 |
mVariantMap->Add(alarmDateSymbian, mAlarmDate); |
|
157 |
||
158 |
mIsSilent = CHbSymbianVariant::NewL( |
|
159 |
&alarmInfo->iIsSilent, CHbSymbianVariant::EBool); |
|
160 |
mVariantMap->Add(alarmRingingTypeSymbian, mIsSilent); |
|
161 |
||
162 |
mCanSnooze = CHbSymbianVariant::NewL( |
|
163 |
&alarmInfo->iCanSnooze, CHbSymbianVariant::EBool); |
|
164 |
mVariantMap->Add(alarmCanSnoozeSymbain, mCanSnooze); |
|
165 |
||
166 |
mAlarmAlertType = CHbSymbianVariant::NewL( |
|
167 |
&alarmInfo->iAlarmAlertType, CHbSymbianVariant::EInt); |
|
168 |
mVariantMap->Add(alarmTypeSymbian, mAlarmAlertType); |
|
169 |
||
170 |
mIsTimedAlarm = CHbSymbianVariant::NewL( |
|
171 |
&alarmInfo->iIsTimed, CHbSymbianVariant::EBool); |
|
172 |
mVariantMap->Add(alarmIsTimedSymbian, mIsTimedAlarm); |
|
173 |
||
174 |
// Package the different parameters to send |
|
175 |
return mDeviceDialog->Show(ALARM_ALERT_PLUGIN_SYMBIAN, *mVariantMap, this); |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
176 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
// AlarmAlertWidget::DismissAlarmDialog |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
// rest of the details are commented in the header |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
// |
45 | 184 |
void AlarmAlertWidget::dismissAlarmDialog() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
{ |
55 | 186 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_DISMISSALARMDIALOG_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
// Dismiss the dialog |
45 | 188 |
mDeviceDialog->Cancel(); |
55 | 189 |
OstTraceFunctionExit0( ALARMALERTWIDGET_DISMISSALARMDIALOG_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
// AlarmAlertWidget::UpdateAlarmDialog |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
// rest of the details are commented in the header |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
// |
45 | 197 |
bool AlarmAlertWidget::updateAlarmDialog(SAlarmInfo* /*alarmInfo*/) |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
{ |
55 | 199 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_UPDATEALARMDIALOG_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
// Update the dialog with any new information |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
// TODO: Pass the updated information sent by the observer |
45 | 202 |
/*CHbSymbianVariantMap params; |
203 |
mDeviceDialog->Update(params);*/ |
|
55 | 204 |
OstTraceFunctionExit0( ALARMALERTWIDGET_UPDATEALARMDIALOG_EXIT ); |
45 | 205 |
return false; |
206 |
} |
|
207 |
||
208 |
// --------------------------------------------------------- |
|
209 |
// AlarmAlertWidget::DataReceived |
|
210 |
// rest of the details are commented in the header |
|
211 |
// --------------------------------------------------------- |
|
212 |
// |
|
213 |
void AlarmAlertWidget::DataReceived(CHbSymbianVariantMap& aData) |
|
214 |
{ |
|
55 | 215 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_DATARECEIVED_ENTRY ); |
45 | 216 |
if (!aData.Keys().MdcaCount()) { |
55 | 217 |
OstTraceFunctionExit0( ALARMALERTWIDGET_DATARECEIVED_EXIT ); |
45 | 218 |
return; |
219 |
} |
|
220 |
||
221 |
triggerAction(aData.Get(alarmCommandSymbian)); |
|
55 | 222 |
OstTraceFunctionExit0( DUP1_ALARMALERTWIDGET_DATARECEIVED_EXIT ); |
45 | 223 |
} |
224 |
||
225 |
// --------------------------------------------------------- |
|
226 |
// AlarmAlertWidget::DeviceDialogClosed |
|
227 |
// rest of the details are commented in the header |
|
228 |
// --------------------------------------------------------- |
|
229 |
// |
|
230 |
void AlarmAlertWidget::DeviceDialogClosed(TInt /*aCompletionCode*/) |
|
231 |
{ |
|
55 | 232 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_DEVICEDIALOGCLOSED_ENTRY ); |
45 | 233 |
|
55 | 234 |
OstTraceFunctionExit0( ALARMALERTWIDGET_DEVICEDIALOGCLOSED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
// AlarmAlertWidget::triggerAction |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
// rest of the details are commented in the header |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
// --------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
// |
45 | 242 |
void AlarmAlertWidget::triggerAction(const CHbSymbianVariant* source) |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
{ |
55 | 244 |
OstTraceFunctionEntry0( ALARMALERTWIDGET_TRIGGERACTION_ENTRY ); |
45 | 245 |
AlarmCommand command(AlarmCmdLast); |
246 |
||
247 |
if (*source->Value<TInt>() == Stop) { |
|
248 |
command = AlarmStop; |
|
249 |
} else if (*source->Value<TInt>() == Snooze) { |
|
250 |
command = AlarmSnooze; |
|
251 |
} else if (*source->Value<TInt>() == Silence) { |
|
252 |
command = AlarmSilence; |
|
253 |
} else if (*source->Value<TInt>() == Shown) { |
|
254 |
command = AlarmShown; |
|
255 |
mObserver->alertDisplayed(command); |
|
55 | 256 |
OstTraceFunctionExit0( ALARMALERTWIDGET_TRIGGERACTION_EXIT ); |
45 | 257 |
return; |
258 |
} else { |
|
259 |
command = AlarmCmdLast; |
|
260 |
} |
|
261 |
||
262 |
if (command != AlarmCmdLast) { |
|
263 |
// Notify the observer with the command |
|
264 |
mObserver->alertCompleted(command); |
|
265 |
} |
|
55 | 266 |
OstTraceFunctionExit0( DUP1_ALARMALERTWIDGET_TRIGGERACTION_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
} |
45 | 268 |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
269 |
// End of file --Don't remove this. |