|
1 /* |
|
2 * Copyright (c) 2007 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: CFsTreeControl is a HUI control that handles UI events for |
|
15 * tree list. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_FSTREECONTROL_H |
|
21 #define C_FSTREECONTROL_H |
|
22 |
|
23 //////SYSTEM INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 //////PROJECT INCLUDES |
|
27 //<cmail> removed __FS_ALFRED_SUPPORT flag |
|
28 //#include <fsconfig.h> |
|
29 //</cmail> removed __FS_ALFRED_SUPPORT flag |
|
30 |
|
31 //////TOOLKIT INCLUDES |
|
32 //<cmail> SF |
|
33 #include <alf/alfcontrol.h> |
|
34 //</cmail> |
|
35 |
|
36 //////TOOLKIT CLASSES |
|
37 class TAlfEvent; |
|
38 class CAlfVisual; |
|
39 |
|
40 //////PROJECT CLASSES |
|
41 class CFsTree; |
|
42 class MFsTreeVisualizer; |
|
43 |
|
44 /** |
|
45 * CFsTreeControl is a HUI control that handles UI events for the tree list. |
|
46 * |
|
47 * The control is a lightweight class mostly mediating events between other |
|
48 * classes. When receiving an event, the Control checks the event type and |
|
49 * does one of the following actions: |
|
50 * - Ignores the event |
|
51 * - Forwards the event to the MFsTreeVisualizer interface |
|
52 * |
|
53 * @code |
|
54 * |
|
55 * @endcode |
|
56 * |
|
57 * @lib |
|
58 */ |
|
59 NONSHARABLE_CLASS( CFsTreeControl ): public CAlfControl |
|
60 { |
|
61 public: // Construction |
|
62 |
|
63 /** |
|
64 * Two-phased constructor |
|
65 * |
|
66 * @param aEnv Reference to the UI toolkit environment |
|
67 * @param aTree Tree data model. |
|
68 * @param aVisualizer Tree's visualizer. |
|
69 */ |
|
70 IMPORT_C static CFsTreeControl* NewL( CAlfEnv& aEnv, |
|
71 CFsTree& aTree, |
|
72 MFsTreeVisualizer& aVisualizer ); |
|
73 |
|
74 /** |
|
75 * C++ destructor |
|
76 */ |
|
77 virtual ~CFsTreeControl(); |
|
78 |
|
79 /** |
|
80 * From CHuiControl |
|
81 * Called when an input event is being offered to the control. |
|
82 * |
|
83 * @param aEvent Event to be handled. |
|
84 * |
|
85 * @return <code>ETrue</code>, if the event was handled. |
|
86 * Otherwise <code>EFalse</code>. |
|
87 */ |
|
88 IMPORT_C TBool OfferEventL(const TAlfEvent& aEvent); |
|
89 |
|
90 /** |
|
91 * Sets focus state of list component |
|
92 * @param aFocused status of the focus to be set |
|
93 */ |
|
94 |
|
95 void SetFocused( const TBool aFocused ); |
|
96 /** |
|
97 * Returns state of the focus |
|
98 * @return State of the focus |
|
99 */ |
|
100 |
|
101 TBool IsFocused() const; |
|
102 |
|
103 /** |
|
104 */ |
|
105 void VisualPrepareDrawFailed(CAlfVisual& aVisual, TInt aErrorCode); |
|
106 |
|
107 protected: |
|
108 /** |
|
109 * From CAlfControl |
|
110 */ |
|
111 void NotifyControlVisibility( TBool aIsVisible, CAlfDisplay& aDisplay ); |
|
112 |
|
113 private: //Construction |
|
114 |
|
115 /** |
|
116 * Default C++ constructor. |
|
117 * |
|
118 * @param aEnv Reference to the UI toolkit environment |
|
119 * @param aTree Tree data model. |
|
120 * @param aVisualizer Tree's visualizer. |
|
121 */ |
|
122 CFsTreeControl( //CAlfEnv& aEnv, |
|
123 CFsTree& aTree, |
|
124 MFsTreeVisualizer& aVisualizer ); |
|
125 |
|
126 /** |
|
127 * Second phase constructor. |
|
128 * |
|
129 */ |
|
130 void ConstructL( CAlfEnv& aEnv ); |
|
131 |
|
132 void SetDragEvents(TBool aEnable); |
|
133 |
|
134 private: // data |
|
135 |
|
136 /** |
|
137 * Tree data model. |
|
138 */ |
|
139 CFsTree& iTree; |
|
140 |
|
141 /** |
|
142 * Tree visualizer. |
|
143 */ |
|
144 MFsTreeVisualizer& iTreeVisualizer; |
|
145 |
|
146 /* |
|
147 * Determines if list is focused or not |
|
148 */ |
|
149 TBool iFocused; |
|
150 |
|
151 // <cmail> Touch |
|
152 /* |
|
153 * Control getting extra touch events |
|
154 */ |
|
155 TBool iGetExtraPointerEvents; |
|
156 // </cmail> |
|
157 }; |
|
158 |
|
159 #endif // C_FSTREECONTROL_H |
|
160 |