10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description : ESMR tracking view dialog |
14 * Description : ESMR tracking view dialog |
15 * Version : %version: tr1sido#9 % |
15 * Version : %version: e002sa33#15 % |
16 * |
16 * |
17 */ |
17 */ |
18 |
18 |
19 #include "emailtrace.h" |
19 #include "emailtrace.h" |
20 #include "cesmrtrackingviewdialog.h" |
20 #include "cesmrtrackingviewdialog.h" |
21 |
21 |
22 // SYSTEM INCLUDE |
22 // SYSTEM INCLUDE |
23 #include <AknUtils.h> |
23 #include <aknutils.h> |
24 #include <StringLoader.h> |
24 #include <stringloader.h> |
25 #include <calentry.h> |
25 #include <calentry.h> |
26 #include <AiwServiceHandler.h> |
26 #include <magnentryui.h> |
27 #include <featmgr.h> |
|
28 #include <bldvariant.hrh> |
|
29 //<cmail> |
27 //<cmail> |
30 #include <featmgr.h> |
|
31 //</cmail> |
|
32 |
|
33 #include "cesmrpolicy.h" |
28 #include "cesmrpolicy.h" |
34 //</cmail> |
29 //</cmail> |
35 #include <esmrgui.rsg> |
30 #include <esmrgui.rsg> |
36 |
31 |
37 #include "esmrgui.hrh" |
32 #include "esmrgui.hrh" |
38 #include "cesmrview.h" |
33 #include "cesmrtrackingview.h" |
39 #include "cesmrviewerfieldstorage.h" |
34 #include "cesmrviewerfieldstorage.h" |
40 #include "mesmrcalentry.h" |
35 #include "mesmrcalentry.h" |
41 #include "cesmrcontactmenuhandler.h" |
36 #include "cesmrcontactmenuhandler.h" |
42 #include "esmrconfig.hrh" |
37 #include "esmrconfig.hrh" |
43 #include "esmrinternaluid.h" |
38 #include "esmrinternaluid.h" |
65 // --------------------------------------------------------------------------- |
60 // --------------------------------------------------------------------------- |
66 // CESMRTrackingViewDialog::NewL |
61 // CESMRTrackingViewDialog::NewL |
67 // --------------------------------------------------------------------------- |
62 // --------------------------------------------------------------------------- |
68 // |
63 // |
69 CESMRTrackingViewDialog* CESMRTrackingViewDialog::NewL( |
64 CESMRTrackingViewDialog* CESMRTrackingViewDialog::NewL( |
70 CESMRPolicy* aPolicy, |
65 const CESMRPolicy& aPolicy, |
71 MESMRCalEntry& aEntry, |
66 MESMRCalEntry& aEntry, |
72 MAgnEntryUiCallback& aCallback ) |
67 MAgnEntryUiCallback& aCallback ) |
73 { |
68 { |
74 FUNC_LOG; |
69 FUNC_LOG; |
75 CESMRTrackingViewDialog* self = |
70 CESMRTrackingViewDialog* self = |
76 new (ELeave) CESMRTrackingViewDialog(aEntry,aCallback); |
71 new (ELeave) CESMRTrackingViewDialog( aPolicy, aEntry, aCallback); |
77 CleanupStack::PushL( self ); |
72 CleanupStack::PushL( self ); |
78 self->ConstructL( aPolicy ); |
73 self->ConstructL(); |
79 CleanupStack::Pop( self ); |
74 CleanupStack::Pop( self ); |
80 return self; |
75 return self; |
81 } |
76 } |
82 |
77 |
83 // --------------------------------------------------------------------------- |
78 // --------------------------------------------------------------------------- |
85 // --------------------------------------------------------------------------- |
80 // --------------------------------------------------------------------------- |
86 // |
81 // |
87 CESMRTrackingViewDialog::~CESMRTrackingViewDialog() |
82 CESMRTrackingViewDialog::~CESMRTrackingViewDialog() |
88 { |
83 { |
89 FUNC_LOG; |
84 FUNC_LOG; |
90 if ( iFeatureManagerInitialized ) |
85 |
91 { |
|
92 FeatureManager::UnInitializeLib(); |
|
93 } |
|
94 |
|
95 if ( iServiceHandler ) |
|
96 { |
|
97 iServiceHandler->DetachMenu(R_MR_TRACKING_VIEW_MENU, R_PS_AIW_INTEREST); |
|
98 delete iServiceHandler; |
|
99 } |
|
100 |
|
101 iESMRStatic.Close(); |
86 iESMRStatic.Close(); |
102 } |
87 } |
103 |
88 |
104 // --------------------------------------------------------------------------- |
89 // --------------------------------------------------------------------------- |
105 // CESMRTrackingViewDialog::CESMRTrackingViewDialog |
90 // CESMRTrackingViewDialog::CESMRTrackingViewDialog |
106 // --------------------------------------------------------------------------- |
91 // --------------------------------------------------------------------------- |
107 // |
92 // |
108 CESMRTrackingViewDialog::CESMRTrackingViewDialog( |
93 CESMRTrackingViewDialog::CESMRTrackingViewDialog( |
|
94 const CESMRPolicy& aPolicy, |
109 MESMRCalEntry& aEntry, |
95 MESMRCalEntry& aEntry, |
110 MAgnEntryUiCallback& aCallback) : |
96 MAgnEntryUiCallback& aCallback) : |
111 iEntry( aEntry ), |
97 iPolicy( aPolicy ), |
|
98 iEntry( aEntry ), |
112 iCallback(aCallback) |
99 iCallback(aCallback) |
113 { |
100 { |
114 FUNC_LOG; |
101 FUNC_LOG; |
115 // Do nothing |
102 // Do nothing |
116 } |
103 } |
117 |
104 |
118 // --------------------------------------------------------------------------- |
105 // --------------------------------------------------------------------------- |
119 // CESMRTrackingViewDialog::ConstructL |
106 // CESMRTrackingViewDialog::ConstructL |
120 // --------------------------------------------------------------------------- |
107 // --------------------------------------------------------------------------- |
121 // |
108 // |
122 void CESMRTrackingViewDialog::ConstructL(CESMRPolicy* aPolicy) |
109 void CESMRTrackingViewDialog::ConstructL() |
123 { |
110 { |
124 FUNC_LOG; |
111 FUNC_LOG; |
125 CAknDialog::ConstructL ( R_TRACKING_DIALOG_MENUBAR ); |
112 CAknDialog::ConstructL ( R_TRACKING_DIALOG_MENUBAR ); |
126 iPolicy = aPolicy; |
|
127 iESMRStatic.ConnectL(); |
113 iESMRStatic.ConnectL(); |
128 iESMRStatic.ContactMenuHandlerL().Reset(); |
114 iESMRStatic.ContactMenuHandlerL().Reset(); |
129 |
115 |
130 TRect clientRect; |
116 TRect clientRect; |
131 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, clientRect ); |
117 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, clientRect ); |
132 |
|
133 TBool responseReady(EFalse); |
|
134 |
|
135 FeatureManager::InitializeLibL(); |
|
136 iFeatureManagerInitialized = ETrue; |
|
137 |
|
138 // <cmail> remove custom feature KFeatureIdPrintingFrameworkCalendarPlugin |
|
139 // </cmail> |
|
140 |
118 |
141 // Sort the attendees list so that Req attendeees comes first |
119 // Sort the attendees list so that Req attendeees comes first |
142 // and then opt attendees |
120 // and then opt attendees |
143 SortAttendeesL(); |
121 SortAttendeesL(); |
144 |
122 |
145 // Set the index of builder to zero so that |
123 // Set the index of builder to zero so that |
146 // participant field is created from index. |
124 // participant field is created from index. |
147 |
125 |
148 iESMRStatic.SetCurrentFieldIndex(0); |
126 iESMRStatic.SetCurrentFieldIndex(0); |
149 |
127 |
150 CESMRViewerFieldStorage* storage = |
128 iView = CESMRTrackingView::NewL( iEntry, clientRect, |
151 CESMRViewerFieldStorage::NewL( |
129 CountAttendeesL(CCalAttendee::EReqParticipant), |
152 aPolicy, |
130 CountAttendeesL(CCalAttendee::EOptParticipant)); |
153 NULL, |
131 iView->SetParentDialog(this); |
154 responseReady, |
132 |
155 *this, |
|
156 CountAttendeesL(CCalAttendee::EReqParticipant), |
|
157 CountAttendeesL(CCalAttendee::EOptParticipant) ); |
|
158 |
|
159 CleanupStack::PushL( storage ); |
|
160 // storage ownership is transferred to CESMRView |
|
161 iView = CESMRView::NewL(storage, iEntry, clientRect ); |
|
162 CleanupStack::Pop( storage ); |
|
163 |
|
164 if ( iEntry.Entry().SummaryL().Length() == 0 ) |
133 if ( iEntry.Entry().SummaryL().Length() == 0 ) |
165 { |
134 { |
166 // if no title, set unnamed text: |
135 // if no title, set unnamed text: |
167 HBufC* title = StringLoader::LoadLC (R_QTN_MEET_REQ_CONFLICT_UNNAMED); |
136 HBufC* title = StringLoader::LoadLC (R_QTN_MEET_REQ_CONFLICT_UNNAMED); |
168 iView->SetTitleL( *title, ETrue ); |
137 iView->SetTitleL( *title ); |
169 CleanupStack::PopAndDestroy( title ); |
138 CleanupStack::PopAndDestroy( title ); |
170 } |
139 } |
171 else |
140 else |
172 { |
141 { |
173 iView->SetTitleL( iEntry.Entry().SummaryL(), ETrue ); |
142 iView->SetTitleL( iEntry.Entry().SummaryL() ); |
174 } |
143 } |
|
144 |
|
145 iMenuBar->SetContextMenuTitleResourceId( R_MR_TRACKING_VIEW_CONTEXT_MENU ); |
175 } |
146 } |
176 |
147 |
177 // --------------------------------------------------------------------------- |
148 // --------------------------------------------------------------------------- |
178 // CESMRTrackingViewDialog::CreateCustomControlL |
149 // CESMRTrackingViewDialog::CreateCustomControlL |
179 // --------------------------------------------------------------------------- |
150 // --------------------------------------------------------------------------- |
380 void CESMRTrackingViewDialog::DynInitMenuPaneL( |
340 void CESMRTrackingViewDialog::DynInitMenuPaneL( |
381 TInt aResourceId, |
341 TInt aResourceId, |
382 CEikMenuPane* aMenuPane ) |
342 CEikMenuPane* aMenuPane ) |
383 { |
343 { |
384 FUNC_LOG; |
344 FUNC_LOG; |
385 if ( iServiceHandler ) |
|
386 { |
|
387 if ( iServiceHandler->HandleSubmenuL ( *aMenuPane ) ) |
|
388 { |
|
389 return; |
|
390 } |
|
391 } |
|
392 if ( aResourceId == R_ACTION_MENU ) |
345 if ( aResourceId == R_ACTION_MENU ) |
393 { |
346 { |
394 iESMRStatic.ContactMenuHandlerL().InitOptionsMenuL( aMenuPane ); |
347 iESMRStatic.ContactMenuHandlerL().InitOptionsMenuL( aMenuPane ); |
395 } |
348 } |
396 |
349 |
397 if ( aResourceId == R_MR_TRACKING_VIEW_MENU ) |
350 if ( aResourceId == R_MR_TRACKING_VIEW_MENU ) |
398 { |
351 { |
399 if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) |
352 aMenuPane->SetItemDimmed( EESMRCmdActionMenu, |
400 { |
|
401 // remove help support in pf5250 |
|
402 aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); |
|
403 } |
|
404 |
|
405 // <cmail> remove custom feature KFeatureIdPrintingFrameworkCalendarPlugin |
|
406 // </cmail> |
|
407 aMenuPane->SetItemDimmed( EESMRCmdPrint, ETrue ); |
|
408 |
|
409 aMenuPane->SetItemDimmed( EESMRCmdActionMenu, |
|
410 !iESMRStatic.ContactMenuHandlerL().OptionsMenuAvailable() ); |
353 !iESMRStatic.ContactMenuHandlerL().OptionsMenuAvailable() ); |
411 } |
354 } |
412 } |
355 } |
413 |
356 |
414 // --------------------------------------------------------------------------- |
357 // --------------------------------------------------------------------------- |
431 FUNC_LOG; |
374 FUNC_LOG; |
432 return ExecuteLD( R_MRTRACKING_DIALOG ); |
375 return ExecuteLD( R_MRTRACKING_DIALOG ); |
433 } |
376 } |
434 |
377 |
435 // --------------------------------------------------------------------------- |
378 // --------------------------------------------------------------------------- |
436 // CESMRTrackingViewDialog::HandlePrintCommandL |
|
437 // --------------------------------------------------------------------------- |
|
438 // |
|
439 void CESMRTrackingViewDialog::HandlePrintCommandL(TInt aCommand) |
|
440 { |
|
441 FUNC_LOG; |
|
442 CAiwGenericParamList& inParams = iServiceHandler->InParamListL(); |
|
443 |
|
444 // Param date |
|
445 |
|
446 TCalTime startTime = iEntry.Entry().StartTimeL(); |
|
447 |
|
448 TAiwGenericParam dateParam( EGenericParamDateTime ); |
|
449 TTime activeDay = startTime.TimeUtcL(); |
|
450 |
|
451 TAiwGenericParam calendarParam( EGenericParamCalendarItem ); |
|
452 calendarParam.Value().Set( TUid::Uid(iEntry.Entry().LocalUidL()) ); |
|
453 inParams.AppendL( calendarParam ); |
|
454 |
|
455 // Append date param |
|
456 dateParam.Value().Set( activeDay ); |
|
457 inParams.AppendL( dateParam ); |
|
458 |
|
459 const TUid uid( TUid::Uid( KUidCalendarApplication ) ); |
|
460 TAiwGenericParam uidParam( EGenericParamApplication ); |
|
461 uidParam.Value().Set( uid ); |
|
462 inParams.AppendL( uidParam ); |
|
463 |
|
464 // Execute service command with given parameters |
|
465 iServiceHandler->ExecuteMenuCmdL( aCommand, |
|
466 inParams, |
|
467 iServiceHandler->OutParamListL(), |
|
468 0, |
|
469 NULL ); |
|
470 |
|
471 } |
|
472 |
|
473 // --------------------------------------------------------------------------- |
|
474 // CESMRTrackingViewDialog::HandleFieldEventL |
379 // CESMRTrackingViewDialog::HandleFieldEventL |
475 // --------------------------------------------------------------------------- |
380 // --------------------------------------------------------------------------- |
476 // |
381 |
477 void CESMRTrackingViewDialog::HandleFieldEventL( |
382 void CESMRTrackingViewDialog::HandleListEventL() |
478 const MESMRFieldEvent& /*aEvent*/ ) |
383 { |
479 { |
384 FUNC_LOG; |
480 FUNC_LOG; |
385 iMenuBar->TryDisplayContextMenuBarL(); |
481 // From MESMRFieldEventObserver. Do nothing |
|
482 } |
386 } |
483 |
387 |
484 // End of File |
388 // End of File |
485 |
389 |