36 class CESMRField; |
36 class CESMRField; |
37 class MESMRCalEntry; |
37 class MESMRCalEntry; |
38 class MTouchFeedback; |
38 class MTouchFeedback; |
39 |
39 |
40 // CLASS DECLARATIONS |
40 // CLASS DECLARATIONS |
41 NONSHARABLE_CLASS( CMRListPane ) : |
41 NONSHARABLE_CLASS( CMRListPane ) : |
42 public CCoeControl, |
42 public CCoeControl, |
43 public MAknLongTapDetectorCallBack, |
43 public MAknLongTapDetectorCallBack, |
44 public MMRPhysicsObserver, |
44 public MMRPhysicsObserver, |
45 public MMRFieldContainerObserver |
45 public MMRFieldContainerObserver |
46 { |
46 { |
47 public: // Creation and destruction |
47 public: // Creation and destruction |
48 /** |
48 /** |
49 * Static constructor. |
49 * Static constructor. |
50 * |
50 * |
51 * @return New instance of this class |
51 * @return New instance of this class |
52 */ |
52 */ |
53 static CMRListPane* NewL( const CCoeControl& aParent, |
53 static CMRListPane* NewL( const CCoeControl& aParent, |
54 MESMRFieldStorage& aFactory, |
54 MESMRFieldStorage& aFactory, |
55 TAknDoubleSpanScrollBarModel& aScrollModel, |
55 TAknDoubleSpanScrollBarModel& aScrollModel, |
56 CAknDoubleSpanScrollBar& aScroll, |
56 CAknDoubleSpanScrollBar& aScroll, |
57 MMRScrollBarObserver& aScrollBarObserver ); |
57 MMRScrollBarObserver& aScrollBarObserver ); |
58 /** |
58 /** |
59 * Destructor |
59 * Destructor |
60 */ |
60 */ |
61 ~CMRListPane(); |
61 ~CMRListPane(); |
62 |
62 |
63 public: // Interface |
63 public: // Interface |
64 |
64 |
65 /** |
65 /** |
66 * Initializes all fields. Needed when theme changes |
66 * Initializes all fields. Needed when theme changes |
67 */ |
67 */ |
68 void InitializeL(); |
68 void InitializeL(); |
69 |
69 |
70 /** |
70 /** |
71 * InternalizeL is used to obtain the data from current CCalEntry. |
71 * InternalizeL is used to obtain the data from current CCalEntry. |
72 * CCalEntry is wrapped inside MESMRCalEntry object. This call is |
72 * CCalEntry is wrapped inside MESMRCalEntry object. This call is |
73 * propagated to all list items in the list. |
73 * propagated to all list items in the list. |
74 * |
74 * |
96 |
96 |
97 /** |
97 /** |
98 * Scroll the list to put the responeArea at the top and |
98 * Scroll the list to put the responeArea at the top and |
99 * set the focus on it |
99 * set the focus on it |
100 */ |
100 */ |
101 void InitialScrollL(); // TODO: Fix me. |
101 void InitialScrollL(); |
102 |
102 |
103 /** |
103 /** |
104 * Return focused field. |
104 * Return focused field. |
105 * @return Focused list item or NULL if no focused item |
105 * @return Focused list item or NULL if no focused item |
106 */ |
106 */ |
107 CESMRField* FocusedField() const; |
107 CESMRField* FocusedField() const; |
108 |
108 |
109 /** |
109 /** |
110 * Sets the field focused based on the given field id. |
110 * Sets the field focused based on the given field id. |
111 * @param aFieldId Id of the field to be focused |
111 * @param aFieldId Id of the field to be focused |
112 */ |
112 */ |
113 void SetControlFocusedL( TESMREntryFieldId aFieldId ); |
113 void SetControlFocusedL( TESMREntryFieldId aFieldId ); |
114 |
114 |
115 /** |
115 /** |
116 * Return clicked list item. |
116 * Return clicked list item. |
117 * @return Clicked list item or NULL if no valid clicked item |
117 * @return Clicked list item or NULL if no valid clicked item |
118 */ |
118 */ |
119 CESMRField* ClickedField() const; |
119 CESMRField* ClickedField() const; |
120 |
120 |
121 /** |
121 /** |
122 * Sets field to be visible in the list. |
122 * Sets field to be visible in the list. |
123 * |
123 * |
124 * @param aField - id of the field. |
124 * @param aField - id of the field. |
125 */ |
125 */ |
126 void ShowControl( TESMREntryFieldId aFieldId ); |
126 void ShowControl( TESMREntryFieldId aFieldId ); |
127 |
127 |
128 /** |
128 /** |
129 * Is field visible or not. |
129 * Is field visible or not. |
130 * |
130 * |
131 * @return Boolean ETrue/EFalse |
131 * @return Boolean ETrue/EFalse |
132 */ |
132 */ |
133 TBool IsControlVisible( TESMREntryFieldId aFieldId ); |
133 TBool IsControlVisible( TESMREntryFieldId aFieldId ); |
134 |
134 |
135 /** |
135 /** |
136 * Get response field type of current event. |
136 * Get response field type of current event. |
137 * @Return TESMREntryFieldId |
137 * @Return TESMREntryFieldId |
138 */ |
138 */ |
139 TESMREntryFieldId GetResponseFieldsFieldId(); |
139 TESMREntryFieldId GetResponseFieldsFieldId(); |
140 |
140 |
141 /** |
141 /** |
142 * Activates new fields which has been added into the storage |
142 * Activates new fields which has been added into the storage |
143 * after list pane construction. |
143 * after list pane construction. |
144 */ |
144 */ |
145 void ReActivateL(); |
145 void ReActivateL(); |
146 |
146 |
147 public: // MMRFieldContainerObserver |
147 public: // MMRFieldContainerObserver |
148 void ScrollFieldsUp( TInt aPx ); |
148 void ScrollFieldsUp( TInt aPx ); |
149 void ScrollFieldsDown( TInt aPx ); |
149 void ScrollFieldsDown( TInt aPx ); |
150 void UpdateScrollBarAndPhysics(); |
150 void UpdateScrollBarAndPhysics(); |
151 |
151 |
152 public: // From CCoeControl |
152 public: // From CCoeControl |
153 TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, |
153 TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, |
154 TEventCode aType ); |
154 TEventCode aType ); |
155 void SizeChanged(); |
155 void SizeChanged(); |
156 |
156 |
157 private: // From CCoeControl |
157 private: // From CCoeControl |
158 TInt CountComponentControls() const; |
158 TInt CountComponentControls() const; |
159 CCoeControl* ComponentControl( TInt aIndex) const; |
159 CCoeControl* ComponentControl( TInt aIndex) const; |
160 void HandlePointerEventL( const TPointerEvent &aPointerEvent ); |
160 void HandlePointerEventL( const TPointerEvent &aPointerEvent ); |
161 void ActivateL(); |
161 void ActivateL(); |
162 |
162 |
163 private: // From MMRPhysicsObserver |
163 private: // From MMRPhysicsObserver |
164 void PhysicsEmulationEnded(); |
164 void PhysicsEmulationEnded(); |
165 void UpdateScrollBarDuringOngoingPhysics(); |
165 void UpdateScrollBarDuringOngoingPhysics(); |
166 |
166 |
167 private: // From MAknLongTapDetectorCallBack |
167 private: // From MAknLongTapDetectorCallBack |
168 void HandleLongTapEventL( |
168 void HandleLongTapEventL( |
169 const TPoint& aPenEventLocation, |
169 const TPoint& aPenEventLocation, |
170 const TPoint& aPenEventScreenLocation ); |
170 const TPoint& aPenEventScreenLocation ); |
171 |
171 |
172 private: // Implementation |
172 private: // Implementation |
173 CMRListPane( MESMRFieldStorage& aFactory, |
173 CMRListPane( MESMRFieldStorage& aFactory, |
174 TAknDoubleSpanScrollBarModel& aScrollModel, |
174 TAknDoubleSpanScrollBarModel& aScrollModel, |
175 CAknDoubleSpanScrollBar& aScroll, |
175 CAknDoubleSpanScrollBar& aScroll, |
176 MMRScrollBarObserver& aScrollBarObserver ); |
176 MMRScrollBarObserver& aScrollBarObserver ); |
177 void ConstructL( const CCoeControl& aParent ); |
177 void ConstructL( const CCoeControl& aParent ); |
178 void DoUpdateScrollBar( TInt aFocusPosition = KErrNotFound ); |
178 void DoUpdateScrollBar( TInt aFocusPosition = KErrNotFound ); |
179 TInt UpdatedFocusPosition(); |
179 TInt UpdatedFocusPosition(); |
180 void SetFocusAfterPointerEventL( |
180 void SetFocusAfterPointerEventL( |
181 const TPointerEvent &aPointerEvent ); |
181 const TPointerEvent &aPointerEvent ); |
182 void UpdateClickedField( const TPointerEvent &aPointerEvent ); |
182 void UpdateClickedField( const TPointerEvent &aPointerEvent ); |
183 TBool HiddenFocus(); |
183 TBool HiddenFocus(); |
184 void ForwardReceivedPointerEventsToChildrenL(); |
184 void ForwardReceivedPointerEventsToChildrenL(); |
185 void HandleTactileFeedback( const TTouchLogicalFeedback& aType ); |
185 void HandleTactileFeedback( const TTouchLogicalFeedback& aType ); |
186 TBool FeedbackScrollMarginExceeded( TInt aMargin ); |
186 TBool FeedbackScrollMarginExceeded( TInt aMargin ); |
187 |
187 |
188 private: // Data |
188 private: // Data |
189 /// Ref: Storage for list items. |
189 /// Ref: Storage for list items. |
190 MESMRFieldStorage& iFactory; |
190 MESMRFieldStorage& iFactory; |
191 /// Ref: scrollbar model |
191 /// Ref: scrollbar model |
192 TAknDoubleSpanScrollBarModel& iScrollModel; |
192 TAknDoubleSpanScrollBarModel& iScrollModel; |
198 CMRFieldContainer* iFieldContainer; |
198 CMRFieldContainer* iFieldContainer; |
199 /// Own: Physics for kinetic scrolling |
199 /// Own: Physics for kinetic scrolling |
200 CMRListPanePhysics* iPhysics; |
200 CMRListPanePhysics* iPhysics; |
201 /// Ref: Observer for updating scroll bar revents |
201 /// Ref: Observer for updating scroll bar revents |
202 MMRScrollBarObserver& iScrollBarObserver; |
202 MMRScrollBarObserver& iScrollBarObserver; |
203 /// Not owned: A field which got a pointer down event, |
203 /// Not owned: A field which got a pointer down event, |
204 /// nulled when focus is changed via keyboard |
204 /// nulled when focus is changed via keyboard |
205 CESMRField* iClickedField; |
205 CESMRField* iClickedField; |
206 /// Own: Boolean for disabling SizeChanged handling |
206 /// Own: Boolean for disabling SizeChanged handling |
207 TBool iDisableSizeChanged; |
207 TBool iDisableSizeChanged; |
208 /// Own: Boolean to check, if physics action is ongoing or not |
208 /// Own: Boolean to check, if physics action is ongoing or not |
209 TBool iPhysicsActionOngoing; |
209 TBool iPhysicsActionOngoing; |
210 /// Own: Record if the long tapping event have been comsumed, if yes, |
210 /// Own: Record if the long tapping event have been comsumed, if yes, |
211 /// then do not handle signal pointer event anymore. |
211 /// then do not handle signal pointer event anymore. |
212 TBool iLongTapEventConsumed; |
212 TBool iLongTapEventInProgess; |
213 /// Ref: Reference to tactile feedback |
213 /// Ref: Reference to tactile feedback |
214 MTouchFeedback* iTactileFeedback; |
214 MTouchFeedback* iTactileFeedback; |
215 /// Own: This records vertical scroll index for tactile feedback |
215 /// Own: This records vertical scroll index for tactile feedback |
216 TInt iPreviousVerticalScrollIndex; |
216 TInt iPreviousVerticalScrollIndex; |
217 /// Own: This records default field height for tactile feedback during scroll |
217 /// Own: This records default field height for tactile feedback during scroll |
218 TInt iDefaultFieldHeight; |
218 TInt iDefaultFieldHeight; |
219 }; |
219 }; |
220 |
220 |
221 #endif // CMRLISTPANE_H |
221 #endif // CMRLISTPANE_H |
222 // End of file |
222 // End of file |