|
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: ListBox View class. The class has a special drawing and |
|
15 * special cusor moving. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CALENDAYLISTBOXVIEW_H |
|
22 #define CALENDAYLISTBOXVIEW_H |
|
23 |
|
24 // INCLUDE |
|
25 #include <eikfrlb.h> |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * ListBox View class |
|
31 * The class has a special drawing and special cusor moving. |
|
32 */ |
|
33 |
|
34 NONSHARABLE_CLASS( CCalenDayListBoxView ) : public CFormattedCellListBoxView |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * C++ constructor. |
|
40 * @param aParent is a parent control (CEikListbox) |
|
41 */ |
|
42 CCalenDayListBoxView(CCoeControl* aParent); |
|
43 |
|
44 ~CCalenDayListBoxView(); |
|
45 |
|
46 public: // New functions |
|
47 /** |
|
48 * Sets a array for dividing a cell |
|
49 * @param aArray has a information for dividing a cell |
|
50 */ |
|
51 void SetCellArray(CArrayFix<TInt>* aArray); |
|
52 |
|
53 /** |
|
54 * @param line of cell |
|
55 * @returns first line of cell that given line belongs |
|
56 */ |
|
57 TInt FirstLineOfCell(TInt aLine) const; |
|
58 |
|
59 TInt LastLineOfCell(TInt aLine) const; |
|
60 |
|
61 |
|
62 /** |
|
63 * Moves focus to new position. |
|
64 * @param aItemIndex Index of new position |
|
65 */ |
|
66 void MoveToItemL(TInt aItemIndex); |
|
67 |
|
68 |
|
69 /** |
|
70 * Size of possibly multiline entry |
|
71 * @param aItemIndex Index of an item |
|
72 * @return Size of day view item |
|
73 */ |
|
74 TSize ItemSize(TInt aItemIndex) const; |
|
75 |
|
76 public: // New functions |
|
77 /** |
|
78 * Checks the line whether the ternimation in a cell. |
|
79 * @param aItemIndex is checked item index |
|
80 */ |
|
81 TBool IsLastLineOfCell(TInt aItemIndex) const; |
|
82 /** |
|
83 * Checks the line whether the top in a cell. |
|
84 * @param aItemIndex is checked item index |
|
85 */ |
|
86 TBool IsFirstLineOfCell(TInt aItemIndex) const; |
|
87 |
|
88 private: |
|
89 /** |
|
90 * Draws a whole cell |
|
91 * @param aIndex is a top line in a cell |
|
92 */ |
|
93 void DrawCell(TInt aIndex); |
|
94 |
|
95 /** |
|
96 * Calculates rectangle for visible calendar event (1-4 lines) |
|
97 */ |
|
98 TRect DayViewItemRect(TInt aItemIndex) const; |
|
99 |
|
100 /** |
|
101 * Moves focus to item and ensures that whole item is visible |
|
102 */ |
|
103 void ScrollToItemL(TInt aItemIndex, TSelectionMode aSelectionMode); |
|
104 |
|
105 /* Just a wrapper for leaving functions */ |
|
106 void DrawItemL(TInt aItemIndex) const; |
|
107 |
|
108 private: // from CEikListBoxView |
|
109 /** |
|
110 * From CEikListBoxView |
|
111 * Draws a Listbox's item |
|
112 * @param aItemIndex is drawing item index |
|
113 */ |
|
114 void DrawItem(TInt aItemIndex) const; |
|
115 /** |
|
116 * From CEikListBoxView |
|
117 * Moves the cursor |
|
118 * @param aCursorMovement is a cursor movement |
|
119 * @param aSelectionMode is a selection mode |
|
120 */ |
|
121 void MoveCursorL(TCursorMovement aCursorMovement, |
|
122 TSelectionMode aSelectionMode); |
|
123 |
|
124 private: // Data |
|
125 CArrayFix<TInt>* iCellArray; // cache |
|
126 CCoeControl* iParent; |
|
127 }; |
|
128 |
|
129 #endif // CALENDAYLISTBOXVIEW_H |
|
130 |
|
131 // End of File |