|
1 /* |
|
2 * Copyright (c) 2002 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: The model part of popup. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CALENPREVIEW_H |
|
21 #define CALENPREVIEW_H |
|
22 |
|
23 #include "CalendarVariant.hrh" |
|
24 |
|
25 // INCLUDES |
|
26 #include <AknUtils.h> |
|
27 #include <e32std.h> // RPointerArray |
|
28 #include <coecntrl.h> |
|
29 |
|
30 #include "calenpreviewentryobserver.h" |
|
31 #include <AknPreviewPopUpObserver.h> |
|
32 #include <AknPreviewPopUpContentProvider.h> |
|
33 #include <AknPictographDrawerInterface.h> |
|
34 #include <aknlongtapdetector.h> |
|
35 #include <calentry.h> |
|
36 #include <mcalenpreview.h> |
|
37 #include "calenpreviewlabel.h" |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CEikLabel; |
|
41 class CGulIcon; |
|
42 class CCalenGlobalData; |
|
43 class CAknIconArray; |
|
44 |
|
45 class CCalEntry; |
|
46 class CCalenView; |
|
47 class CCalenState; |
|
48 class CCalInstance; |
|
49 |
|
50 class CAknPreviewPopUpController; |
|
51 class CAknPictographInterface; |
|
52 |
|
53 class TCalenInstanceId; |
|
54 |
|
55 class MCalenPreviewEntryObserver; |
|
56 class MAknPreviewPopUpObserver; |
|
57 class MAknPreviewPopUpContentProvider; |
|
58 class MAknPictographAnimatorCallBack; |
|
59 class MAknLongTapDetectorCallBack; |
|
60 class CAknLongTapDetector; |
|
61 |
|
62 class CCalenPreviewLayoutManager; |
|
63 class CCalenPreviewEntry; |
|
64 class CCalenPreviewData; |
|
65 class CCalenPreviewLabel; |
|
66 class CCalenPreviewTimer; |
|
67 class MCalenServices; |
|
68 class CAknStylusPopUpMenu; |
|
69 |
|
70 |
|
71 NONSHARABLE_CLASS( CCalenPreview ) : |
|
72 public CCoeControl, |
|
73 public MCalenPreview, |
|
74 public MAknPreviewPopUpObserver, |
|
75 public MAknPreviewPopUpContentProvider, |
|
76 public MAknPictographAnimatorCallBack, |
|
77 public MCalenPreviewEntryObserver, |
|
78 public MAknLongTapDetectorCallBack |
|
79 |
|
80 { |
|
81 public: |
|
82 static CCalenPreview* NewL( CCalenView* aCommandHandler, |
|
83 TLocale& aLocale, MCalenServices& aServices ); |
|
84 virtual ~CCalenPreview(); |
|
85 |
|
86 public: |
|
87 // from CCoeControl |
|
88 void Draw( const TRect& aRect) const; |
|
89 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
90 void HandleResourceChange( TInt aType ); |
|
91 TSize MinimumSize(); |
|
92 // from MAknPictographAnimatorCallBack |
|
93 void DrawPictographArea(); |
|
94 // from MAknLongTapDetectorCallBack |
|
95 void HandleLongTapEventL( const TPoint& aPenEventLocation, |
|
96 const TPoint& aPenEventScreenLocation ); |
|
97 // from MAknPreviewPopUpContentProvider |
|
98 void StartContentBuildingL(); |
|
99 void CancelContentBuilding(); |
|
100 // from MAknPreviewPopUpObserver |
|
101 void HandlePreviewPopUpEventL( CAknPreviewPopUpController* aController, |
|
102 TPreviewPopUpEvent aEvent ); |
|
103 // from MCalenPreviewEntryObserver |
|
104 void HandlePreviewEntryEventL( const TCalenInstanceId& aInstId, |
|
105 TPointerEvent::TType aType); |
|
106 |
|
107 public: |
|
108 // new functions |
|
109 //void Hide(); |
|
110 void HidePreview(); |
|
111 void ShowPreview(); |
|
112 TBool UsePreview(); |
|
113 TRect ReducePreview(TRect aRect); |
|
114 void CreateIconArrayL(); |
|
115 void AddPluginControlL(); |
|
116 CCoeControl* PluginControl(); |
|
117 |
|
118 public: // From MCalenPreview |
|
119 void Hide(); |
|
120 void FocusChangedL( const TTime& aTime ); |
|
121 void FocusChangedL( CCalInstance* aInstance ); |
|
122 |
|
123 private: |
|
124 void ConstructL(); |
|
125 CCalenPreview(CCalenView* aCommandHandler, |
|
126 TLocale& aLocale, MCalenServices& aServices); |
|
127 |
|
128 // new functions |
|
129 void UpdateTitleL(); |
|
130 |
|
131 void BuildWeekCellL(const TTime& aDay); |
|
132 void BuildMonthCellL(const TTime& aDay); |
|
133 void ResetComponents(); |
|
134 void InitComponentsL(); |
|
135 void SetLabelContentL(CCalenPreviewEntry* aEntry, TInt& aLabelIndex, |
|
136 TBool aShortLine); |
|
137 |
|
138 void SetPreviewContentL(const TTime& aDay); |
|
139 void SetTimerForNextExpiringEventL(); |
|
140 CGulIcon* GetIcon( CCalEntry::TType aType ); |
|
141 static TInt ExpiredCallBack(TAny* aPtr); |
|
142 CCalenPreviewLabel* CreateLabelL( CCalenPreviewLabel::TPreviewLabelType aType); |
|
143 |
|
144 |
|
145 private: // data |
|
146 TInt iFlags; |
|
147 TLocale iLocale; |
|
148 TInt iState; |
|
149 CCalenView* iView; |
|
150 CCalenPreviewData* iData; // own |
|
151 CCalenPreviewLabel* iTitle; |
|
152 TInt iPluginLabelCount; |
|
153 CCalenPreviewLayoutManager* iLayoutManager; |
|
154 CCalenGlobalData* iGlobalData; |
|
155 CAknPreviewPopUpController* iController; // own |
|
156 TTime iFocusedTime; |
|
157 CCalInstance* iFocusedInst; |
|
158 CGulIcon* iMoreIcon; // own |
|
159 RPointerArray<CGulIcon> iIcons; |
|
160 CAknLongTapDetector* iLongTapDetector; |
|
161 // Japanese Pictograph engine. |
|
162 CAknPictographInterface* iPictoInterface; // own |
|
163 CCalenPreviewTimer* iExpirationTimer; |
|
164 MCalenServices& iServices; |
|
165 CAknStylusPopUpMenu* iStylusPopup; |
|
166 public: |
|
167 CCoeControl* iPluginControl; |
|
168 |
|
169 }; |
|
170 |
|
171 #endif // CALENPREVIEW_H |