|
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 ListBox class's virtual functions. |
|
15 * MakeViewClassInstanceL() are overridden by the |
|
16 * Day View's ListBox. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CALENDAYLISTBOX_H |
|
23 #define CALENDAYLISTBOX_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <coecntrl.h> |
|
27 #include <eikfrlb.h> |
|
28 #include "CalendarVariant.hrh" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class TAknWindowLineLayout; |
|
32 class TAknTextLineLayout; |
|
33 class TAknLayoutRect; |
|
34 class TAknLayoutText; |
|
35 class MCalenServices; |
|
36 class CCalenDayContainer; |
|
37 // CLASS DEFINITIONS |
|
38 |
|
39 /** |
|
40 * DayView's ListBox class |
|
41 * MakeViewClassInstanceL() is overriding. |
|
42 * Each relative ListBox class is derived |
|
43 */ |
|
44 NONSHARABLE_CLASS( CCalenDayListBox ) : public CEikFormattedCellListBox |
|
45 { |
|
46 public: // Factory method |
|
47 static CCalenDayListBox* NewL( |
|
48 const CCalenDayContainer* aDayContainer, |
|
49 MCalenServices& aServices ); |
|
50 |
|
51 public: // static methods |
|
52 static void ReadLayout(TInt aLayoutVariant, |
|
53 TLocale& aLocale, |
|
54 TAknLayoutRect& aGfxA, |
|
55 TAknLayoutText& aTextA, |
|
56 TAknLayoutText& aTextB, |
|
57 TAknLayoutText& aTextC, |
|
58 TAknLayoutRect& aIconA, |
|
59 TAknLayoutRect& aIconB, |
|
60 TBool aMidnightVisualization = EFalse); |
|
61 |
|
62 static void ReadLayout(TLocale& aLocale, |
|
63 TAknWindowLineLayout& aGfxA, |
|
64 TAknTextLineLayout& aTextA, |
|
65 TAknTextLineLayout& aTextB, |
|
66 TAknTextLineLayout& aTextC, |
|
67 TAknWindowLineLayout& aIconA, |
|
68 TAknWindowLineLayout& aIconB, |
|
69 TBool aMidnightVisualization = EFalse); |
|
70 |
|
71 public: // from CEikListBox |
|
72 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
73 |
|
74 |
|
75 /** |
|
76 * From CCoeControl |
|
77 */ |
|
78 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
79 |
|
80 |
|
81 private: // From CEikFormattedCellListBox |
|
82 /** |
|
83 * From CEikFormattedCellListBox |
|
84 * Create ListBoxData and ListBoxItemDrawer. |
|
85 */ |
|
86 void CreateItemDrawerL(); |
|
87 |
|
88 private: // From CCoeControl |
|
89 /** |
|
90 * From CCoeControl Calls when this object size was changed |
|
91 */ |
|
92 void SizeChanged(); |
|
93 /** |
|
94 * From CCoeControl Returns minimum size of control |
|
95 */ |
|
96 TSize MinimumSize(); |
|
97 /** |
|
98 * From CCoeControl Draws itself |
|
99 */ |
|
100 void Draw(const TRect& aRect) const; |
|
101 |
|
102 /** |
|
103 * From CCoeControl Handle global resource change |
|
104 */ |
|
105 void HandleResourceChange(TInt aType); |
|
106 |
|
107 /** |
|
108 * From CCoeControl Supplies skin backround context |
|
109 */ |
|
110 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
111 |
|
112 private: // From CEikColumnListBox |
|
113 /** |
|
114 * From ?base_class Creates CListBoxView class |
|
115 * @return CListBoxView pointer |
|
116 */ |
|
117 CListBoxView* MakeViewClassInstanceL(); |
|
118 |
|
119 private: // New function |
|
120 |
|
121 #ifdef RD_CALEN_MIDNIGHT_VISUALIZATION |
|
122 |
|
123 /* read _t2, _t4, _t1 fields for list_cale_pane */ |
|
124 static void ReadTextLayoutForMidnight(TLocale& aLocale, |
|
125 TAknTextLineLayout& aTextA, |
|
126 TAknTextLineLayout& aTextB, |
|
127 TAknTextLineLayout& aTextC); |
|
128 |
|
129 #endif // RD_CALEN_MIDNIGHT_VISUALIZATION |
|
130 |
|
131 /* read _t2, _t4, _t1 fields for list_cale_pane */ |
|
132 static void ReadTextLayoutNoMidnight(TLocale& aLocale, |
|
133 TAknTextLineLayout& aTextA, |
|
134 TAknTextLineLayout& aTextB, |
|
135 TAknTextLineLayout& aTextC); |
|
136 /** |
|
137 * Handles size change event |
|
138 */ |
|
139 void HandleSizeChangedL(); |
|
140 |
|
141 /** |
|
142 * Handles list looping from bottom to top. |
|
143 */ |
|
144 TKeyResponse HandleDownwardLoopingL(const TKeyEvent& aKeyEvent); |
|
145 |
|
146 /** |
|
147 * C++ default constructor. |
|
148 */ |
|
149 CCalenDayListBox( MCalenServices& aServices ); |
|
150 |
|
151 void ConstructL(const CCalenDayContainer* aDayContainer); |
|
152 private: // Data |
|
153 // not own |
|
154 MCalenServices& iServices; |
|
155 |
|
156 public: |
|
157 // not own. |
|
158 const CCalenDayContainer* iDayContainer; |
|
159 }; |
|
160 |
|
161 #endif // CALENDAYLISTBOX_H |
|
162 |
|
163 // End of File |