64
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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: Interface definition for GUI List pane component
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CMRLISTPANE_H
|
|
19 |
#define CMRLISTPANE_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <coecntrl.h>
|
|
23 |
#include <aknlongtapdetector.h>
|
|
24 |
#include <touchlogicalfeedback.h>
|
|
25 |
|
|
26 |
#include "mmrphysicsobserver.h"
|
|
27 |
#include "mmrfieldcontainerobserver.h"
|
|
28 |
|
|
29 |
// FORWARD DECLARATIONS
|
|
30 |
class MESMRFieldStorage;
|
|
31 |
class TAknDoubleSpanScrollBarModel;
|
|
32 |
class CMRFieldContainer;
|
|
33 |
class CMRListPanePhysics;
|
|
34 |
class CAknDoubleSpanScrollBar;
|
|
35 |
class MMRScrollBarObserver;
|
|
36 |
class CESMRField;
|
|
37 |
class MESMRCalEntry;
|
|
38 |
class MTouchFeedback;
|
|
39 |
|
|
40 |
// CLASS DECLARATIONS
|
|
41 |
NONSHARABLE_CLASS( CMRListPane ) :
|
|
42 |
public CCoeControl,
|
|
43 |
public MAknLongTapDetectorCallBack,
|
|
44 |
public MMRPhysicsObserver,
|
|
45 |
public MMRFieldContainerObserver
|
|
46 |
{
|
|
47 |
public: // Creation and destruction
|
|
48 |
/**
|
|
49 |
* Static constructor.
|
|
50 |
*
|
|
51 |
* @return New instance of this class
|
|
52 |
*/
|
|
53 |
static CMRListPane* NewL( const CCoeControl& aParent,
|
|
54 |
MESMRFieldStorage& aFactory,
|
|
55 |
TAknDoubleSpanScrollBarModel& aScrollModel,
|
|
56 |
CAknDoubleSpanScrollBar& aScroll,
|
|
57 |
MMRScrollBarObserver& aScrollBarObserver );
|
|
58 |
/**
|
|
59 |
* Destructor
|
|
60 |
*/
|
|
61 |
~CMRListPane();
|
|
62 |
|
|
63 |
public: // Interface
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Initializes all fields. Needed when theme changes
|
|
67 |
*/
|
|
68 |
void InitializeL();
|
|
69 |
|
|
70 |
/**
|
|
71 |
* InternalizeL is used to obtain the data from current CCalEntry.
|
|
72 |
* CCalEntry is wrapped inside MESMRCalEntry object. This call is
|
|
73 |
* propagated to all list items in the list.
|
|
74 |
*
|
|
75 |
* @param aEntry Current entry
|
|
76 |
* @see MESMRCalEntry
|
|
77 |
*/
|
|
78 |
void InternalizeL( MESMRCalEntry& aEntry );
|
|
79 |
|
|
80 |
/**
|
|
81 |
* ExternalizeL is used to store the list item data into current
|
|
82 |
* CCalEntry. CCalEntry is wrapped inside the MESMRCalEntry object.
|
|
83 |
*
|
|
84 |
* @param aEntry Current entry.
|
|
85 |
* @param aForceValidation ETrue if force validation should be used
|
|
86 |
* @see MESMRCalEntry
|
|
87 |
*/
|
|
88 |
void ExternalizeL( MESMRCalEntry& aEntry, TBool aForceValidation = EFalse );
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Disables or enables relayouting.
|
|
92 |
*
|
|
93 |
* @param aDisable. If ETrue, disables relayouting.
|
|
94 |
*/
|
|
95 |
void DisableSizeChange(TBool aDisable );
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Scroll the list to put the responeArea at the top and
|
|
99 |
* set the focus on it
|
|
100 |
*/
|
|
101 |
void InitialScrollL();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Return focused field.
|
|
105 |
* @return Focused list item or NULL if no focused item
|
|
106 |
*/
|
|
107 |
CESMRField* FocusedField() const;
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Sets the field focused based on the given field id.
|
|
111 |
* @param aFieldId Id of the field to be focused
|
|
112 |
*/
|
|
113 |
void SetControlFocusedL( TESMREntryFieldId aFieldId );
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Return clicked list item.
|
|
117 |
* @return Clicked list item or NULL if no valid clicked item
|
|
118 |
*/
|
|
119 |
CESMRField* ClickedField() const;
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Sets field to be visible in the list.
|
|
123 |
*
|
|
124 |
* @param aField - id of the field.
|
|
125 |
*/
|
|
126 |
void ShowControl( TESMREntryFieldId aFieldId );
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Is field visible or not.
|
|
130 |
*
|
|
131 |
* @return Boolean ETrue/EFalse
|
|
132 |
*/
|
|
133 |
TBool IsControlVisible( TESMREntryFieldId aFieldId );
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Get response field type of current event.
|
|
137 |
* @Return TESMREntryFieldId
|
|
138 |
*/
|
|
139 |
TESMREntryFieldId GetResponseFieldsFieldId();
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Activates new fields which has been added into the storage
|
|
143 |
* after list pane construction.
|
|
144 |
*/
|
|
145 |
void ReActivateL();
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Records drawing commands of the visible fields
|
|
149 |
*/
|
|
150 |
void RecordFields();
|
|
151 |
|
|
152 |
public: // MMRFieldContainerObserver
|
|
153 |
void ScrollFieldsUp( TInt aPx );
|
|
154 |
void ScrollFieldsDown( TInt aPx );
|
|
155 |
void UpdateScrollBarAndPhysics();
|
|
156 |
|
|
157 |
public: // From CCoeControl
|
|
158 |
TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent,
|
|
159 |
TEventCode aType );
|
|
160 |
void SizeChanged();
|
|
161 |
|
|
162 |
private: // From CCoeControl
|
|
163 |
TInt CountComponentControls() const;
|
|
164 |
CCoeControl* ComponentControl( TInt aIndex) const;
|
|
165 |
void HandlePointerEventL( const TPointerEvent &aPointerEvent );
|
|
166 |
void ActivateL();
|
|
167 |
|
|
168 |
private: // From MMRPhysicsObserver
|
|
169 |
void PhysicsEmulationEnded();
|
|
170 |
void UpdateScrollBarDuringOngoingPhysics();
|
|
171 |
|
|
172 |
private: // From MAknLongTapDetectorCallBack
|
|
173 |
void HandleLongTapEventL(
|
|
174 |
const TPoint& aPenEventLocation,
|
|
175 |
const TPoint& aPenEventScreenLocation );
|
|
176 |
|
|
177 |
private: // Implementation
|
|
178 |
CMRListPane( MESMRFieldStorage& aFactory,
|
|
179 |
TAknDoubleSpanScrollBarModel& aScrollModel,
|
|
180 |
CAknDoubleSpanScrollBar& aScroll,
|
|
181 |
MMRScrollBarObserver& aScrollBarObserver );
|
|
182 |
void ConstructL( const CCoeControl& aParent );
|
|
183 |
void DoUpdateScrollBar( TInt aFocusPosition = KErrNotFound );
|
|
184 |
TInt UpdatedFocusPosition();
|
|
185 |
void SetFocusAfterPointerEventL(
|
|
186 |
const TPointerEvent &aPointerEvent );
|
|
187 |
void UpdateClickedField( const TPointerEvent &aPointerEvent );
|
|
188 |
TBool HiddenFocus();
|
|
189 |
void ForwardReceivedPointerEventsToChildrenL();
|
|
190 |
void HandleTactileFeedback( const TTouchLogicalFeedback& aType );
|
|
191 |
TBool FeedbackScrollMarginExceeded( TInt aMargin );
|
|
192 |
void UpdatePosition();
|
|
193 |
|
|
194 |
private: // Data
|
|
195 |
/// Ref: Storage for list items.
|
|
196 |
MESMRFieldStorage& iFactory;
|
|
197 |
/// Ref: scrollbar model
|
|
198 |
TAknDoubleSpanScrollBarModel& iScrollModel;
|
|
199 |
/// Ref: List components scroll bar
|
|
200 |
CAknDoubleSpanScrollBar& iScroll;
|
|
201 |
/// Own: Long tap detector
|
|
202 |
CAknLongTapDetector* iLongtapDetector;
|
|
203 |
/// Own: Field container
|
|
204 |
CMRFieldContainer* iFieldContainer;
|
|
205 |
/// Own: Physics for kinetic scrolling
|
|
206 |
CMRListPanePhysics* iPhysics;
|
|
207 |
/// Ref: Observer for updating scroll bar revents
|
|
208 |
MMRScrollBarObserver& iScrollBarObserver;
|
|
209 |
/// Not owned: A field which got a pointer down event,
|
|
210 |
/// nulled when focus is changed via keyboard
|
|
211 |
CESMRField* iClickedField;
|
|
212 |
/// Own: Boolean for disabling SizeChanged handling
|
|
213 |
TBool iDisableSizeChanged;
|
|
214 |
/// Own: Boolean to check, if physics action is ongoing or not
|
|
215 |
TBool iPhysicsActionOngoing;
|
|
216 |
/// Own: Record if the long tapping event have been comsumed, if yes,
|
|
217 |
/// then do not handle signal pointer event anymore.
|
|
218 |
TBool iLongTapEventInProgess;
|
|
219 |
/// Ref: Reference to tactile feedback
|
|
220 |
MTouchFeedback* iTactileFeedback;
|
|
221 |
/// Own: This records vertical scroll index for tactile feedback
|
|
222 |
TInt iPreviousVerticalScrollIndex;
|
|
223 |
/// Own: This records default field height for tactile feedback during scroll
|
|
224 |
TInt iDefaultFieldHeight;
|
|
225 |
/// Own: Flag to determine if pointer event is being processed
|
|
226 |
TBool iPointerEventInProgress;
|
|
227 |
/// Own: Flag to determine if position is being changed
|
|
228 |
TBool iPositionChanged;
|
|
229 |
/// Own: Updated field container position
|
|
230 |
TPoint iUpdatedPanePoint;
|
|
231 |
};
|
|
232 |
|
|
233 |
#endif // CMRLISTPANE_H
|
|
234 |
// End of file
|