14 * Description: For MonthView of the Calendar application. |
14 * Description: For MonthView of the Calendar application. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 //debug |
19 |
20 #include "calendarui_debug.h" |
20 |
21 |
21 #include <Calendar.rsg> |
22 // INCLUDE FILES |
|
23 #include "calenmonthcontainer.h" |
|
24 #include "calencontroller.h" |
|
25 #include "calencontainerlayoutmanager.h" |
|
26 |
|
27 #include <calenconstants.h> |
22 #include <calenconstants.h> |
28 #include <calendateutils.h> |
23 #include <calendateutils.h> |
29 #include "calendrawutils.h" |
|
30 #include "calenmonthconst.h" |
|
31 #include "calenmonthgrid.h" |
|
32 #include "calenmonthview.h" |
|
33 #include "calenpreview.h" |
|
34 #include <calenagendautils.h> |
24 #include <calenagendautils.h> |
35 #include "CalenUid.h" |
|
36 #include "CleanupResetAndDestroy.h" |
|
37 #include "CalenUid.h" |
|
38 #include "calendar.hrh" |
|
39 #include <calendar.mbg> |
25 #include <calendar.mbg> |
40 #include <Calendar.rsg> |
|
41 #include <csxhelp/cale.hlp.hrh> |
26 #include <csxhelp/cale.hlp.hrh> |
42 #include <calencontext.h> |
27 #include <calencontext.h> |
43 #include <aknlists.h> |
28 #include <aknlists.h> |
44 #include <akntoolbar.h> |
29 #include <akntoolbar.h> |
45 #include <gulicon.h> |
30 #include <gulicon.h> |
47 #include <AknsFrameBackgroundControlContext.h> |
32 #include <AknsFrameBackgroundControlContext.h> |
48 #include <calinstance.h> |
33 #include <calinstance.h> |
49 #include <calinstanceview.h> |
34 #include <calinstanceview.h> |
50 #include <calenservices.h> |
35 #include <calenservices.h> |
51 #include <calenviewutils.h> |
36 #include <calenviewutils.h> |
52 |
|
53 |
|
54 // Layouts |
37 // Layouts |
55 #include <aknlayoutscalable_apps.cdl.h> |
38 #include <aknlayoutscalable_apps.cdl.h> |
56 |
39 #include <gesturehelper.h> //CGestureHelper |
|
40 |
|
41 // INCLUDE FILES |
|
42 #include "calenmonthcontainer.h" |
|
43 #include "calencontroller.h" |
|
44 #include "calencontainerlayoutmanager.h" |
|
45 #include "calendrawutils.h" |
|
46 #include "calenmonthconst.h" |
|
47 #include "calenmonthgrid.h" |
|
48 #include "calenmonthview.h" |
|
49 #include "calenpreview.h" |
|
50 #include "CalenUid.h" |
|
51 #include "CleanupResetAndDestroy.h" |
|
52 #include "CalenUid.h" |
|
53 #include "calendar.hrh" |
|
54 //debug |
|
55 #include "calendarui_debug.h" |
57 |
56 |
58 // LOCAL CONSTANTS AND MACROS |
57 // LOCAL CONSTANTS AND MACROS |
59 _LIT(KMonthCellFormat, "%F%*D\t"); |
58 _LIT(KMonthCellFormat, "%F%*D\t"); |
60 |
59 |
61 |
60 |
1092 iGrid->ItemDrawer()->FormattedCellData()->SetIconArray(NULL); |
1092 iGrid->ItemDrawer()->FormattedCellData()->SetIconArray(NULL); |
1093 } |
1093 } |
1094 |
1094 |
1095 iGrid->ItemDrawer()->FormattedCellData()->SetIconArray( CreateIconsL( iIconIndices )); |
1095 iGrid->ItemDrawer()->FormattedCellData()->SetIconArray( CreateIconsL( iIconIndices )); |
1096 iGrid->View()->SetDisableRedraw(ETrue); |
1096 iGrid->View()->SetDisableRedraw(ETrue); |
|
1097 |
|
1098 |
|
1099 iGestureControl = GestureHelper::CGestureHelper::NewL( *this ); |
|
1100 iGestureControl->SetDoubleTapEnabled( EFalse ); |
|
1101 iGestureControl->SetHoldingEnabled( EFalse ); |
|
1102 |
1097 |
1103 |
1098 PIM_TRAPD_HANDLE( ConstructBackgroundContextL() ); |
1104 PIM_TRAPD_HANDLE( ConstructBackgroundContextL() ); |
1099 |
1105 |
1100 TRACE_EXIT_POINT; |
1106 TRACE_EXIT_POINT; |
1101 } |
1107 } |
1220 CCalenSetting* setting(NULL); |
1226 CCalenSetting* setting(NULL); |
1221 setting = CCalenSetting::InstanceL(); |
1227 setting = CCalenSetting::InstanceL(); |
1222 |
1228 |
1223 CleanupReleasePushL( *setting ) ; |
1229 CleanupReleasePushL( *setting ) ; |
1224 |
1230 |
1225 if( setting->WeekFormat() == EMonday ) |
1231 if( setting->WeekFormat() == EMonday && setting->WeekNumberEnable() ) |
1226 { |
1232 { |
1227 useWeeks = ETrue; |
1233 useWeeks = ETrue; |
1228 } |
1234 } |
1229 CleanupStack::PopAndDestroy( setting ); |
1235 CleanupStack::PopAndDestroy( setting ); |
1230 } |
1236 } |
1682 } |
1688 } |
1683 CAknGridM* gridModel = static_cast<CAknGridM*>(iGrid->Model()); |
1689 CAknGridM* gridModel = static_cast<CAknGridM*>(iGrid->Model()); |
1684 |
1690 |
1685 if(gridModel->NumberOfData() <= 0) |
1691 if(gridModel->NumberOfData() <= 0) |
1686 return; |
1692 return; |
|
1693 |
|
1694 if ( iGestureControl ) |
|
1695 { |
|
1696 iGestureControl->HandlePointerEventL( aPointerEvent ); |
|
1697 if ( iGestureHandled ) |
|
1698 { |
|
1699 TRACE_EXIT_POINT; |
|
1700 return; |
|
1701 } |
|
1702 } |
1687 |
1703 |
1688 if(isItem == EFalse) |
1704 if(isItem == EFalse) |
1689 /* Handle pointer event in week number area */ |
1705 /* Handle pointer event in week number area */ |
1690 { |
1706 { |
1691 switch(aPointerEvent.iType) |
1707 switch(aPointerEvent.iType) |
1806 { |
1822 { |
1807 switch ( aEventType ) |
1823 switch ( aEventType ) |
1808 { |
1824 { |
1809 case ( MEikListBoxObserver::EEventItemClicked ): |
1825 case ( MEikListBoxObserver::EEventItemClicked ): |
1810 { |
1826 { |
1811 if ( !iView->MenuBar()->IsDisplayed() ) |
1827 if ( !iView->MenuBar()->IsDisplayed() && !iGestureHandled ) |
1812 { |
1828 { |
1813 iServices.IssueCommandL( ECalenForwardsToDayView ); |
1829 iServices.IssueCommandL( ECalenForwardsToDayView ); |
1814 } |
1830 } |
1815 break; |
1831 break; |
1816 } |
1832 } |
1817 } |
1833 } |
1818 } |
1834 } |
1819 |
1835 |
|
1836 // ---------------------------------------------------------------------------- |
|
1837 // CCalenMonthContainer::HandleGestureL |
|
1838 // |
|
1839 // ---------------------------------------------------------------------------- |
|
1840 void CCalenMonthContainer::HandleGestureL( const GestureHelper::MGestureEvent& aEvent ) |
|
1841 { |
|
1842 GestureHelper::TGestureCode code = aEvent.Code( GestureHelper::MGestureEvent::EAxisBoth ); |
|
1843 |
|
1844 switch ( code ) |
|
1845 { |
|
1846 case GestureHelper::EGestureStart: |
|
1847 { |
|
1848 iGestureHandled = EFalse; |
|
1849 break; |
|
1850 } |
|
1851 case GestureHelper::EGestureSwipeRight: |
|
1852 { |
|
1853 if(!iChangeMonth) |
|
1854 { |
|
1855 HandleNaviDecoratorEventL( EAknNaviDecoratorEventLeftTabArrow ); |
|
1856 } |
|
1857 |
|
1858 iGestureHandled = ETrue; |
|
1859 break; |
|
1860 } |
|
1861 case GestureHelper::EGestureSwipeLeft: |
|
1862 { |
|
1863 if(!iChangeMonth) |
|
1864 { |
|
1865 HandleNaviDecoratorEventL( EAknNaviDecoratorEventRightTabArrow ); |
|
1866 } |
|
1867 iGestureHandled = ETrue; |
|
1868 break; |
|
1869 } |
|
1870 default: |
|
1871 // Other gestures are not handled here |
|
1872 break; |
|
1873 } |
|
1874 } |
1820 |
1875 |
1821 // ---------------------------------------------------------------------------- |
1876 // ---------------------------------------------------------------------------- |
1822 // CCalenMonthContainer::HidePopup |
1877 // CCalenMonthContainer::HidePopup |
1823 // ---------------------------------------------------------------------------- |
1878 // ---------------------------------------------------------------------------- |
1824 void CCalenMonthContainer::HidePopup() |
1879 void CCalenMonthContainer::HidePopup() |