author | Simon Howkins <simonh@symbian.org> |
Thu, 25 Nov 2010 12:13:04 +0000 | |
branch | RCL_3 |
changeset 83 | 31a5fbf5db1d |
parent 80 | 726fba06891a |
permissions | -rw-r--r-- |
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 for field container |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef CMRFIELDCONTAINER_H |
|
19 |
#define CMRFIELDCONTAINER_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <coecntrl.h> |
|
23 |
#include "mesmrlistobserver.h" |
|
24 |
||
25 |
// FORWARD DECLARATIONS |
|
26 |
class MESMRFieldStorage; |
|
27 |
class MMRFieldContainerObserver; |
|
28 |
||
29 |
// CLASS DECLARATIONS |
|
30 |
NONSHARABLE_CLASS( CMRFieldContainer ) : |
|
31 |
public CCoeControl, |
|
32 |
public MESMRListObserver |
|
33 |
{ |
|
34 |
public: // Creation and destruction |
|
35 |
/** |
|
36 |
* Static constructor. |
|
37 |
* |
|
38 |
* @return New instance of this class |
|
39 |
*/ |
|
40 |
static CMRFieldContainer* NewL( |
|
41 |
MESMRFieldStorage& aFactory, |
|
42 |
const CCoeControl& aParent ); |
|
43 |
/** |
|
44 |
* Destructor |
|
45 |
*/ |
|
46 |
~CMRFieldContainer(); |
|
47 |
||
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 |
||
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(); |
|
90 |
||
91 |
public: // From MESMRListObserver |
|
92 |
void ControlSizeChanged( CESMRField* aField ); |
|
93 |
void ShowControl( TESMREntryFieldId aFieldId ); |
|
94 |
void HideControl( TESMREntryFieldId aFieldId ); |
|
95 |
TBool IsControlVisible( TESMREntryFieldId aFieldId ); |
|
96 |
void SetControlFocusedL( TESMREntryFieldId aFieldId ); |
|
97 |
TInt ListHeight(); |
|
98 |
TBool IsFocusedControlsBottomVisible(); |
|
99 |
void ScrollControlVisible( TInt aInd ); |
|
100 |
void RePositionFields( TInt aAmount ); |
|
101 |
TRect ViewableAreaRect(); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
102 |
void RedrawField( CESMRField& aField ); |
64 | 103 |
|
104 |
public: // From CCoeControl |
|
105 |
TSize MinimumSize(); |
|
106 |
||
107 |
private: // From CCoeControl |
|
108 |
TInt CountComponentControls() const; |
|
109 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
110 |
void SizeChanged(); |
|
111 |
void Draw( const TRect& aRect ) const; |
|
112 |
void HandlePointerEventL( const TPointerEvent &aPointerEvent ); |
|
113 |
||
114 |
private: // Implementation |
|
115 |
CMRFieldContainer( MESMRFieldStorage& aFactory ); |
|
116 |
void ConstructL( const CCoeControl& aParent ); |
|
117 |
void MoveFields( TInt aIndex, TPoint& aTl ); |
|
118 |
void LayoutField( CESMRField& aField, const TPoint& aTl ); |
|
119 |
TInt LastVisibleField( TESMREntryFieldId aFieldId ); |
|
120 |
void DoSetFocusL( TInt aNewFocusIndex ); |
|
121 |
TKeyResponse MoveFocusVisibleL(); |
|
122 |
void SetScrolling( TBool aScrolling ); |
|
123 |
||
124 |
private: // Data |
|
125 |
// Own: Informs listapane about needed position changes |
|
126 |
MMRFieldContainerObserver* iObserver; |
|
127 |
/// Ref: Storage for list items. |
|
128 |
MESMRFieldStorage& iFactory; |
|
129 |
/// Own: Current focus index |
|
130 |
TInt iFocusedFieldIndex; |
|
131 |
/// Own: Flag for kinetic scrolling state |
|
132 |
TBool iScrolling; |
|
133 |
}; |
|
134 |
||
135 |
#endif // CMRFIELDCONTAINER_H |
|
136 |
||
137 |
// End of file |