|
1 /* |
|
2 * Copyright (c) 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CALFEXMONTH_H_ |
|
21 #define CALFEXMONTH_H_ |
|
22 |
|
23 #include <alf/alfcontrol.h> |
|
24 |
|
25 #include "alfexcalendarengineeventtimer.h" |
|
26 |
|
27 // forward declarations |
|
28 class CAlfGridLayout; |
|
29 class CAlfTextVisual; |
|
30 class CAlfExCalendarDeckControl; |
|
31 class CAlfBorderBrush; |
|
32 class CAlfShadowBorderBrush; |
|
33 class CAlfGradientBrush; |
|
34 class CAlfImageBrush; |
|
35 class MAlfBitmapProvider; |
|
36 |
|
37 // Constants declarations |
|
38 const TRgb KWeekDayColor = TRgb( 0xff8844 ); // BGR value |
|
39 const TRgb KWeekendDayColor = TRgb( 0x7f7fff ); |
|
40 const TRgb KFocusedDayColor = TRgb( 0x0000ff ); |
|
41 const TRgb KWeekNumberColor = TRgb( 0x88ffff ); // |
|
42 |
|
43 |
|
44 // CAlfExCalendarMonth class declaration |
|
45 class CAlfExCalendarMonth : |
|
46 public CAlfControl, |
|
47 public MAlfExCalendarEngineEventTimerObserver |
|
48 { |
|
49 |
|
50 public: // methods |
|
51 |
|
52 /** |
|
53 * 2 phase constructor. A static factory method. |
|
54 * @param aParentLayout |
|
55 * @param aDateTime |
|
56 * @param aEnv |
|
57 * @param aCalendarControl |
|
58 * @return |
|
59 */ |
|
60 static CAlfExCalendarMonth* NewLC( |
|
61 CAlfLayout* aParentLayout, |
|
62 TDateTime aDateTime, |
|
63 CAlfEnv& aEnv, |
|
64 CAlfExCalendarDeckControl& aCalendarControl ); |
|
65 |
|
66 virtual ~CAlfExCalendarMonth(); |
|
67 |
|
68 TBool OfferEventL( const TAlfEvent& aEvent ); |
|
69 |
|
70 void UpdateMonthL( TDateTime aDateTime ); |
|
71 |
|
72 void MonthFocusedL(); |
|
73 |
|
74 |
|
75 private: // methods |
|
76 |
|
77 CAlfExCalendarMonth( |
|
78 CAlfExCalendarDeckControl& aCalendarControl, |
|
79 CAlfEnv& aEnv, |
|
80 TDateTime aDateTime ); |
|
81 |
|
82 void ConstructL( CAlfLayout* aParentLayout ); |
|
83 |
|
84 void SetWeekDayNameL( |
|
85 const TDesC& aDayName, |
|
86 CAlfGridLayout* aGrid, |
|
87 TInt aDayIndex, |
|
88 TRgb aColor = KWeekDayColor ); |
|
89 |
|
90 void AddDateVisualsL( CAlfGridLayout* aGrid ); |
|
91 |
|
92 TInt SetDatesL( CAlfGridLayout* aGrid, TTime aTime ); |
|
93 |
|
94 void SetDateNumberL( |
|
95 CAlfGridLayout* aGrid, |
|
96 TInt aVisualIndex, |
|
97 TInt aDayNumber, |
|
98 TInt aDateTextStyle, |
|
99 TRgb aColor = KWeekDayColor ); |
|
100 |
|
101 void SetWeekNumberL( |
|
102 CAlfGridLayout* aGrid, |
|
103 TInt aVisualIndex, |
|
104 TInt aDayNumber, |
|
105 TInt aWeekTextStyle ); |
|
106 |
|
107 void ClearDayVisualL( |
|
108 CAlfGridLayout* aGrid, |
|
109 TInt aVisualIndex ); |
|
110 |
|
111 void UpdateDaysWithCalEventsL(); |
|
112 |
|
113 void RemoveAllDayBrushesL(); |
|
114 |
|
115 void MoveDayFocusL( TInt aChange ); |
|
116 |
|
117 void SetMonthBackgroundL( CAlfVisual* aVisual, TRgb aColor = KRgbGray ); |
|
118 |
|
119 void SetMonthTitleTextL(); |
|
120 |
|
121 void SetBgImgL( CAlfVisual* aVisual ); |
|
122 |
|
123 void SetSVGImageTextureL( |
|
124 CAlfVisual* aVisual, |
|
125 const TDesC& aSvgFileName ); |
|
126 |
|
127 void GetSVGImageTextureL( |
|
128 const TDesC& aSvgFileName, |
|
129 CAlfTexture& aTexture ); |
|
130 |
|
131 void SetDateGridWeightsL( |
|
132 CAlfGridLayout* aDatesGrid, |
|
133 TInt aRowIndex = -1, |
|
134 TInt aWeight = 1 ); |
|
135 |
|
136 void UnFocusDayL( CAlfTextVisual& aTextVisual ); |
|
137 |
|
138 void FocusDayL( CAlfTextVisual& aTextVisual ); |
|
139 |
|
140 void OpenDayViewL(); |
|
141 |
|
142 void CloseDayViewL(); |
|
143 |
|
144 void ShowCalendarEventsL(); |
|
145 |
|
146 void ScaleVisualL( |
|
147 CAlfVisual& aVisual, |
|
148 TReal aXSf, |
|
149 TReal aYSf, |
|
150 TInt aTime ); |
|
151 |
|
152 void RotateVisualL( |
|
153 CAlfVisual& aVisual, |
|
154 TReal aInitAngle, |
|
155 TReal aTargetAngle, |
|
156 TInt aTime ); |
|
157 |
|
158 void SetTextStylesL( |
|
159 CAlfTextVisual& aTextVisual, |
|
160 const TDesC &aText, |
|
161 TRgb aColor = KRgbYellow, |
|
162 CAlfTextVisual::TLineWrap aLineWrap = CAlfTextVisual::ELineWrapBreak, |
|
163 TAlfAlignHorizontal aAlignH = EAlfAlignHCenter, |
|
164 TAlfAlignVertical aAlignV = EAlfAlignVCenter, |
|
165 TPoint aPoint = TPoint(0,0) ); |
|
166 |
|
167 TInt DateTextStyleL(); |
|
168 |
|
169 /** |
|
170 * From MAlfExCalendarEngineEventTimerObserver |
|
171 */ |
|
172 void HandleTimerEventL(); |
|
173 |
|
174 |
|
175 private: // Data |
|
176 |
|
177 // TODO - comment all members, remove/optimize unnecessary , refactor |
|
178 |
|
179 CAlfImageLoaderUtil* iImageLoaderUtil; |
|
180 |
|
181 CAlfEnv& iEnv; |
|
182 |
|
183 CAlfExCalendarDeckControl& iCalendarControl; |
|
184 |
|
185 CAlfExCalendarEngineEventTimer* iEventTimer; |
|
186 |
|
187 |
|
188 TDateTime iDateTime; |
|
189 |
|
190 TTime iTime; // TODO - cleanup/remove these variables. just iDateTime can be sufficient |
|
191 |
|
192 TInt iMonthNumber; |
|
193 |
|
194 TInt iDaysInMonth; |
|
195 |
|
196 TInt iDayNoInWeek; |
|
197 |
|
198 |
|
199 CAlfGridLayout* iBottomGrid; |
|
200 |
|
201 CAlfGridLayout* iDatesGrid; |
|
202 |
|
203 CAlfTextVisual* iMonthText; |
|
204 |
|
205 TInt iFocusedDay; |
|
206 |
|
207 TInt iDayVisualIndex; |
|
208 |
|
209 TBool iDayView; |
|
210 |
|
211 TBool iIsDayFocused; |
|
212 |
|
213 |
|
214 CAlfImageBrush* iNormalDayBrush; |
|
215 |
|
216 CAlfImageBrush* iEventsDayBrush; |
|
217 |
|
218 CAlfImageBrush* iFocusedDayBrush; |
|
219 |
|
220 TAlfTimedPoint iOriginalDayPos; |
|
221 |
|
222 TBuf<128> iCalendarEventTextBuffer; |
|
223 |
|
224 }; |
|
225 |
|
226 #endif /*CALFEXMONTH_H_*/ |