25 // FORWARD DECLARATIONS |
25 // FORWARD DECLARATIONS |
26 class MESMRFieldStorage; |
26 class MESMRFieldStorage; |
27 class MMRFieldContainerObserver; |
27 class MMRFieldContainerObserver; |
28 |
28 |
29 // CLASS DECLARATIONS |
29 // CLASS DECLARATIONS |
30 NONSHARABLE_CLASS( CMRFieldContainer ) : |
30 NONSHARABLE_CLASS( CMRFieldContainer ) : |
31 public CCoeControl, |
31 public CCoeControl, |
32 public MESMRListObserver |
32 public MESMRListObserver |
33 { |
33 { |
34 public: // Creation and destruction |
34 public: // Creation and destruction |
35 /** |
35 /** |
36 * Static constructor. |
36 * Static constructor. |
37 * |
37 * |
38 * @return New instance of this class |
38 * @return New instance of this class |
39 */ |
39 */ |
40 static CMRFieldContainer* NewL( |
40 static CMRFieldContainer* NewL( |
41 MESMRFieldStorage& aFactory, |
41 MESMRFieldStorage& aFactory, |
42 const CCoeControl& aParent ); |
42 const CCoeControl& aParent ); |
43 /** |
43 /** |
44 * Destructor |
44 * Destructor |
45 */ |
45 */ |
46 ~CMRFieldContainer(); |
46 ~CMRFieldContainer(); |
47 |
47 |
48 public: // Interface |
48 public: // Interface |
49 |
|
50 /** |
|
51 * Return focused field. |
|
52 * @return Focused list item or NULL if no focused item |
|
53 */ |
|
54 CESMRField* FocusedField() const; |
|
55 |
|
56 /** |
|
57 * Moves focus up one step. |
|
58 * |
|
59 * @param aHiddenFocus, in case of hidden focus use case, ETrue. |
|
60 * @return TKeyResponse, if key response was used or not |
|
61 */ |
|
62 TKeyResponse MoveFocusUpL( TBool aHiddenFocus ); |
|
63 |
49 |
64 /** |
50 /** |
65 * Moves focus down one step. |
51 * Return focused field. |
66 * |
52 * @return Focused list item or NULL if no focused item |
67 * @param aHiddenFocus, in case of hidden focus use case, ETrue. |
53 */ |
68 * @return TKeyResponse, if key response was used or not |
54 CESMRField* FocusedField() const; |
69 */ |
55 |
70 TKeyResponse MoveFocusDownL( TBool aHiddenFocus ); |
56 /** |
71 |
57 * Moves focus up one step. |
72 /** |
58 * |
73 * Moves focus visible if it is partly or completely out of |
59 * @param aHiddenFocus, in case of hidden focus use case, ETrue. |
74 * viewable area. |
60 * @return TKeyResponse, if key response was used or not |
75 */ |
61 */ |
76 void SetFieldContainerObserver( MMRFieldContainerObserver* aObserver ); |
62 TKeyResponse MoveFocusUpL( TBool aHiddenFocus ); |
|
63 |
|
64 /** |
|
65 * Moves focus down one step. |
|
66 * |
|
67 * @param aHiddenFocus, in case of hidden focus use case, ETrue. |
|
68 * @return TKeyResponse, if key response was used or not |
|
69 */ |
|
70 TKeyResponse MoveFocusDownL( TBool aHiddenFocus ); |
|
71 |
|
72 /** |
|
73 * Moves focus visible if it is partly or completely out of |
|
74 * viewable area. |
|
75 */ |
|
76 void SetFieldContainerObserver( MMRFieldContainerObserver* aObserver ); |
|
77 |
|
78 /** |
|
79 * Scrolls field container. This is called by list pane during |
|
80 * kinetic scrolling. |
|
81 * @param aTl new top left corner of the container |
|
82 */ |
|
83 void ScrollContainer( const TPoint& aTl ); |
|
84 |
|
85 /** |
|
86 * Synchronizes field container and visible field positions after |
|
87 * kinetic scrolling. |
|
88 */ |
|
89 void Synchronize(); |
77 |
90 |
78 public: // From MESMRListObserver |
91 public: // From MESMRListObserver |
79 void ControlSizeChanged( CESMRField* aField ); |
92 void ControlSizeChanged( CESMRField* aField ); |
80 void ShowControl( TESMREntryFieldId aFieldId ); |
93 void ShowControl( TESMREntryFieldId aFieldId ); |
81 void HideControl( TESMREntryFieldId aFieldId ); |
94 void HideControl( TESMREntryFieldId aFieldId ); |
84 TInt ListHeight(); |
97 TInt ListHeight(); |
85 TBool IsFocusedControlsBottomVisible(); |
98 TBool IsFocusedControlsBottomVisible(); |
86 void ScrollControlVisible( TInt aInd ); |
99 void ScrollControlVisible( TInt aInd ); |
87 void RePositionFields( TInt aAmount ); |
100 void RePositionFields( TInt aAmount ); |
88 TRect ViewableAreaRect(); |
101 TRect ViewableAreaRect(); |
89 |
102 |
90 public: // From CCoeControl |
103 public: // From CCoeControl |
91 TSize MinimumSize(); |
104 TSize MinimumSize(); |
92 |
105 |
93 private: // From CCoeControl |
106 private: // From CCoeControl |
94 TInt CountComponentControls() const; |
107 TInt CountComponentControls() const; |
95 CCoeControl* ComponentControl( TInt aIndex ) const; |
108 CCoeControl* ComponentControl( TInt aIndex ) const; |
96 void SizeChanged(); |
109 void SizeChanged(); |
97 |
110 void Draw( const TRect& aRect ) const; |
|
111 void HandlePointerEventL( const TPointerEvent &aPointerEvent ); |
|
112 |
98 private: // Implementation |
113 private: // Implementation |
99 CMRFieldContainer( MESMRFieldStorage& aFactory ); |
114 CMRFieldContainer( MESMRFieldStorage& aFactory ); |
100 void ConstructL( const CCoeControl& aParent ); |
115 void ConstructL( const CCoeControl& aParent ); |
101 void MoveFields( TInt aIndex, TPoint& aTl ); |
116 void MoveFields( TInt aIndex, TPoint& aTl ); |
102 void LayoutField( CESMRField& aField, const TPoint& aTl ); |
117 void LayoutField( CESMRField& aField, const TPoint& aTl ); |
103 TInt LastVisibleField( TESMREntryFieldId aFieldId ); |
118 TInt LastVisibleField( TESMREntryFieldId aFieldId ); |
104 void DoSetFocusL( TInt aNewFocusIndex ); |
119 void DoSetFocusL( TInt aNewFocusIndex ); |
105 TKeyResponse MoveFocusVisibleL(); |
120 TKeyResponse MoveFocusVisibleL(); |
106 |
121 void SetScrolling( TBool aScrolling ); |
|
122 |
107 private: // Data |
123 private: // Data |
108 // Own: Informs listapane about needed position changes |
124 // Own: Informs listapane about needed position changes |
109 MMRFieldContainerObserver* iObserver; |
125 MMRFieldContainerObserver* iObserver; |
110 /// Ref: Storage for list items. |
126 /// Ref: Storage for list items. |
111 MESMRFieldStorage& iFactory; |
127 MESMRFieldStorage& iFactory; |
112 /// Own: Current focus index |
128 /// Own: Current focus index |
113 TInt iFocusedFieldIndex; |
129 TInt iFocusedFieldIndex; |
|
130 /// Own: Flag for kinetic scrolling state |
|
131 TBool iScrolling; |
|
132 }; |
114 |
133 |
115 }; |
|
116 |
|
117 #endif // CMRFIELDCONTAINER_H |
134 #endif // CMRFIELDCONTAINER_H |
118 |
135 |
119 // End of file |
136 // End of file |