author | Simon Howkins <simonh@symbian.org> |
Thu, 25 Nov 2010 12:13:04 +0000 | |
branch | RCL_3 |
changeset 83 | 31a5fbf5db1d |
parent 80 | 726fba06891a |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 2009 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: ESMR policy implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include "cesmrviewerdialog.h" |
|
19 |
#include "cesmrpolicy.h" |
|
20 |
#include "esmrdef.h" |
|
21 |
#include "cesmrpolicymanager.h" |
|
22 |
#include "cesmrurlparserplugin.h" |
|
23 |
#include "esmricalvieweropcodes.hrh" |
|
24 |
#include "tesmrinputparams.h" |
|
25 |
#include "cesmrview.h" |
|
26 |
#include "esmrgui.hrh" |
|
27 |
#include "cesmrfield.h" |
|
28 |
#include "cesmrviewerfieldstorage.h" |
|
29 |
#include "esmrentryhelper.h" |
|
30 |
#include "mesmrmeetingrequestentry.h" |
|
31 |
#include "esmrinternaluid.h" |
|
32 |
#include "cesmrlistquery.h" |
|
33 |
#include "cesmrconfirmationquery.h" |
|
34 |
#include "cesmrsendui.h" |
|
35 |
#include "cesmrcontactmenuhandler.h" |
|
36 |
#include "cesmrfieldbuilderinterface.h" |
|
37 |
#include "cesmrtrackingviewdialog.h" |
|
38 |
#include "mesmruibase.h" |
|
39 |
#include "cesmruifactory.h" |
|
40 |
#include "cesmrlocationpluginhandler.h" |
|
41 |
#include "cesmrfeaturesettings.h" |
|
42 |
#include "esmrconfig.hrh" |
|
43 |
#include "mesmrfieldevent.h" |
|
44 |
#include "cmrtoolbar.h" |
|
45 |
#include "cesmrlistquery.h" |
|
46 |
#include "mmrinfoprovider.h" |
|
47 |
#include "cmrfocusstrategyviewer.h" |
|
48 |
#include "cesmrtitlepanehandler.h" |
|
49 |
||
50 |
#include <data_caging_path_literals.hrh> |
|
51 |
#include <esmrgui.rsg> |
|
52 |
#include <esmrpolicies.rsg> |
|
53 |
#include <aknnotewrappers.h> |
|
54 |
#include <eikenv.h> |
|
55 |
#include <eikappui.h> |
|
56 |
#include <avkon.hrh> |
|
57 |
#include <MAgnEntryUi.h> |
|
58 |
#include <eikmenup.h> |
|
59 |
#include <calentry.h> |
|
60 |
#include <apgtask.h> |
|
61 |
#include <apmstd.h> |
|
62 |
#include <apgcli.h> |
|
63 |
#include <AknDef.h> |
|
64 |
#include <AknUtils.h> |
|
65 |
#include <StringLoader.h> |
|
66 |
#include <eikspane.h> |
|
67 |
#include <e32keys.h> |
|
68 |
#include <CalenInterimUtils2.h> |
|
69 |
#include <w32std.h> |
|
70 |
||
71 |
// DEBUG |
|
72 |
#include "emailtrace.h" |
|
73 |
#include "cesmrcaldbmgr.h" |
|
74 |
||
75 |
/// Unnamed namespace for local definitions |
|
76 |
namespace { // codescanner::namespace |
|
77 |
||
78 |
#ifdef _DEBUG |
|
79 |
||
80 |
enum TESMRViewerDlgPanic |
|
81 |
{ |
|
82 |
EESMRViewerDlgInvalidCommand, |
|
83 |
EESMRViewerDlgnvalidSeriesResult, |
|
84 |
EESMRViewerDlgInvalidEntry |
|
85 |
}; |
|
86 |
||
87 |
void Panic( TESMRViewerDlgPanic aPanic ) |
|
88 |
{ |
|
89 |
// Literal for viewer dialog |
|
90 |
_LIT( KESMRViewerDlgPanicTxt, "ESMRViewerDlg" ); |
|
91 |
User::Panic( KESMRViewerDlgPanicTxt, aPanic ); |
|
92 |
} |
|
93 |
||
94 |
#endif |
|
95 |
||
96 |
// Definition for default buffer length |
|
97 |
const TInt KCalDefaultBufferLen = 40; |
|
98 |
||
99 |
// VGA resolution screen size in pixels |
|
100 |
const TInt KVGAOneSide( 640 ); |
|
101 |
const TInt KVGAOtherSide( 480 ); |
|
102 |
||
103 |
// Calendar command parameter |
|
104 |
_LIT16( KCalCmdDATE, "GRAPHICDAY" ); |
|
105 |
||
106 |
// Definition for time format ("YYYY MM DD HH MM SS MMMMMM" - 26) |
|
107 |
_LIT( KCalCmdTimeFormat, "%F %Y %M %D %H %T %S %C" ); |
|
108 |
||
109 |
// Definition for calendar application UID |
|
110 |
const TUid KCalendarAppUID = { KUidCalendarApplication }; |
|
111 |
||
112 |
||
113 |
/** |
|
114 |
* Sets recurrence modification rule to entry. Rule is queried |
|
115 |
* from the user. Invalid result will cause panic. |
|
116 |
* @param aEntry Reference to meeting request. |
|
117 |
*/ |
|
118 |
void SetRecurrenceModRuleL( |
|
119 |
MESMRCalEntry& aEntry, |
|
120 |
CESMRListQuery::TESMRListQueryType aQueryType ) |
|
121 |
{ |
|
122 |
FUNC_LOG; |
|
123 |
if ( aEntry.IsRecurrentEventL() && |
|
124 |
aEntry.IsStoredL() ) |
|
125 |
{ |
|
126 |
TInt result = |
|
127 |
CESMRListQuery::ExecuteL( aQueryType ); |
|
128 |
||
129 |
if( KErrCancel == result ) |
|
130 |
{ |
|
131 |
// User has cancelled selecting opening the instance |
|
132 |
User::Leave( KErrCancel ); |
|
133 |
} |
|
134 |
||
135 |
TESMRThisOccurenceOrSeriesQuery recurrenceModRule = |
|
136 |
static_cast<TESMRThisOccurenceOrSeriesQuery>( result ); |
|
137 |
||
138 |
switch( recurrenceModRule ) |
|
139 |
{ |
|
140 |
case EESMRThisOccurence: |
|
141 |
{ |
|
142 |
aEntry.SetModifyingRuleL( |
|
143 |
MESMRMeetingRequestEntry::EESMRThisOnly ); |
|
144 |
break; |
|
145 |
} |
|
146 |
case EESMRSeries: |
|
147 |
{ |
|
148 |
aEntry.SetModifyingRuleL( |
|
149 |
MESMRMeetingRequestEntry::EESMRAllInSeries ); |
|
150 |
break; |
|
151 |
} |
|
152 |
default: |
|
153 |
{ |
|
154 |
__ASSERT_DEBUG( EFalse, |
|
155 |
Panic(EESMRViewerDlgnvalidSeriesResult) ); |
|
156 |
break; |
|
157 |
} |
|
158 |
} |
|
159 |
} |
|
160 |
else |
|
161 |
{ |
|
162 |
aEntry.SetModifyingRuleL( |
|
163 |
MESMRMeetingRequestEntry::EESMRThisOnly ); |
|
164 |
} |
|
165 |
} |
|
166 |
} |
|
167 |
||
168 |
// ======== MEMBER FUNCTIONS ======== |
|
169 |
||
170 |
// --------------------------------------------------------------------------- |
|
171 |
// CESMRViewerDialog::CESMRViewerDialog |
|
172 |
// --------------------------------------------------------------------------- |
|
173 |
// |
|
174 |
CESMRViewerDialog::CESMRViewerDialog( |
|
175 |
MMRInfoProvider& aInfoProvider, |
|
176 |
MAgnEntryUiCallback& aCallback ) : |
|
177 |
iCallback( aCallback ), |
|
178 |
iInfoProvider( aInfoProvider ) |
|
179 |
{ |
|
180 |
FUNC_LOG; |
|
181 |
// Do nothing |
|
182 |
} |
|
183 |
||
184 |
// --------------------------------------------------------------------------- |
|
185 |
// CESMRViewerDialog::~CESMRViewerDialog |
|
186 |
// --------------------------------------------------------------------------- |
|
187 |
// |
|
188 |
CESMRViewerDialog::~CESMRViewerDialog() |
|
189 |
{ |
|
190 |
FUNC_LOG; |
|
191 |
iESMRStatic.Close(); |
|
192 |
||
193 |
if ( iTitlePane ) |
|
194 |
{ |
|
195 |
// Returns the previous title back to titlepane |
|
196 |
iTitlePane->Rollback(); |
|
197 |
delete iTitlePane; |
|
198 |
} |
|
199 |
||
200 |
delete iESMRSendUI; |
|
201 |
delete iLocationPluginHandler; |
|
202 |
delete iFeatures; |
|
203 |
||
204 |
// iView is deleted by framework because it uses the |
|
205 |
// custom control mechanism. |
|
206 |
delete iToolbar; |
|
207 |
delete iFocusStrategy; |
|
208 |
} |
|
209 |
||
210 |
// --------------------------------------------------------------------------- |
|
211 |
// CESMRViewerDialog::NewL |
|
212 |
// --------------------------------------------------------------------------- |
|
213 |
// |
|
214 |
EXPORT_C CESMRViewerDialog* CESMRViewerDialog::NewL( |
|
215 |
MMRInfoProvider& aInfoProvider, |
|
216 |
MAgnEntryUiCallback& aCallback ) |
|
217 |
{ |
|
218 |
FUNC_LOG; |
|
219 |
CESMRViewerDialog* self = |
|
220 |
new (ELeave) CESMRViewerDialog( aInfoProvider, aCallback ); |
|
221 |
CleanupStack::PushL( self ); |
|
222 |
self->ConstructL(); |
|
223 |
CleanupStack::Pop( self ); |
|
224 |
return self; |
|
225 |
} |
|
226 |
||
227 |
// --------------------------------------------------------------------------- |
|
228 |
// CESMRViewerDialog::ConstructL |
|
229 |
// --------------------------------------------------------------------------- |
|
230 |
// |
|
231 |
void CESMRViewerDialog::ConstructL() |
|
232 |
{ |
|
233 |
FUNC_LOG; |
|
234 |
iESMRStatic.ConnectL(); |
|
235 |
||
236 |
CAknDialog::ConstructL( R_MRVIEWER_MENUBAR ); |
|
237 |
||
238 |
// Class disables avkon toolbar by default, which |
|
239 |
// we want in case of non-MR |
|
240 |
iToolbar = CMRToolbar::NewL(); |
|
241 |
||
242 |
TBool responseReady(EFalse); |
|
243 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
244 |
MESMRMeetingRequestEntry* mrEntry = NULL; |
|
245 |
if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) |
|
246 |
{ |
|
247 |
// This is meeting request |
|
248 |
mrEntry = static_cast<MESMRMeetingRequestEntry*>( calEntry ); |
|
249 |
responseReady = mrEntry->IsSentL(); |
|
250 |
||
251 |
// Change the status pane layout to remove navi pane |
|
252 |
CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane(); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
253 |
// If open the MR viewer from Cmail side, the status pane |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
254 |
// is not visible, we need to show it in viewer dialog |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
255 |
if ( sp && !sp->IsVisible() ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
256 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
257 |
sp->MakeVisible( ETrue ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
258 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
259 |
// Change the type of statuspane to usual_flat. |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
260 |
if ( sp ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
261 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
262 |
sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
263 |
} |
64 | 264 |
} |
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
265 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
266 |
TRect clientRect; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
267 |
AknLayoutUtils::LayoutMetricsRect( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
268 |
AknLayoutUtils::EMainPane, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
269 |
clientRect ); |
64 | 270 |
|
271 |
iESMRSendUI = CESMRSendUI::NewL(EESMRCmdSendAs); |
|
272 |
||
273 |
CESMRViewerFieldStorage* storage = |
|
274 |
CESMRViewerFieldStorage::NewL( |
|
275 |
iInfoProvider.PolicyProvider().CurrentPolicy(), |
|
276 |
this, |
|
277 |
responseReady, |
|
278 |
*this ); |
|
279 |
||
280 |
// Create focus strategy |
|
281 |
iFocusStrategy = CMRFocusStrategyViewer::NewL( *storage ); |
|
282 |
// Give the strategy to the iView |
|
283 |
||
284 |
// storage ownership is transferred to CESMRView |
|
285 |
iView = CESMRView::NewL( |
|
286 |
storage, |
|
287 |
*calEntry, |
|
288 |
clientRect, |
|
289 |
*iFocusStrategy, |
|
290 |
*iToolbar, |
|
291 |
this ); |
|
292 |
||
293 |
iView->SetViewMode( EESMRViewMR ); |
|
294 |
||
295 |
if ( calEntry->Entry().SummaryL().Length() == 0 ) |
|
296 |
{ |
|
297 |
// if no title, set unnamed text: |
|
298 |
HBufC* title = StringLoader::LoadLC ( R_QTN_MEET_REQ_CONFLICT_UNNAMED, |
|
299 |
iCoeEnv ); |
|
300 |
iView->SetTitleL( *title ); |
|
301 |
CleanupStack::PopAndDestroy( title ); |
|
302 |
} |
|
303 |
else |
|
304 |
{ |
|
305 |
iView->SetTitleL( calEntry->Entry().SummaryL() ); |
|
306 |
} |
|
307 |
||
308 |
TInt titleStringId = -1; |
|
309 |
switch ( calEntry->Type() ) |
|
310 |
{ |
|
311 |
case MESMRCalEntry::EESMRCalEntryMeetingRequest: |
|
312 |
{ |
|
313 |
titleStringId = R_QTN_MEET_REQ_TITLE_MEETING; |
|
314 |
break; |
|
315 |
} |
|
316 |
case MESMRCalEntry::EESMRCalEntryMeeting: |
|
317 |
{ |
|
318 |
titleStringId = R_QTN_CALENDAR_TITLE_MEETING; |
|
319 |
break; |
|
320 |
} |
|
321 |
case MESMRCalEntry::EESMRCalEntryTodo: |
|
322 |
{ |
|
323 |
titleStringId = R_QTN_CALENDAR_TITLE_TODO; |
|
324 |
break; |
|
325 |
} |
|
326 |
case MESMRCalEntry::EESMRCalEntryMemo: |
|
327 |
{ |
|
328 |
titleStringId = R_QTN_CALENDAR_TITLE_MEMO; |
|
329 |
break; |
|
330 |
} |
|
331 |
case MESMRCalEntry::EESMRCalEntryAnniversary: |
|
332 |
{ |
|
333 |
titleStringId = R_QTN_CALENDAR_TITLE_ANNIVERSARY; |
|
334 |
break; |
|
335 |
} |
|
336 |
case MESMRCalEntry::EESMRCalEntryReminder: // Fall through |
|
337 |
default: |
|
338 |
{ |
|
339 |
break; |
|
340 |
} |
|
341 |
} |
|
342 |
if ( titleStringId != -1 ) |
|
343 |
{ |
|
344 |
if( !iTitlePane ) |
|
345 |
{ |
|
346 |
iTitlePane = CESMRTitlePaneHandler::NewL( *iEikonEnv ); |
|
347 |
} |
|
348 |
||
349 |
HBufC* titleText = StringLoader::LoadLC( titleStringId, iCoeEnv ); |
|
350 |
iTitlePane->SetNewTitle( titleText ); |
|
351 |
CleanupStack::PopAndDestroy( titleText ); |
|
352 |
} |
|
353 |
||
354 |
iFeatures = CESMRFeatureSettings::NewL(); |
|
355 |
} |
|
356 |
||
357 |
// --------------------------------------------------------------------------- |
|
358 |
// CESMRViewerDialog::ActivateL |
|
359 |
// --------------------------------------------------------------------------- |
|
360 |
// |
|
361 |
void CESMRViewerDialog::ActivateL() |
|
362 |
{ |
|
363 |
FUNC_LOG; |
|
364 |
iView->InternalizeL(); |
|
365 |
CAknDialog::ActivateL(); |
|
366 |
||
367 |
// Needs to be constructed here |
|
368 |
ConstructToolbarL(); |
|
369 |
||
370 |
switch ( iInfoProvider.EntryL()->Type() ) |
|
371 |
{ |
|
372 |
case MESMRCalEntry::EESMRCalEntryMeetingRequest: |
|
373 |
{ |
|
374 |
iView->InitialScrollL(); |
|
375 |
||
376 |
MESMRMeetingRequestEntry* entry = |
|
377 |
static_cast<MESMRMeetingRequestEntry*>( |
|
378 |
iInfoProvider.EntryL() ); |
|
379 |
||
380 |
if ( entry->IsOpenedFromMail() ) |
|
381 |
{ |
|
382 |
iView->SetNaviArrowStatus( |
|
383 |
iCallback.IsCommandAvailable( |
|
384 |
EESMRCmdMailPreviousMessage ), |
|
385 |
iCallback.IsCommandAvailable( |
|
386 |
EESMRCmdMailNextMessage ) ); |
|
387 |
} |
|
388 |
||
389 |
} |
|
390 |
||
391 |
case MESMRCalEntry::EESMRCalEntryMeeting: |
|
392 |
case MESMRCalEntry::EESMRCalEntryMemo: |
|
393 |
case MESMRCalEntry::EESMRCalEntryAnniversary: |
|
394 |
case MESMRCalEntry::EESMRCalEntryTodo: |
|
395 |
case MESMRCalEntry::EESMRCalEntryReminder: // Fall through |
|
396 |
default: |
|
397 |
break; |
|
398 |
} |
|
399 |
} |
|
400 |
||
401 |
// --------------------------------------------------------------------------- |
|
402 |
// CESMRViewerDialog::PreLayoutDynInitL |
|
403 |
// --------------------------------------------------------------------------- |
|
404 |
// |
|
405 |
void CESMRViewerDialog::PreLayoutDynInitL() |
|
406 |
{ |
|
407 |
FUNC_LOG; |
|
408 |
SetDefaultMiddleSoftKeyL(); |
|
409 |
ButtonGroupContainer().MakeCommandVisibleByPosition( |
|
410 |
CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
411 |
ETrue ); |
|
412 |
} |
|
413 |
||
414 |
// --------------------------------------------------------------------------- |
|
415 |
// CESMRViewerDialog::OfferKeyEventL |
|
416 |
// --------------------------------------------------------------------------- |
|
417 |
// |
|
418 |
TKeyResponse CESMRViewerDialog::OfferKeyEventL( |
|
419 |
const TKeyEvent& aEvent, |
|
420 |
TEventCode aType) |
|
421 |
{ |
|
422 |
FUNC_LOG; |
|
423 |
TKeyResponse response( EKeyWasNotConsumed ); |
|
424 |
if ( aEvent.iCode != EKeyEscape && !MenuShowing() ) |
|
425 |
{ |
|
426 |
response = iView->OfferKeyEventL( aEvent, aType ); |
|
427 |
} |
|
428 |
||
429 |
if ( response == EKeyWasNotConsumed ) |
|
430 |
{ |
|
431 |
switch (aEvent.iScanCode) |
|
432 |
{ |
|
433 |
case '4': |
|
434 |
{ |
|
435 |
response = EKeyWasConsumed; |
|
436 |
ProcessCommandL(EESMRCmdMailPreviousMessage); |
|
437 |
break; |
|
438 |
} |
|
439 |
case '6': |
|
440 |
{ |
|
441 |
response = EKeyWasConsumed; |
|
442 |
ProcessCommandL(EESMRCmdMailNextMessage); |
|
443 |
break; |
|
444 |
} |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
445 |
case EStdKeyDelete: |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
446 |
case EStdKeyBackspace: |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
447 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
448 |
if( CCalenInterimUtils2::IsMeetingRequestL( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
449 |
iInfoProvider.EntryL()->Entry() ) ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
450 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
451 |
response = EKeyWasConsumed; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
452 |
ProcessCommandL( EESMRCmdDeleteMR ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
453 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
454 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
455 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
456 |
response = EKeyWasConsumed; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
457 |
ProcessCommandL( EESMRCmdCalEntryUIDelete ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
458 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
459 |
break; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
460 |
} |
64 | 461 |
default: |
462 |
{ |
|
463 |
response = CAknDialog::OfferKeyEventL( aEvent, aType ); |
|
464 |
break; |
|
465 |
} |
|
466 |
} |
|
467 |
} |
|
468 |
||
469 |
return response; |
|
470 |
} |
|
471 |
||
472 |
// --------------------------------------------------------------------------- |
|
473 |
// CESMRViewerDialog::ProcessCommandL |
|
474 |
// --------------------------------------------------------------------------- |
|
475 |
// |
|
476 |
void CESMRViewerDialog::ProcessCommandL( TInt aCommand ) |
|
477 |
{ |
|
478 |
FUNC_LOG; |
|
479 |
||
480 |
TRAPD( err, DoProcessCommandL( aCommand ) ); |
|
481 |
if ( err != KErrNone && |
|
482 |
err != KErrCancel && |
|
483 |
err != KErrArgument ) |
|
484 |
{ |
|
485 |
User::Leave(err); |
|
486 |
} |
|
487 |
} |
|
488 |
||
489 |
// --------------------------------------------------------------------------- |
|
490 |
// CESMRViewerDialog::DoProcessCommandL |
|
491 |
// --------------------------------------------------------------------------- |
|
492 |
// |
|
493 |
void CESMRViewerDialog::DoProcessCommandL( TInt aCommand ) |
|
494 |
{ |
|
495 |
FUNC_LOG; |
|
496 |
CAknDialog::ProcessCommandL( aCommand ); |
|
497 |
switch ( aCommand ) |
|
498 |
{ |
|
499 |
case EESMRCmdSendAs: |
|
500 |
{ |
|
501 |
SendCalendarEntryL(aCommand); |
|
502 |
break; |
|
503 |
} |
|
504 |
||
505 |
case EESMRCmdSendMR: //Fall through |
|
506 |
case EESMRCmdSendMRUpdate: |
|
507 |
{ |
|
508 |
TInt ret( KErrGeneral ); |
|
509 |
ret = iCallback.ProcessCommandWithResultL ( aCommand ); |
|
510 |
||
511 |
if ( ret == KErrNone ) |
|
512 |
{ |
|
513 |
TryExitL ( EAknSoftkeyClose ); |
|
514 |
} |
|
515 |
break; |
|
516 |
} |
|
517 |
// pass-through all calentryui related command to call back |
|
518 |
case EESMRCmdCalEntryUISend: // Fall through |
|
519 |
case EESMRCmdCalEntryUIAddParticipants: // Fall through |
|
520 |
case EESMRCmdCalEntryUISave: // Fall through |
|
521 |
{ |
|
522 |
User::LeaveIfError( |
|
523 |
iCallback.ProcessCommandWithResultL( aCommand )); |
|
524 |
break; |
|
525 |
} |
|
526 |
||
527 |
// EEikBidCancel is called when Red End key is pressed or |
|
528 |
// application is killed via Swap Window |
|
529 |
case EEikBidCancel: // Fall through |
|
530 |
case EAknSoftkeyClose: // Fall through |
|
531 |
case EAknCmdExit: |
|
532 |
{ |
|
533 |
TryExitL( aCommand ); |
|
534 |
break; |
|
535 |
} |
|
536 |
case EAknSoftkeySelect: // Fall through |
|
537 |
{ |
|
538 |
iView->ProcessEditorCommandL( aCommand ); |
|
539 |
break; |
|
540 |
} |
|
541 |
case EESMRCmdEdit: // Fall through |
|
542 |
case EESMRCmdEditLocal: // Fall through |
|
543 |
case EESMRCmdDeleteMR: // Fall through |
|
544 |
case EESMRCmdCalEntryUIEdit: // Fall through |
|
545 |
case EESMRCmdCalEntryUIDelete: |
|
546 |
{ |
|
547 |
TBool closeDialog = HandleCommandForEventL( aCommand ); |
|
548 |
if ( closeDialog ) |
|
549 |
{ |
|
550 |
TryExitL( EAknSoftkeyClose ); |
|
551 |
} |
|
552 |
break; |
|
553 |
} |
|
554 |
||
555 |
case EESMRCmdReply: // Fall through |
|
556 |
case EESMRCmdReplyAll: |
|
557 |
{ |
|
558 |
User::LeaveIfError( |
|
559 |
iCallback.ProcessCommandWithResultL( aCommand )); |
|
560 |
break; |
|
561 |
} |
|
562 |
||
563 |
case EAknCmdHelp: |
|
564 |
{ |
|
565 |
iView->LaunchViewerHelpL(); |
|
566 |
break; |
|
567 |
} |
|
568 |
case EESMRCmdViewTrack: |
|
569 |
{ |
|
570 |
User::LeaveIfError( |
|
571 |
iCallback.ProcessCommandWithResultL( aCommand )); |
|
572 |
TryExitL( EAknSoftkeyClose ); |
|
573 |
break; |
|
574 |
} |
|
575 |
case EESMRCmdAcceptMR: // Fall through |
|
576 |
case EESMRCmdTentativeMR: // Fall through |
|
577 |
case EESMRCmdDeclineMR: // Fall through |
|
578 |
{ |
|
579 |
if ( !UserWantToHandleAttachmentsL() ) |
|
580 |
{ |
|
581 |
iView->ExternalizeL(); // no forced validation |
|
582 |
TInt res = iCallback.ProcessCommandWithResultL( aCommand ); |
|
583 |
if ( res != KErrCancel ) |
|
584 |
{ |
|
585 |
TryExitL( EAknSoftkeyClose ); |
|
586 |
} |
|
587 |
} |
|
588 |
break; |
|
589 |
} |
|
590 |
case EESMRCmdRemoveFromCalendar: |
|
591 |
{ |
|
592 |
iView->ExternalizeL(); // no forced validation |
|
593 |
TryExitL( EESMRCmdRemoveFromCalendar ); |
|
594 |
break; |
|
595 |
} |
|
596 |
case EESMRCmdViewCalendar: |
|
597 |
{ |
|
598 |
OpenInDayModeL(); |
|
599 |
break; |
|
600 |
} |
|
601 |
||
602 |
// Email commands |
|
603 |
case EESMRCmdMailDelete: |
|
604 |
{ |
|
605 |
TBool executeCmd( CESMRConfirmationQuery::ExecuteL( |
|
606 |
CESMRConfirmationQuery::EESMRDeleteMR ) ); |
|
607 |
||
608 |
if ( executeCmd ) |
|
609 |
{ |
|
610 |
TInt res = iCallback.ProcessCommandWithResultL( aCommand ); |
|
611 |
if ( res != KErrCancel ) |
|
612 |
{ |
|
613 |
TryExitL( EAknSoftkeyClose ); |
|
614 |
} |
|
615 |
} |
|
616 |
break; |
|
617 |
} |
|
618 |
case EESMRCmdClipboardCopy: |
|
619 |
{ |
|
620 |
iView->ProcessEditorCommandL( aCommand ); |
|
621 |
break; |
|
622 |
} |
|
623 |
case EESMRCmdMailPreviousMessage: // Fall through |
|
624 |
case EESMRCmdMailNextMessage: // Fall through |
|
625 |
case EESMRCmdMailForwardAsMessage: // Fall through |
|
626 |
case EESMRCmdMailMoveMessage: // Fall through |
|
627 |
case EESMRCmdMailCopyMessage: // Fall through |
|
628 |
case EESMRCmdMailMoveMessageToDrafts: // Fall through |
|
629 |
case EESMRCmdMailComposeMessage: // Fall through |
|
630 |
case EESMRCmdMailMessageDetails: |
|
631 |
case EESMRCmdForwardAsMeeting: // Fall through |
|
632 |
case EESMRCmdForwardAsMail: |
|
633 |
{ |
|
634 |
if( aCommand == EESMRCmdForwardAsMeeting && |
|
635 |
iInfoProvider.EntryL()->Entry().AttachmentCountL() > 0 ) |
|
636 |
{ |
|
637 |
// Show confirmation note if current mailbox does not |
|
638 |
// support attachments and attachments exist in the entry |
|
639 |
if( !SupportsMailBoxCapabilityL( |
|
640 |
MESMRBuilderExtension:: |
|
641 |
EMRCFSSupportsAttachmentsInMR ) ) |
|
642 |
{ |
|
643 |
if ( !CESMRConfirmationQuery::ExecuteL( |
|
644 |
CESMRConfirmationQuery:: |
|
645 |
EESMRAttachmentsNotSupported ) ) |
|
646 |
{ |
|
647 |
break; |
|
648 |
} |
|
649 |
} |
|
650 |
} |
|
651 |
||
652 |
if( aCommand == EESMRCmdForwardAsMail && |
|
653 |
iInfoProvider.EntryL()->IsRecurrentEventL() ) |
|
654 |
{ |
|
655 |
iInfoProvider.EntryL()->SetModifyingRuleL( |
|
656 |
MESMRMeetingRequestEntry::EESMRAllInSeries ); |
|
657 |
} |
|
658 |
||
659 |
TInt res = iCallback.ProcessCommandWithResultL( aCommand ); |
|
660 |
if ( res != KErrCancel ) |
|
661 |
{ |
|
662 |
TryExitL( aCommand ); |
|
663 |
} |
|
664 |
break; |
|
665 |
} |
|
666 |
||
667 |
// <cmail> |
|
668 |
case EESMRCmdDownloadManager: |
|
669 |
{ |
|
670 |
TInt res = iCallback.ProcessCommandWithResultL( aCommand ); |
|
671 |
if ( res != KErrCancel ) |
|
672 |
{ |
|
673 |
TryExitL( EAknSoftkeyClose ); |
|
674 |
} |
|
675 |
// </cmail> |
|
676 |
break; |
|
677 |
} |
|
678 |
||
679 |
// <cmail> |
|
680 |
case EESMRCmdOpenAttachment: // Fall through |
|
681 |
case EESMRCmdOpenAttachmentView: // Fall through |
|
682 |
case EESMRCmdDownloadAttachment: // Fall through |
|
683 |
case EESMRCmdDownloadAllAttachments: // Fall through |
|
684 |
case EESMRCmdSaveAttachment: // Fall through |
|
685 |
case EESMRCmdSaveAllAttachments: // Fall through |
|
686 |
// </cmail> |
|
687 |
{ |
|
688 |
TInt res = iCallback.ProcessCommandWithResultL( |
|
689 |
aCommand ); |
|
690 |
if ( res != KErrCancel ) |
|
691 |
{ |
|
692 |
iExitTriggered = ETrue; |
|
693 |
} |
|
694 |
break; |
|
695 |
} |
|
696 |
||
697 |
/* |
|
698 |
* Attachment field viewer context menu commands |
|
699 |
*/ |
|
700 |
case EESMRViewerOpenAttachment: |
|
701 |
case EESMRViewerSaveAttachment: |
|
702 |
case EESMRViewerSaveAllAttachments: |
|
703 |
case EESMRViewerCancelAttachmentDownload: |
|
704 |
{ |
|
705 |
iView->ProcessEditorCommandL( aCommand ); |
|
706 |
break; |
|
707 |
} |
|
708 |
||
709 |
case EESMRCmdMailFlagMessage: // Fall through |
|
710 |
case EESMRCmdMailMarkUnread: // Fall through |
|
711 |
case EESMRCmdMailMarkRead: |
|
712 |
{ |
|
713 |
TInt res = iCallback.ProcessCommandWithResultL( aCommand ); |
|
714 |
break; |
|
715 |
} |
|
716 |
case EESMRCmdTodoMarkAsDone: // Fall through |
|
717 |
case EESMRCmdTodoMarkAsNotDone: |
|
718 |
{ |
|
719 |
if ( iInfoProvider.EntryL()->Type() == MESMRCalEntry::EESMRCalEntryTodo ) |
|
720 |
{ |
|
721 |
User::LeaveIfError( |
|
722 |
iCallback.ProcessCommandWithResultL( aCommand )); |
|
723 |
} |
|
724 |
break; |
|
725 |
} |
|
726 |
case EESMRCmdSearchFromMap: |
|
727 |
case EESMRCmdShowOnMap: |
|
728 |
{ |
|
729 |
if ( iFeatures->FeatureSupported( |
|
730 |
CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) |
|
731 |
{ |
|
732 |
MESMRCalEntry* entry = iInfoProvider.EntryL(); |
|
733 |
LocationPluginHandlerL().HandleCommandL( aCommand, *entry ); |
|
734 |
iView->SetControlFocusedL( EESMRFieldLocation ); |
|
735 |
} |
|
736 |
break; |
|
737 |
} |
|
738 |
case EMRCmdHideAttachmentIndicator: |
|
739 |
{ |
|
740 |
iView->ProcessEditorCommandL( EMRCmdHideAttachmentIndicator ); |
|
741 |
} |
|
742 |
break; |
|
743 |
default: |
|
744 |
{ |
|
745 |
if ( aCommand >= EESMRCmdActionMenuFirst && |
|
746 |
aCommand < EESMRCmdActionMenuLast ) |
|
747 |
{ |
|
748 |
iESMRStatic.ContactMenuHandlerL().ExecuteOptionsMenuL(aCommand); |
|
749 |
} |
|
750 |
else if ( aCommand == EESMRCmdActionMenuLast ) |
|
751 |
{ |
|
752 |
TInt res = iCallback.ProcessCommandWithResultL( |
|
753 |
EESMRCmdOpenAttachmentView ); |
|
754 |
if ( res != KErrCancel ) |
|
755 |
{ |
|
756 |
iExitTriggered = ETrue; |
|
757 |
} |
|
758 |
} |
|
759 |
else |
|
760 |
{ |
|
761 |
__ASSERT_DEBUG( EFalse, Panic( EESMRViewerDlgInvalidCommand ) ); |
|
762 |
} |
|
763 |
break; |
|
764 |
} |
|
765 |
} |
|
766 |
} |
|
767 |
||
768 |
// --------------------------------------------------------------------------- |
|
769 |
// CESMRViewerDialog::OkToExitL |
|
770 |
// --------------------------------------------------------------------------- |
|
771 |
// |
|
772 |
TBool CESMRViewerDialog::OkToExitL(TInt aButtonId) |
|
773 |
{ |
|
774 |
FUNC_LOG; |
|
775 |
TBool res( EFalse ); |
|
776 |
// show options |
|
777 |
switch ( aButtonId ) |
|
778 |
{ |
|
779 |
case EAknSoftkeyOptions: |
|
780 |
{ |
|
781 |
CAknDialog::DisplayMenuL(); |
|
782 |
break; |
|
783 |
} |
|
784 |
case EAknSoftkeyContextOptions: |
|
785 |
{ |
|
786 |
if ( iFeatures->FeatureSupported( |
|
787 |
CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) |
|
788 |
{ |
|
789 |
SetContextMenu(); |
|
790 |
ShowContextMenuL(); |
|
791 |
} |
|
792 |
break; |
|
793 |
} |
|
794 |
case EESMRCmdEdit: |
|
795 |
case EESMRCmdEditLocal: |
|
796 |
case EESMRCmdCalEntryUIEdit: |
|
797 |
{ |
|
798 |
res = HandleCommandForEventL( aButtonId ); |
|
799 |
break; |
|
800 |
} |
|
801 |
case EAknSoftkeySelect: |
|
802 |
{ |
|
803 |
iView->ProcessEditorCommandL( aButtonId ); |
|
804 |
||
805 |
if ( iExitTriggered ) |
|
806 |
{ |
|
807 |
res = ETrue; |
|
808 |
} |
|
809 |
break; |
|
810 |
} |
|
811 |
// <cmail> |
|
812 |
case EESMRCmdOpenAttachmentView: |
|
813 |
case EESMRCmdMskOpenEmailAttachment: |
|
814 |
case EESMRCmdOpenAttachment: |
|
815 |
case EESMRCmdDownloadAttachment: |
|
816 |
{ |
|
817 |
ProcessCommandL( aButtonId ); |
|
818 |
break; |
|
819 |
} |
|
820 |
// </cmail> |
|
821 |
case EESMRCmdShowAllAttendees: |
|
822 |
case EESMRCmdShowOnMap: |
|
823 |
{ |
|
824 |
iView->ProcessEditorCommandL( aButtonId ); |
|
825 |
break; |
|
826 |
} |
|
827 |
case EEikBidCancel: |
|
828 |
{ |
|
829 |
res = ETrue; |
|
830 |
break; |
|
831 |
} |
|
832 |
case EAknSoftkeyClose: // Fall through |
|
833 |
case EAknCmdExit: // Fall through |
|
834 |
case EESMRCmdMailPreviousMessage: // Fall through |
|
835 |
case EESMRCmdMailNextMessage: // Fall through |
|
836 |
case EESMRCmdMailForwardAsMessage: // Fall through |
|
837 |
case EESMRCmdMailMoveMessage: // Fall through |
|
838 |
case EESMRCmdMailCopyMessage: // Fall through |
|
839 |
case EESMRCmdMailMoveMessageToDrafts: // Fall through |
|
840 |
case EESMRCmdMailComposeMessage: // Fall through |
|
841 |
case EESMRCmdMailMessageDetails: |
|
842 |
case EESMRCmdRemoveFromCalendar: |
|
843 |
{ |
|
844 |
res = HandleMRExitL( aButtonId ); |
|
845 |
break; |
|
846 |
} |
|
847 |
||
848 |
default: |
|
849 |
{ |
|
850 |
if(iExitTriggered) |
|
851 |
{ |
|
852 |
res = ETrue; |
|
853 |
} |
|
854 |
break; |
|
855 |
} |
|
856 |
} |
|
857 |
||
858 |
return res; |
|
859 |
} |
|
860 |
||
861 |
// --------------------------------------------------------------------------- |
|
862 |
// CESMRViewerDialog::CreateCustomControlL |
|
863 |
// --------------------------------------------------------------------------- |
|
864 |
// |
|
865 |
SEikControlInfo CESMRViewerDialog::CreateCustomControlL( TInt aType ) // codescanner::LFunctionCantLeave |
|
866 |
{ |
|
867 |
FUNC_LOG; |
|
868 |
SEikControlInfo controlInfo; |
|
869 |
controlInfo.iControl = NULL; |
|
870 |
controlInfo.iFlags = 0; |
|
871 |
controlInfo.iTrailerTextId = 0; |
|
872 |
||
873 |
if ( aType == EEsMrViewerType ) |
|
874 |
{ |
|
875 |
controlInfo.iControl = iView; |
|
876 |
} |
|
877 |
||
878 |
return controlInfo; |
|
879 |
} |
|
880 |
||
881 |
// --------------------------------------------------------------------------- |
|
882 |
// CESMRViewerDialog::ExecuteViewLD |
|
883 |
// --------------------------------------------------------------------------- |
|
884 |
// |
|
885 |
TInt CESMRViewerDialog::ExecuteViewLD() |
|
886 |
{ |
|
887 |
FUNC_LOG; |
|
888 |
return ExecuteLD( R_MRVIEWER_DIALOG ); |
|
889 |
} |
|
890 |
||
891 |
// --------------------------------------------------------------------------- |
|
892 |
// CESMRViewerDialog::Response |
|
893 |
// --------------------------------------------------------------------------- |
|
894 |
// |
|
895 |
TBool CESMRViewerDialog::Response( TInt aCommand ) |
|
896 |
{ |
|
897 |
FUNC_LOG; |
|
898 |
||
899 |
TBool retValue( EFalse ); |
|
900 |
iExitTriggered = EFalse; |
|
901 |
||
902 |
if ( KErrCancel != aCommand ) |
|
903 |
{ |
|
904 |
TBool handleAttachments( EFalse ); |
|
905 |
TRAPD( error, handleAttachments = UserWantToHandleAttachmentsL() ); |
|
906 |
||
907 |
if ( !handleAttachments ) |
|
908 |
{ |
|
909 |
// Documentation says that this function might leave and also might |
|
910 |
// return system wide error code. |
|
911 |
TInt res = KErrNone; |
|
912 |
TRAP( error, res = iCallback.ProcessCommandWithResultL( aCommand ) ); |
|
913 |
if ( res != KErrCancel && error == KErrNone ) |
|
914 |
{ |
|
915 |
iExitTriggered = ETrue; |
|
916 |
retValue = ETrue; |
|
917 |
} |
|
918 |
} |
|
919 |
} |
|
920 |
||
921 |
return retValue; |
|
922 |
} |
|
923 |
||
924 |
// --------------------------------------------------------------------------- |
|
925 |
// CESMRViewerDialog::ExitDialog |
|
926 |
// --------------------------------------------------------------------------- |
|
927 |
// |
|
928 |
void CESMRViewerDialog::ExitDialog() |
|
929 |
{ |
|
930 |
FUNC_LOG; |
|
931 |
// If closing does not work what can we do |
|
932 |
TRAPD( error, ProcessCommandL(EAknSoftkeyClose) ); |
|
933 |
if ( error != KErrNone ) |
|
934 |
{ |
|
935 |
iCoeEnv->HandleError( error ); |
|
936 |
} |
|
937 |
} |
|
938 |
||
939 |
// --------------------------------------------------------------------------- |
|
940 |
// CESMRViewerDialog::ChangeReadyResponseL |
|
941 |
// --------------------------------------------------------------------------- |
|
942 |
// |
|
943 |
void CESMRViewerDialog::ChangeReadyResponseL() |
|
944 |
{ |
|
945 |
FUNC_LOG; |
|
946 |
iView->ProcessEditorCommandL( EESMRCmdEdit ); |
|
947 |
} |
|
948 |
||
949 |
// --------------------------------------------------------------------------- |
|
950 |
// CESMRViewerDialog::DynInitToolbarL |
|
951 |
// --------------------------------------------------------------------------- |
|
952 |
// |
|
953 |
void CESMRViewerDialog::DynInitToolbarL ( |
|
954 |
TInt /*aResourceId*/, |
|
955 |
CAknToolbar* /*aToolbar*/ ) |
|
956 |
{ |
|
957 |
||
958 |
} |
|
959 |
||
960 |
// --------------------------------------------------------------------------- |
|
961 |
// CESMRViewerDialog::OfferToolbarEventL |
|
962 |
// --------------------------------------------------------------------------- |
|
963 |
// |
|
964 |
void CESMRViewerDialog::OfferToolbarEventL( TInt aCommand ) |
|
965 |
{ |
|
966 |
ProcessCommandL( aCommand ); |
|
967 |
} |
|
968 |
||
969 |
// --------------------------------------------------------------------------- |
|
970 |
// CESMRViewerDialog::DynInitMenuPaneL |
|
971 |
// --------------------------------------------------------------------------- |
|
972 |
// |
|
973 |
void CESMRViewerDialog::DynInitMenuPaneL( |
|
974 |
TInt aResourceId, |
|
975 |
CEikMenuPane* aMenuPane ) |
|
976 |
{ |
|
977 |
FUNC_LOG; |
|
978 |
MESMRCalEntry* entry = iInfoProvider.EntryL(); |
|
979 |
||
980 |
TMRMenuStyle menuStyle( EMROptionsMenu ); |
|
981 |
||
982 |
switch ( aResourceId ) |
|
983 |
{ |
|
984 |
case R_ACTION_MENU: |
|
985 |
{ |
|
986 |
CESMRContactMenuHandler& handler = iESMRStatic.ContactMenuHandlerL(); |
|
987 |
if ( handler.OptionsMenuAvailable() ) |
|
988 |
{ |
|
989 |
handler.InitOptionsMenuL( aMenuPane ); |
|
990 |
} |
|
991 |
break; |
|
992 |
} |
|
993 |
case R_MR_VIEWER_MENU: |
|
994 |
{ |
|
995 |
HandlePolicyMenuL( |
|
996 |
aResourceId, |
|
997 |
aMenuPane ); |
|
998 |
||
999 |
// Insert send ui menu for all other entry types than meeting request |
|
1000 |
if ( entry->Type() != MESMRCalEntry::EESMRCalEntryMeetingRequest ) |
|
1001 |
{ |
|
1002 |
TryInsertSendMenuL(aMenuPane); |
|
1003 |
} |
|
1004 |
||
1005 |
if ( entry->Entry().AttendeesL().Count() <= 1 ) |
|
1006 |
{ |
|
1007 |
aMenuPane->SetItemDimmed( EESMRCmdReplyAll, ETrue ); |
|
1008 |
} |
|
1009 |
||
1010 |
HandleDynamicMenuItemsL( aResourceId, aMenuPane ); |
|
1011 |
||
1012 |
break; |
|
1013 |
} |
|
1014 |
case R_FORWARD_OPTIONS: |
|
1015 |
{ |
|
1016 |
HandleForwardMenuL( aResourceId, aMenuPane ); |
|
1017 |
break; |
|
1018 |
} |
|
1019 |
case R_MR_VIEWER_LOCATION_MENU: |
|
1020 |
{ |
|
1021 |
menuStyle = EMRContextMenu; |
|
1022 |
InitLocationMenuL( aMenuPane ); |
|
1023 |
break; |
|
1024 |
} |
|
1025 |
case R_MR_VIEWER_ATTACHMENT_MENU: |
|
1026 |
{ |
|
1027 |
menuStyle = EMRContextMenu; |
|
1028 |
break; |
|
1029 |
} |
|
1030 |
default: |
|
1031 |
{ |
|
1032 |
break; |
|
1033 |
} |
|
1034 |
} |
|
1035 |
||
1036 |
// Handles email submenu |
|
1037 |
HandleEmailSubmenuL( aResourceId, aMenuPane ); |
|
1038 |
||
1039 |
// Handles field specific context menu |
|
1040 |
iView->DynInitMenuPaneL( menuStyle, aResourceId, aMenuPane ); |
|
1041 |
} |
|
1042 |
||
1043 |
// --------------------------------------------------------------------------- |
|
1044 |
// CESMRViewerDialog::HandleDynamicMenuItemsL |
|
1045 |
// --------------------------------------------------------------------------- |
|
1046 |
// |
|
1047 |
void CESMRViewerDialog::HandleDynamicMenuItemsL( |
|
1048 |
TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
1049 |
{ |
|
1050 |
FUNC_LOG; |
|
1051 |
if ( aResourceId == R_MR_VIEWER_MENU ) |
|
1052 |
{ |
|
1053 |
// Map and Navigation Fw support |
|
1054 |
if ( iFeatures->FeatureSupported( |
|
1055 |
CESMRFeatureSettings::EESMRUIMnFwIntegration ) && |
|
1056 |
iView->IsControlVisible( EESMRFieldLocation )) |
|
1057 |
{ |
|
1058 |
MESMRCalEntry* entry = iInfoProvider.EntryL(); |
|
1059 |
TBool showOnMap = LocationPluginHandlerL(). |
|
1060 |
IsCommandAvailableL( EESMRCmdShowOnMap, *entry ); |
|
1061 |
aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, showOnMap ); |
|
1062 |
aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); |
|
1063 |
} |
|
1064 |
else |
|
1065 |
{ |
|
1066 |
aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, ETrue ); |
|
1067 |
aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, ETrue ); |
|
1068 |
} |
|
1069 |
||
1070 |
// Handle Action Menu item |
|
1071 |
TBool dim = !iESMRStatic.ContactMenuHandlerL().OptionsMenuAvailable(); |
|
1072 |
aMenuPane->SetItemDimmed( EESMRCmdActionMenu, dim ); |
|
1073 |
aMenuPane->SetItemDimmed( EESMRCmdClipboardCopy, dim ); |
|
1074 |
} |
|
1075 |
} |
|
1076 |
||
1077 |
// --------------------------------------------------------------------------- |
|
1078 |
// CESMRViewerDialog::TryInsertSendMenuL |
|
1079 |
// --------------------------------------------------------------------------- |
|
1080 |
// |
|
1081 |
void CESMRViewerDialog::TryInsertSendMenuL(CEikMenuPane* aMenuPane) |
|
1082 |
{ |
|
1083 |
FUNC_LOG; |
|
1084 |
TInt index(KErrNotFound); |
|
1085 |
||
1086 |
// Insert send menu to the next position from "editing options" |
|
1087 |
aMenuPane->ItemAndPos(EESMRCmdClipboardCopy, index); |
|
1088 |
if (index == KErrNotFound) |
|
1089 |
{ |
|
1090 |
aMenuPane->ItemAndPos(EESMRCmdCalEntryUIDelete, index); |
|
1091 |
if (index == KErrNotFound) |
|
1092 |
{ |
|
1093 |
aMenuPane->ItemAndPos(EESMRCmdDeleteMR, index); |
|
1094 |
} |
|
1095 |
} |
|
1096 |
index++; |
|
1097 |
iESMRSendUI->DisplaySendMenuItemL(*aMenuPane, index); |
|
1098 |
} |
|
1099 |
||
1100 |
// --------------------------------------------------------------------------- |
|
1101 |
// CESMRViewerDialog::SetContextMenu |
|
1102 |
// --------------------------------------------------------------------------- |
|
1103 |
// |
|
1104 |
void CESMRViewerDialog::SetContextMenu() |
|
1105 |
{ |
|
1106 |
TESMREntryFieldId fieldId = iView->ClickedOrFocusedField(); |
|
1107 |
||
1108 |
switch( fieldId ) |
|
1109 |
{ |
|
1110 |
case EESMRFieldViewerAttachments: |
|
1111 |
{ |
|
1112 |
iContextMenuResourceId = R_MR_VIEWER_ATTACHMENT_CONTEXT_MENU; |
|
1113 |
} |
|
1114 |
break; |
|
1115 |
||
1116 |
default: |
|
1117 |
iContextMenuResourceId = R_MR_VIEWER_CONTEXT_MENU; |
|
1118 |
break; |
|
1119 |
} |
|
1120 |
||
1121 |
iMenuBar->SetContextMenuTitleResourceId( iContextMenuResourceId ); |
|
1122 |
} |
|
1123 |
||
1124 |
// --------------------------------------------------------------------------- |
|
1125 |
// CESMRViewerDialog::OpenInDayModeL |
|
1126 |
// --------------------------------------------------------------------------- |
|
1127 |
// |
|
1128 |
void CESMRViewerDialog::OpenInDayModeL() |
|
1129 |
{ |
|
1130 |
FUNC_LOG; |
|
1131 |
||
1132 |
TApaTaskList taskList( iCoeEnv->WsSession() ); |
|
1133 |
TApaTask task = taskList.FindApp(KCalendarAppUID ); |
|
1134 |
||
1135 |
HBufC16* tail = NULL; |
|
1136 |
CommandTailL( tail ); |
|
1137 |
CleanupStack::PushL( tail ); |
|
1138 |
||
1139 |
// copy the 16-bit data into 8-bit buffer |
|
1140 |
HBufC8* paramBuf = HBufC8::NewLC( tail->Length() *2 ); |
|
1141 |
TPtr8 tailBuf = paramBuf->Des(); |
|
1142 |
||
1143 |
tailBuf.Copy( |
|
1144 |
reinterpret_cast<const TUint8*>( tail->Ptr() ), tail->Length() *2 ); |
|
1145 |
||
1146 |
if( task.Exists() ) // Calendar already open |
|
1147 |
{ |
|
1148 |
const TUid dummyUID = { 0x0 }; |
|
1149 |
task.SendMessage( dummyUID, tailBuf ); |
|
1150 |
task.BringToForeground(); |
|
1151 |
} |
|
1152 |
else // Launch Calendar into day view |
|
1153 |
{ |
|
1154 |
TApaAppInfo appInfo; |
|
1155 |
RApaLsSession lsSession; |
|
1156 |
User::LeaveIfError(lsSession.Connect()); |
|
1157 |
CleanupClosePushL( lsSession ); |
|
1158 |
||
1159 |
if( lsSession.GetAppInfo( appInfo, KCalendarAppUID ) == KErrNone ) |
|
1160 |
{ |
|
1161 |
CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); |
|
1162 |
cmdLine->SetExecutableNameL( appInfo.iFullName ); |
|
1163 |
cmdLine->SetCommandL( EApaCommandRun ); |
|
1164 |
cmdLine->SetTailEndL( tailBuf ); |
|
1165 |
||
1166 |
lsSession.StartApp( *cmdLine ); |
|
1167 |
CleanupStack::PopAndDestroy( cmdLine ); |
|
1168 |
} |
|
1169 |
||
1170 |
// Close lsSession |
|
1171 |
CleanupStack::PopAndDestroy(); // codescanner::cleanup |
|
1172 |
} |
|
1173 |
CleanupStack::PopAndDestroy( paramBuf ); |
|
1174 |
CleanupStack::PopAndDestroy( tail ); |
|
1175 |
} |
|
1176 |
||
1177 |
// --------------------------------------------------------------------------- |
|
1178 |
// CESMRViewerDialog::CommandTailL |
|
1179 |
// --------------------------------------------------------------------------- |
|
1180 |
// |
|
1181 |
void CESMRViewerDialog::CommandTailL(HBufC16*& aTailBuffer) |
|
1182 |
{ |
|
1183 |
FUNC_LOG; |
|
1184 |
// "DATE YYYY MM DD HH MM SS MMMMMM" |
|
1185 |
aTailBuffer = HBufC::NewLC( KCalDefaultBufferLen ); |
|
1186 |
TPtr tailPtr = aTailBuffer->Des(); |
|
1187 |
||
1188 |
// get the start time of entry |
|
1189 |
CCalEntry& entry = iInfoProvider.EntryL()->Entry(); |
|
1190 |
TTime startTime = entry.StartTimeL().TimeLocalL(); |
|
1191 |
||
1192 |
startTime.FormatL(tailPtr, KCalCmdTimeFormat() ); |
|
1193 |
tailPtr.Insert( 0, KCalCmdDATE ); |
|
1194 |
CleanupStack::Pop( aTailBuffer ); |
|
1195 |
} |
|
1196 |
||
1197 |
// --------------------------------------------------------------------------- |
|
1198 |
// CESMRViewerDialog::HandleCommandForEventL |
|
1199 |
// --------------------------------------------------------------------------- |
|
1200 |
// |
|
1201 |
TBool CESMRViewerDialog::HandleCommandForEventL( TInt aCommand ) |
|
1202 |
{ |
|
1203 |
FUNC_LOG; |
|
1204 |
TBool closeDialog( EFalse ); |
|
1205 |
||
1206 |
MESMRCalEntry* calEntry( iInfoProvider.EntryL() ); |
|
1207 |
||
1208 |
switch ( aCommand ) |
|
1209 |
{ |
|
1210 |
case EESMRCmdEdit: //Fall through |
|
1211 |
case EESMRCmdEditLocal: //Fall through |
|
1212 |
case EESMRCmdCalEntryUIEdit: |
|
1213 |
{ |
|
1214 |
if ( calEntry->IsRecurrentEventL() ) |
|
1215 |
{ |
|
1216 |
// Check is the currently viewed entry a modifying entry. |
|
1217 |
// MESMRCalEntry should provide this method. |
|
1218 |
// if the entry is an exception to series, no query |
|
1219 |
// should be asked in which mode the editor should be launched |
|
1220 |
// in this occurance or series -mode. |
|
1221 |
if ( calEntry->Entry().RecurrenceIdL().TimeUtcL() != |
|
1222 |
Time::NullTTime() ) |
|
1223 |
{ |
|
1224 |
calEntry->SetModifyingRuleL( MESMRCalEntry::EESMRThisOnly ); |
|
1225 |
} |
|
1226 |
else |
|
1227 |
{ |
|
1228 |
SetRecurrenceModRuleL( |
|
1229 |
*calEntry, |
|
1230 |
CESMRListQuery::EESMROpenThisOccurenceOrSeriesQuery ); |
|
1231 |
} |
|
1232 |
} |
|
1233 |
||
1234 |
MESMRMeetingRequestEntry* entry = NULL; |
|
1235 |
if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) |
|
1236 |
{ |
|
1237 |
entry = static_cast<MESMRMeetingRequestEntry*>(calEntry); |
|
1238 |
||
1239 |
TESMRRole role = entry->RoleL(); |
|
1240 |
if ( role == EESMRRoleOrganizer ) |
|
1241 |
{ |
|
1242 |
User::LeaveIfError( |
|
1243 |
iCallback.ProcessCommandWithResultL( EESMRCmdEdit )); |
|
1244 |
closeDialog = ETrue; |
|
1245 |
} |
|
1246 |
else |
|
1247 |
{ |
|
1248 |
User::LeaveIfError( |
|
1249 |
iCallback.ProcessCommandWithResultL( EESMRCmdEditLocal )); |
|
1250 |
closeDialog = ETrue; |
|
1251 |
} |
|
1252 |
} |
|
1253 |
else |
|
1254 |
{ |
|
1255 |
User::LeaveIfError( |
|
1256 |
iCallback.ProcessCommandWithResultL( EESMRCmdCalEntryUIEdit)); |
|
1257 |
closeDialog = ETrue; |
|
1258 |
} |
|
1259 |
break; |
|
1260 |
} |
|
1261 |
case EESMRCmdDeleteMR: // Fall through |
|
1262 |
case EESMRCmdCalEntryUIDelete: |
|
1263 |
{ |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1264 |
TBool okToDelete( ETrue ); |
64 | 1265 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1266 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1267 |
if ( calEntry->IsRecurrentEventL() && calEntry->IsStoredL() ) |
64 | 1268 |
{ |
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1269 |
if( CCalenInterimUtils2::IsMeetingRequestL( calEntry->Entry() ) ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1270 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1271 |
// Static cast is safe here. We know for sure that entry is MR |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1272 |
MESMRMeetingRequestEntry* mrEntry = |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1273 |
static_cast<MESMRMeetingRequestEntry*>( calEntry ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1274 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1275 |
if( mrEntry->IsOpenedFromMail() ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1276 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1277 |
okToDelete = CESMRConfirmationQuery::ExecuteL( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1278 |
CESMRConfirmationQuery::EESMRDeleteMR ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1279 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1280 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1281 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1282 |
SetRecurrenceModRuleL( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1283 |
*calEntry, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1284 |
CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1285 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1286 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1287 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1288 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1289 |
SetRecurrenceModRuleL( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1290 |
*calEntry, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1291 |
CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1292 |
} |
64 | 1293 |
} |
1294 |
else |
|
1295 |
{ |
|
1296 |
if( CCalenInterimUtils2::IsMeetingRequestL( calEntry->Entry() ) ) |
|
1297 |
{ |
|
1298 |
okToDelete = CESMRConfirmationQuery::ExecuteL( |
|
1299 |
CESMRConfirmationQuery::EESMRDeleteMR ); |
|
1300 |
} |
|
1301 |
else |
|
1302 |
{ |
|
1303 |
okToDelete = CESMRConfirmationQuery::ExecuteL( |
|
1304 |
CESMRConfirmationQuery::EESMRDeleteEntry ); |
|
1305 |
} |
|
1306 |
} |
|
1307 |
||
1308 |
if ( okToDelete ) |
|
1309 |
{ |
|
1310 |
// When deleting we do not need to externalize entry |
|
1311 |
TInt res = iCallback.ProcessCommandWithResultL( aCommand ); |
|
1312 |
if ( res != KErrCancel ) |
|
1313 |
{ |
|
1314 |
closeDialog = ETrue; |
|
1315 |
} |
|
1316 |
} |
|
1317 |
break; |
|
1318 |
} |
|
1319 |
default: |
|
1320 |
{ |
|
1321 |
break; |
|
1322 |
} |
|
1323 |
} |
|
1324 |
||
1325 |
return closeDialog; |
|
1326 |
} |
|
1327 |
||
1328 |
||
1329 |
// --------------------------------------------------------------------------- |
|
1330 |
// CESMRViewerDialog::SendCalendarEntryL |
|
1331 |
// --------------------------------------------------------------------------- |
|
1332 |
// |
|
1333 |
void CESMRViewerDialog::SendCalendarEntryL(TInt aCommandId) |
|
1334 |
{ |
|
1335 |
FUNC_LOG; |
|
1336 |
// we don't need MenuPane in CCalSend but we need it for the API |
|
1337 |
CEikMenuPane* pane=NULL; |
|
1338 |
||
1339 |
// Show menu to user |
|
1340 |
// CCalenSend handles selection internally, so we don't |
|
1341 |
// get anything in return |
|
1342 |
iESMRSendUI->DisplaySendCascadeMenuL(*pane); |
|
1343 |
||
1344 |
// Try to send |
|
1345 |
if (iESMRSendUI->CanSendL(aCommandId)) |
|
1346 |
{ |
|
1347 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1348 |
iESMRSendUI->SendAsVCalendarL(aCommandId, calEntry->Entry() ); |
|
1349 |
} |
|
1350 |
} |
|
1351 |
||
1352 |
||
1353 |
// --------------------------------------------------------------------------- |
|
1354 |
// CESMRViewerDialog::HandleEmailSubmenuL |
|
1355 |
// --------------------------------------------------------------------------- |
|
1356 |
// |
|
1357 |
void CESMRViewerDialog::HandleEmailSubmenuL( |
|
1358 |
TInt aResourceId, |
|
1359 |
CEikMenuPane* aMenuPane ) |
|
1360 |
{ |
|
1361 |
FUNC_LOG; |
|
1362 |
||
1363 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1364 |
||
1365 |
// Insert send ui menu for all other entry types than meeting request |
|
1366 |
if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) |
|
1367 |
{ |
|
1368 |
if ( R_MR_VIEWER_MENU == aResourceId ) |
|
1369 |
{ |
|
1370 |
const CESMRPolicy& currentPolicy( |
|
1371 |
iInfoProvider.PolicyProvider().CurrentPolicy() ); |
|
1372 |
||
1373 |
aMenuPane->SetItemDimmed( |
|
1374 |
EESMRCmdMailDelete, |
|
1375 |
!iCallback.IsCommandAvailable( |
|
1376 |
EESMRCmdMailDelete) ); |
|
1377 |
aMenuPane->SetItemDimmed( |
|
1378 |
EESMRCmdMailMessageDetails, |
|
1379 |
!iCallback.IsCommandAvailable( |
|
1380 |
EESMRCmdMailMessageDetails ) ); |
|
1381 |
||
1382 |
aMenuPane->SetItemDimmed( |
|
1383 |
EESMRCmdMailPreviousMessage, |
|
1384 |
!iCallback.IsCommandAvailable( |
|
1385 |
EESMRCmdMailPreviousMessage ) ); |
|
1386 |
||
1387 |
aMenuPane->SetItemDimmed( |
|
1388 |
EESMRCmdMailNextMessage, |
|
1389 |
!iCallback.IsCommandAvailable( |
|
1390 |
EESMRCmdMailNextMessage ) ); |
|
1391 |
} |
|
1392 |
} |
|
1393 |
} |
|
1394 |
||
1395 |
// --------------------------------------------------------------------------- |
|
1396 |
// CESMRViewerDialog::HandlePolicyMenuL |
|
1397 |
// --------------------------------------------------------------------------- |
|
1398 |
// |
|
1399 |
void CESMRViewerDialog::HandlePolicyMenuL( |
|
1400 |
TInt aResourceId, |
|
1401 |
CEikMenuPane* aMenuPane ) |
|
1402 |
{ |
|
1403 |
FUNC_LOG; |
|
1404 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1405 |
const CESMRPolicy& currentPolicy( |
|
1406 |
iInfoProvider.PolicyProvider().CurrentPolicy() ); |
|
1407 |
||
1408 |
if ( aResourceId == R_MR_VIEWER_MENU ) |
|
1409 |
{ |
|
1410 |
if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) |
|
1411 |
{ |
|
1412 |
MESMRMeetingRequestEntry* mrEntry = |
|
1413 |
(MESMRMeetingRequestEntry*)( calEntry ); |
|
1414 |
CCalEntry::TMethod method( |
|
1415 |
mrEntry->Entry().MethodL() ); |
|
1416 |
||
1417 |
TInt itemsInMenu( aMenuPane->NumberOfItemsInPane() ); |
|
1418 |
for ( TInt i(0); i < itemsInMenu; ++i ) |
|
1419 |
{ |
|
1420 |
CEikMenuPaneItem::SData& item( |
|
1421 |
aMenuPane->ItemDataByIndexL( i ) ); |
|
1422 |
||
1423 |
if ( CCalEntry::EMethodCancel == method && |
|
1424 |
EESMRRoleOrganizer != mrEntry->RoleL()) |
|
1425 |
{ |
|
1426 |
switch ( item.iCommandId ) |
|
1427 |
{ |
|
1428 |
case EESMRCmdAcceptMR: // Fall through |
|
1429 |
case EESMRCmdTentativeMR: // Fall through |
|
1430 |
case EESMRCmdDeclineMR: // Fall through |
|
1431 |
case EESMRCmdDeleteMR: |
|
1432 |
{ |
|
1433 |
aMenuPane->SetItemDimmed( |
|
1434 |
item.iCommandId, |
|
1435 |
ETrue ); |
|
1436 |
break; |
|
1437 |
} |
|
1438 |
case EESMRCmdRemoveFromCalendar: |
|
1439 |
{ |
|
1440 |
if( SupportsMailBoxCapabilityL( |
|
1441 |
MESMRBuilderExtension:: |
|
1442 |
EMRCFSRemoveFromCalendar ) ) |
|
1443 |
{ |
|
1444 |
aMenuPane->SetItemDimmed( |
|
1445 |
item.iCommandId, |
|
1446 |
EFalse ); |
|
1447 |
} |
|
1448 |
else |
|
1449 |
{ |
|
1450 |
aMenuPane->SetItemDimmed( |
|
1451 |
item.iCommandId, |
|
1452 |
ETrue ); |
|
1453 |
} |
|
1454 |
break; |
|
1455 |
} |
|
1456 |
default: |
|
1457 |
{ |
|
1458 |
aMenuPane->SetItemDimmed( |
|
1459 |
item.iCommandId, |
|
1460 |
!currentPolicy.IsDefaultCommand( |
|
1461 |
item.iCommandId) ); |
|
1462 |
break; |
|
1463 |
} |
|
1464 |
} |
|
1465 |
} |
|
1466 |
else |
|
1467 |
{ |
|
1468 |
if( mrEntry->OccursInPastL() || |
|
1469 |
mrEntry->IsEntryOutOfDateL() || |
|
1470 |
mrEntry->IsMeetingCancelledL() ) |
|
1471 |
{ |
|
1472 |
if( item.iCommandId == EESMRCmdAcceptMR || |
|
1473 |
item.iCommandId == EESMRCmdTentativeMR || |
|
1474 |
item.iCommandId == EESMRCmdDeclineMR ) |
|
1475 |
{ |
|
1476 |
aMenuPane->SetItemDimmed( |
|
1477 |
item.iCommandId, |
|
1478 |
ETrue ); |
|
1479 |
} |
|
1480 |
else if ( EESMRCmdRemoveFromCalendar == item.iCommandId && |
|
1481 |
mrEntry->IsOpenedFromMail() ) |
|
1482 |
{ |
|
1483 |
aMenuPane->SetItemDimmed( |
|
1484 |
EESMRCmdRemoveFromCalendar, |
|
1485 |
EFalse ); |
|
1486 |
} |
|
1487 |
else |
|
1488 |
{ |
|
1489 |
aMenuPane->SetItemDimmed( |
|
1490 |
item.iCommandId, |
|
1491 |
!currentPolicy.IsDefaultCommand( item.iCommandId) ); |
|
1492 |
} |
|
1493 |
} |
|
1494 |
else |
|
1495 |
{ |
|
1496 |
if ( EESMRCmdRemoveFromCalendar == item.iCommandId ) |
|
1497 |
{ |
|
1498 |
aMenuPane->SetItemDimmed( |
|
1499 |
EESMRCmdRemoveFromCalendar, |
|
1500 |
ETrue ); |
|
1501 |
} |
|
1502 |
else |
|
1503 |
{ |
|
1504 |
aMenuPane->SetItemDimmed( |
|
1505 |
item.iCommandId, |
|
1506 |
!currentPolicy.IsDefaultCommand( item.iCommandId) ); |
|
1507 |
} |
|
1508 |
} |
|
1509 |
} |
|
1510 |
if ( EESMRRoleOrganizer == mrEntry->RoleL()) |
|
1511 |
{ |
|
1512 |
//dim tracking view menuitem if no attendees |
|
1513 |
//or if current cfsmailbox doesn't support attendee status |
|
1514 |
if( EESMRCmdViewTrack == item.iCommandId ) |
|
1515 |
{ |
|
1516 |
TInt count(0); |
|
1517 |
||
1518 |
if ( SupportsMailBoxCapabilityL( |
|
1519 |
MESMRBuilderExtension:: |
|
1520 |
EMRCFSAttendeeStatus ) ) |
|
1521 |
{ |
|
1522 |
count = mrEntry->AttendeeCountL(EESMRRoleRequiredAttendee)+ |
|
1523 |
mrEntry->AttendeeCountL(EESMRRoleOptionalAttendee); |
|
1524 |
} |
|
1525 |
||
1526 |
if (!count) |
|
1527 |
{ |
|
1528 |
aMenuPane->SetItemDimmed( item.iCommandId, ETrue ); |
|
1529 |
} |
|
1530 |
} |
|
1531 |
} |
|
1532 |
} |
|
1533 |
} |
|
1534 |
else |
|
1535 |
{ |
|
1536 |
TInt itemsInMenu( aMenuPane->NumberOfItemsInPane() ); |
|
1537 |
for ( TInt i(0); i < itemsInMenu; ++i ) |
|
1538 |
{ |
|
1539 |
CEikMenuPaneItem::SData& item = aMenuPane->ItemDataByIndexL(i); |
|
1540 |
||
1541 |
aMenuPane->SetItemDimmed( |
|
1542 |
item.iCommandId, |
|
1543 |
!currentPolicy.IsDefaultCommand( item.iCommandId) ); |
|
1544 |
} |
|
1545 |
||
1546 |
if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryTodo ) |
|
1547 |
{ |
|
1548 |
if (currentPolicy.IsDefaultCommand( EESMRCmdTodoMarkAsDone ) ) |
|
1549 |
{ |
|
1550 |
TBool dim(EFalse); |
|
1551 |
if( calEntry->Entry().StatusL() == CCalEntry::ETodoCompleted ) |
|
1552 |
{ |
|
1553 |
dim = ETrue; |
|
1554 |
} |
|
1555 |
aMenuPane->SetItemDimmed( EESMRCmdTodoMarkAsDone, dim ); |
|
1556 |
aMenuPane->SetItemDimmed( EESMRCmdTodoMarkAsNotDone, !dim ); |
|
1557 |
} |
|
1558 |
} |
|
1559 |
} |
|
1560 |
} |
|
1561 |
} |
|
1562 |
||
1563 |
// --------------------------------------------------------------------------- |
|
1564 |
// CESMRViewerDialog::SupportsAttendeeStatusL |
|
1565 |
// --------------------------------------------------------------------------- |
|
1566 |
// |
|
1567 |
TBool CESMRViewerDialog::SupportsMailBoxCapabilityL( |
|
1568 |
MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa ) |
|
1569 |
{ |
|
1570 |
FUNC_LOG; |
|
1571 |
TBool supportsCapability( EFalse ); |
|
1572 |
CESMRFieldBuilderInterface* plugin = NULL; |
|
1573 |
TRAPD( error, |
|
1574 |
plugin = CESMRFieldBuilderInterface::CreatePluginL( |
|
1575 |
TUid::Uid(KESMRUIFieldBuilderPluginImplUId) ) ); |
|
1576 |
CleanupStack::PushL( plugin ); |
|
1577 |
||
1578 |
if (error == KErrNone && plugin) |
|
1579 |
{ |
|
1580 |
TUid uid = {0}; |
|
1581 |
MESMRBuilderExtension* extension = |
|
1582 |
static_cast<MESMRBuilderExtension*>( plugin->ExtensionL(uid) ); |
|
1583 |
||
1584 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1585 |
||
1586 |
if ( extension && MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type()) |
|
1587 |
{ |
|
1588 |
// Static cast is safe here. We know for sure that entry is MR |
|
1589 |
MESMRMeetingRequestEntry* mrEntry = |
|
1590 |
static_cast<MESMRMeetingRequestEntry*>( calEntry ); |
|
1591 |
||
1592 |
supportsCapability = extension->CFSMailBoxCapabilityL( |
|
1593 |
mrEntry->Entry().PhoneOwnerL()->Address(), |
|
1594 |
aCapa ); |
|
1595 |
} |
|
1596 |
} |
|
1597 |
||
1598 |
CleanupStack::PopAndDestroy( plugin ); |
|
1599 |
||
1600 |
return supportsCapability; |
|
1601 |
} |
|
1602 |
||
1603 |
// --------------------------------------------------------------------------- |
|
1604 |
// CESMRViewerDialog::HandleMRExitL |
|
1605 |
// --------------------------------------------------------------------------- |
|
1606 |
// |
|
1607 |
TBool CESMRViewerDialog::HandleMRExitL( TInt aCommand ) |
|
1608 |
{ |
|
1609 |
FUNC_LOG; |
|
1610 |
TBool deleteEntry( EFalse ); |
|
1611 |
||
1612 |
TBool queryAvailable( ETrue ); |
|
1613 |
||
1614 |
// disable EESMRRemoveAppointment query if exiting dialog |
|
1615 |
// through email-based option menu command, |
|
1616 |
switch ( aCommand ) |
|
1617 |
{ |
|
1618 |
case EESMRCmdMailPreviousMessage: // Fall through |
|
1619 |
case EESMRCmdMailNextMessage: // Fall through |
|
1620 |
case EESMRCmdMailForwardAsMessage: // Fall through |
|
1621 |
case EESMRCmdMailMoveMessage: // Fall through |
|
1622 |
case EESMRCmdMailCopyMessage: // Fall through |
|
1623 |
case EESMRCmdMailMoveMessageToDrafts: // Fall through |
|
1624 |
case EESMRCmdMailComposeMessage: // Fall through |
|
1625 |
case EESMRCmdMailMessageDetails: |
|
1626 |
case EESMRCmdForwardAsMeeting: // Fall through |
|
1627 |
case EESMRCmdForwardAsMail: |
|
1628 |
{ |
|
1629 |
queryAvailable = EFalse; |
|
1630 |
break; |
|
1631 |
} |
|
1632 |
case EAknSoftkeyClose: |
|
1633 |
{ |
|
1634 |
queryAvailable = EFalse; |
|
1635 |
break; |
|
1636 |
} |
|
1637 |
default: |
|
1638 |
break; |
|
1639 |
} |
|
1640 |
||
1641 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1642 |
||
1643 |
if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) |
|
1644 |
{ |
|
1645 |
// Static cast is safe here. We know for sure that entry is MR |
|
1646 |
MESMRMeetingRequestEntry* mrEntry = |
|
1647 |
static_cast<MESMRMeetingRequestEntry*>( calEntry ); |
|
1648 |
||
1649 |
// Restore the status pane layout |
|
1650 |
CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane(); |
|
1651 |
sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL); |
|
1652 |
||
1653 |
if ( mrEntry->IsOpenedFromMail() ) |
|
1654 |
{ |
|
1655 |
||
1656 |
||
1657 |
if( queryAvailable && |
|
1658 |
EESMRRoleOrganizer != mrEntry->RoleL() && |
|
1659 |
( mrEntry->IsMeetingCancelledL() || |
|
1660 |
mrEntry->IsEntryOutOfDateL() || |
|
1661 |
mrEntry->OccursInPastL() ) && |
|
1662 |
EESMRAttendeeStatusDecline != mrEntry->AttendeeStatusL() && |
|
1663 |
CESMRConfirmationQuery::ExecuteL( CESMRConfirmationQuery::EESMRRemoveAppointment) ) |
|
1664 |
{ |
|
1665 |
deleteEntry = ETrue; |
|
1666 |
} |
|
1667 |
} |
|
1668 |
} |
|
1669 |
||
1670 |
if ( deleteEntry ) |
|
1671 |
{ |
|
1672 |
iView->ExternalizeL(); |
|
1673 |
TInt res = iCallback.ProcessCommandWithResultL( EESMRCmdRemoveFromCalendar ); |
|
1674 |
if ( res == KErrCancel ) |
|
1675 |
{ |
|
1676 |
return EFalse; |
|
1677 |
} |
|
1678 |
} |
|
1679 |
||
1680 |
if ( EESMRCmdRemoveFromCalendar == aCommand ) |
|
1681 |
{ |
|
1682 |
return deleteEntry; |
|
1683 |
} |
|
1684 |
||
1685 |
return ETrue; |
|
1686 |
} |
|
1687 |
||
1688 |
// --------------------------------------------------------------------------- |
|
1689 |
// CESMRViewerDialog::HandleForwardMenuL |
|
1690 |
// --------------------------------------------------------------------------- |
|
1691 |
// |
|
1692 |
void CESMRViewerDialog::HandleForwardMenuL( |
|
1693 |
TInt /*aResourceId*/, |
|
1694 |
CEikMenuPane* aMenuPane ) |
|
1695 |
{ |
|
1696 |
FUNC_LOG; |
|
1697 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1698 |
if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) |
|
1699 |
{ |
|
1700 |
// Because this is MR entry, it is safe to cast it. |
|
1701 |
MESMRMeetingRequestEntry* mrEntry = |
|
1702 |
(MESMRMeetingRequestEntry*)( calEntry ); |
|
1703 |
||
1704 |
__ASSERT_DEBUG( mrEntry, Panic( EESMRViewerDlgInvalidEntry) ); |
|
1705 |
||
1706 |
TBool mrOriginatingEnabled( EFalse ); |
|
1707 |
TESMRMailPlugin currentPlugin = mrEntry->CurrentPluginL(); |
|
1708 |
||
1709 |
if ( EESMRIntelliSync == currentPlugin ) |
|
1710 |
{ |
|
1711 |
mrOriginatingEnabled = EFalse; |
|
1712 |
} |
|
1713 |
else if ( mrEntry->IsOpenedFromMail() ) |
|
1714 |
{ |
|
1715 |
// When opened from email, we need to make sure that |
|
1716 |
// meeting request sending is possible |
|
1717 |
CESMRFieldBuilderInterface* plugin = NULL; |
|
1718 |
TRAPD( error, plugin = |
|
1719 |
CESMRFieldBuilderInterface::CreatePluginL( |
|
1720 |
TUid::Uid(KESMRUIFieldBuilderPluginImplUId)) ); |
|
1721 |
||
1722 |
CleanupDeletePushL( plugin ); |
|
1723 |
||
1724 |
if (error == KErrNone && plugin) |
|
1725 |
{ |
|
1726 |
TUid uid = {0}; |
|
1727 |
MESMRBuilderExtension* extension = |
|
1728 |
static_cast<MESMRBuilderExtension*>( |
|
1729 |
plugin->ExtensionL(uid) ); |
|
1730 |
||
1731 |
if (extension) |
|
1732 |
{ |
|
1733 |
mrOriginatingEnabled = |
|
1734 |
extension->MRCanBeOriginateedL(); |
|
1735 |
} |
|
1736 |
} |
|
1737 |
CleanupStack::PopAndDestroy( plugin ); |
|
1738 |
plugin = NULL; |
|
1739 |
} |
|
1740 |
else |
|
1741 |
{ |
|
1742 |
mrOriginatingEnabled = ETrue; |
|
1743 |
} |
|
1744 |
||
1745 |
aMenuPane->SetItemDimmed( |
|
1746 |
EESMRCmdForwardAsMeeting, |
|
1747 |
!mrOriginatingEnabled ); |
|
1748 |
} |
|
1749 |
} |
|
1750 |
||
1751 |
// --------------------------------------------------------------------------- |
|
1752 |
// CESMRViewerDialog::LocationPluginHandlerL |
|
1753 |
// --------------------------------------------------------------------------- |
|
1754 |
// |
|
1755 |
CESMRLocationPluginHandler& CESMRViewerDialog::LocationPluginHandlerL() |
|
1756 |
{ |
|
1757 |
FUNC_LOG; |
|
1758 |
if ( !iLocationPluginHandler ) |
|
1759 |
{ |
|
1760 |
iLocationPluginHandler = CESMRLocationPluginHandler::NewL( *this ); |
|
1761 |
} |
|
1762 |
||
1763 |
return *iLocationPluginHandler; |
|
1764 |
} |
|
1765 |
||
1766 |
// --------------------------------------------------------------------------- |
|
1767 |
// CESMRViewerDialog::HandleFieldEventL |
|
1768 |
// --------------------------------------------------------------------------- |
|
1769 |
// |
|
1770 |
void CESMRViewerDialog::HandleFieldEventL( const MESMRFieldEvent& aEvent ) |
|
1771 |
{ |
|
1772 |
FUNC_LOG; |
|
1773 |
||
1774 |
MESMRFieldEvent::TEventType type( aEvent.Type() ); |
|
1775 |
||
1776 |
if ( MESMRFieldEvent::EESMRFieldCommandEvent == type ) |
|
1777 |
{ |
|
1778 |
ProcessCommandEventL( aEvent ); |
|
1779 |
} |
|
1780 |
else if ( MESMRFieldEvent::EESMRFieldChangeEvent == type ) |
|
1781 |
{ |
|
1782 |
ProcessFieldEventL( aEvent ); |
|
1783 |
} |
|
1784 |
} |
|
1785 |
||
1786 |
// --------------------------------------------------------------------------- |
|
1787 |
// CESMRViewerDialog::SetDefaultMiddleSoftKeyL |
|
1788 |
// --------------------------------------------------------------------------- |
|
1789 |
// |
|
1790 |
void CESMRViewerDialog::SetDefaultMiddleSoftKeyL() |
|
1791 |
{ |
|
1792 |
FUNC_LOG; |
|
1793 |
TInt resourceId = KErrNotFound; |
|
1794 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1795 |
const CESMRPolicy& currentPolicy( |
|
1796 |
iInfoProvider.PolicyProvider().CurrentPolicy() ); |
|
1797 |
||
1798 |
if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) |
|
1799 |
{ |
|
1800 |
// If 'Edit' command is not allowed then we change the MSK to 'Select' |
|
1801 |
if ( !currentPolicy.IsDefaultCommand( EESMRCmdEdit ) ) |
|
1802 |
{ |
|
1803 |
resourceId = R_MR_SELECT_SOFTKEY; |
|
1804 |
// Disable middle softkey by default |
|
1805 |
// Focused field enables it if MSK has select functionality |
|
1806 |
ButtonGroupContainer().MakeCommandVisibleByPosition( |
|
1807 |
CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
1808 |
EFalse ); |
|
1809 |
} |
|
1810 |
else |
|
1811 |
{ |
|
1812 |
resourceId = R_MR_EDIT_SOFTKEY; |
|
1813 |
} |
|
1814 |
||
1815 |
} |
|
1816 |
else if ( currentPolicy.IsDefaultCommand( EESMRCmdCalEntryUIEdit ) ) |
|
1817 |
{ |
|
1818 |
// Set correct edit command in MSK. Dialog resource has EESMRCmdEdit |
|
1819 |
resourceId = R_MR_CAL_EDIT_SOFTKEY; |
|
1820 |
} |
|
1821 |
||
1822 |
if ( resourceId != KErrNotFound ) |
|
1823 |
{ |
|
1824 |
ButtonGroupContainer().SetCommandL( |
|
1825 |
CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
1826 |
resourceId ); |
|
1827 |
} |
|
1828 |
} |
|
1829 |
||
1830 |
// ----------------------------------------------------------------------------- |
|
1831 |
// CESMRViewerDialog::ShowContextMenuL |
|
1832 |
// ----------------------------------------------------------------------------- |
|
1833 |
// |
|
1834 |
void CESMRViewerDialog::ShowContextMenuL() |
|
1835 |
{ |
|
1836 |
FUNC_LOG; |
|
1837 |
||
1838 |
if ( iMenuBar ) |
|
1839 |
{ |
|
1840 |
iMenuBar->TryDisplayContextMenuBarL(); |
|
1841 |
} |
|
1842 |
} |
|
1843 |
||
1844 |
// --------------------------------------------------------------------------- |
|
1845 |
// CESMRViewerDialog::HandleNaviArrowEventL |
|
1846 |
// --------------------------------------------------------------------------- |
|
1847 |
// |
|
1848 |
void CESMRViewerDialog::HandleNaviArrowEventL( const TInt aCommand ) |
|
1849 |
{ |
|
1850 |
FUNC_LOG; |
|
1851 |
ProcessCommandL( aCommand ); |
|
1852 |
} |
|
1853 |
||
1854 |
// --------------------------------------------------------------------------- |
|
1855 |
// CESMRViewerDialog::UserWantToHandleAttachmentsL |
|
1856 |
// --------------------------------------------------------------------------- |
|
1857 |
// |
|
1858 |
TBool CESMRViewerDialog::UserWantToHandleAttachmentsL() |
|
1859 |
{ |
|
1860 |
TBool retValue( EFalse ); |
|
1861 |
||
1862 |
MESMRCalEntry* calEntry = iInfoProvider.EntryL(); |
|
1863 |
MESMRMeetingRequestEntry* mrEntry = NULL; |
|
1864 |
if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) |
|
1865 |
{ |
|
1866 |
// This is meeting request |
|
1867 |
mrEntry = static_cast<MESMRMeetingRequestEntry*>( calEntry ); |
|
1868 |
||
1869 |
TBool openedFromEmail( mrEntry->IsOpenedFromMail() ); |
|
1870 |
||
1871 |
// If entry is opened from mail, contains remote attachments and |
|
1872 |
// mailbox is MfE, we show the query. |
|
1873 |
if ( openedFromEmail && mrEntry->ContainsRemoteAttachmentsL() && |
|
1874 |
mrEntry->CurrentPluginL() == EESMRActiveSync ) |
|
1875 |
{ |
|
1876 |
retValue = |
|
1877 |
CESMRConfirmationQuery::ExecuteL( |
|
1878 |
CESMRConfirmationQuery::EESMRAttachments ); |
|
1879 |
} |
|
1880 |
} |
|
1881 |
||
1882 |
return retValue; |
|
1883 |
} |
|
1884 |
||
1885 |
// --------------------------------------------------------------------------- |
|
1886 |
// CESMRViewerDialog::InitLocationMenuL |
|
1887 |
// --------------------------------------------------------------------------- |
|
1888 |
// |
|
1889 |
void CESMRViewerDialog::InitLocationMenuL( CEikMenuPane* aMenuPane ) |
|
1890 |
{ |
|
1891 |
FUNC_LOG; |
|
1892 |
||
1893 |
aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap,ETrue ); |
|
1894 |
aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, ETrue ); |
|
1895 |
} |
|
1896 |
||
1897 |
// --------------------------------------------------------------------------- |
|
1898 |
// CESMRViewerDialog::ConstructToolbarL |
|
1899 |
// --------------------------------------------------------------------------- |
|
1900 |
// |
|
1901 |
void CESMRViewerDialog::ConstructToolbarL() |
|
1902 |
{ |
|
1903 |
FUNC_LOG; |
|
1904 |
if( iInfoProvider.EntryL()->Type() == |
|
1905 |
MESMRCalEntry::EESMRCalEntryMeetingRequest ) |
|
1906 |
{ |
|
1907 |
MESMRMeetingRequestEntry* entry = |
|
1908 |
static_cast<MESMRMeetingRequestEntry*>( |
|
1909 |
iInfoProvider.EntryL() ); |
|
1910 |
||
1911 |
if( !entry->OccursInPastL() && |
|
1912 |
!entry->IsEntryOutOfDateL() && |
|
1913 |
!entry->IsMeetingCancelledL() ) |
|
1914 |
{ |
|
1915 |
if ( entry->RoleL()== EESMRRoleRequiredAttendee || |
|
1916 |
entry->RoleL()== EESMRRoleOptionalAttendee ) |
|
1917 |
{ |
|
1918 |
TSize screenSize = |
|
1919 |
iEikonEnv->ScreenDevice()->SizeInPixels(); |
|
1920 |
||
1921 |
TBool isVGA( EFalse ); |
|
1922 |
if( ( screenSize.iHeight == KVGAOneSide || |
|
1923 |
screenSize.iWidth == KVGAOneSide ) && |
|
1924 |
( screenSize.iHeight == KVGAOtherSide || |
|
1925 |
screenSize.iWidth == KVGAOtherSide ) && |
|
1926 |
screenSize.iHeight != screenSize.iWidth ) |
|
1927 |
{ |
|
1928 |
isVGA = ETrue; |
|
1929 |
} |
|
1930 |
||
1931 |
// Toolbar is disabled in VGA mode |
|
1932 |
if( !isVGA ) |
|
1933 |
{ |
|
1934 |
// Toolbar is always shown in MR viewer when user |
|
1935 |
// is attendee |
|
1936 |
iToolbar->SetObserver( this ); |
|
1937 |
iToolbar->InitializeToolbarL( |
|
1938 |
CMRToolbar::EMRViewerAttendee ); |
|
1939 |
iToolbar->ShowToolbar( ETrue ); |
|
1940 |
||
1941 |
// Toolbar created, relayouting needed |
|
1942 |
SizeChanged(); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1943 |
// help the relayout of the viewer |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1944 |
iView->ListPane()->RecordFields(); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
1945 |
DrawDeferred(); |
64 | 1946 |
} |
1947 |
} |
|
1948 |
} |
|
1949 |
} |
|
1950 |
} |
|
1951 |
||
1952 |
// --------------------------------------------------------------------------- |
|
1953 |
// CESMRViewerDialog::ProcessCommandEventL |
|
1954 |
// --------------------------------------------------------------------------- |
|
1955 |
// |
|
1956 |
void CESMRViewerDialog::ProcessCommandEventL( const MESMRFieldEvent& aEvent ) |
|
1957 |
{ |
|
1958 |
FUNC_LOG; |
|
1959 |
||
1960 |
TInt* command = static_cast< TInt* >( aEvent.Param( 0 ) ); |
|
1961 |
||
1962 |
switch ( *command ) |
|
1963 |
{ |
|
1964 |
case EESMRCmdRestoreMiddleSoftKey: |
|
1965 |
{ |
|
1966 |
SetDefaultMiddleSoftKeyL(); |
|
1967 |
ButtonGroupContainer().DrawDeferred(); |
|
1968 |
break; |
|
1969 |
} |
|
1970 |
case EESMRCmdEdit: // Fall through |
|
1971 |
case EESMRCmdViewTrack: // Fall through |
|
1972 |
case EESMRCmdOpenAttachment:// Fall through |
|
1973 |
case EESMRCmdOpenAttachmentView:// Fall through |
|
1974 |
case EESMRCmdDownloadAttachment: // Fall through |
|
1975 |
case EESMRCmdDownloadAllAttachments: // Fall through |
|
1976 |
case EESMRCmdSaveAttachment: // Fall through |
|
1977 |
case EESMRCmdSaveAllAttachments: // Fall through |
|
1978 |
case EESMRCmdMskOpenEmailAttachment: // Fall through |
|
1979 |
case EESMRCmdSearchFromMap: // Fall through |
|
1980 |
case EESMRCmdShowOnMap: |
|
1981 |
case EMRCmdHideAttachmentIndicator: |
|
1982 |
{ |
|
1983 |
ProcessCommandL( *command ); |
|
1984 |
break; |
|
1985 |
} |
|
1986 |
case EMRLaunchAttachmentContextMenu: |
|
1987 |
case EAknSoftkeyContextOptions: |
|
1988 |
{ |
|
1989 |
SetContextMenu(); |
|
1990 |
ShowContextMenuL(); |
|
1991 |
break; |
|
1992 |
} |
|
1993 |
case EESMRCmdAcceptMR: |
|
1994 |
case EESMRCmdTentativeMR: |
|
1995 |
case EESMRCmdDeclineMR: |
|
1996 |
case EESMRCmdRemoveFromCalendar: |
|
1997 |
{ |
|
1998 |
ProcessCommandL( *command ); |
|
1999 |
} |
|
2000 |
break; |
|
2001 |
default: |
|
2002 |
{ |
|
2003 |
break; |
|
2004 |
} |
|
2005 |
} |
|
2006 |
} |
|
2007 |
||
2008 |
// --------------------------------------------------------------------------- |
|
2009 |
// CESMRViewerDialog::ProcessFieldEventL |
|
2010 |
// --------------------------------------------------------------------------- |
|
2011 |
// |
|
2012 |
void CESMRViewerDialog::ProcessFieldEventL( const MESMRFieldEvent& aEvent ) |
|
2013 |
{ |
|
2014 |
FUNC_LOG; |
|
2015 |
iView->ProcessEventL( aEvent ); |
|
2016 |
} |
|
2017 |
||
2018 |
// EOF |