28 // FORWARD DECLARATION |
28 // FORWARD DECLARATION |
29 class CNcsEmailAddressObject; |
29 class CNcsEmailAddressObject; |
30 class CAknsFrameBackgroundControlContext; |
30 class CAknsFrameBackgroundControlContext; |
31 class CFSEmailUiContactHandler; |
31 class CFSEmailUiContactHandler; |
32 class CFSMailBox; |
32 class CFSMailBox; |
33 class CNcsHeaderContainer; |
|
34 class CFSEmailUiLayoutHandler; |
33 class CFSEmailUiLayoutHandler; |
35 class CFreestyleEmailUiAppUi; //<cmail> |
34 class CFreestyleEmailUiAppUi; |
36 |
35 |
37 // CLASS DECLARATION |
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Observer interface to notify observer of item selection events and changes |
|
40 * in popup's visibility. |
|
41 */ |
|
42 class MNcsPopupListBoxObserver |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Visibility of component is changing. |
|
48 * @param aVisible ETrue, if popup is coming visible. |
|
49 * @return Observer should return ETrue, if visiblity change is allowed. |
|
50 */ |
|
51 virtual TBool PopupVisibilityChangingL( TBool aVisible ) = 0; |
|
52 |
|
53 /** |
|
54 * Popup item is selected. |
|
55 */ |
|
56 virtual void PopupItemSelectedL() = 0; |
|
57 |
|
58 }; |
|
59 |
38 |
60 |
39 /** |
61 /** |
40 * CNcsPopupListBox |
62 * CNcsPopupListBox |
41 */ |
63 */ |
42 class CNcsPopupListBox : public CEikTextListBox, |
64 class CNcsPopupListBox : public CEikTextListBox, |
43 public MEikListBoxObserver, |
65 public MEikListBoxObserver, |
44 public MFSEmailUiContactHandlerObserver |
66 public MFSEmailUiContactHandlerObserver |
45 { |
67 { |
46 public: // Constructors and destructor |
68 public: |
47 |
69 |
48 /* |
70 /* |
49 * @param aMailBox reference to current mailbox item |
71 * @param aMailBox reference to current mailbox item |
50 */ |
72 */ |
51 static CNcsPopupListBox* NewL( const CCoeControl* aParent, CFSMailBox& aMailBox, |
73 static CNcsPopupListBox* NewL( const CCoeControl* aParent, |
52 CNcsHeaderContainer& aHeaderContainer, |
74 CFSMailBox& aMailBox, MNcsPopupListBoxObserver& aObserver, |
53 TBool aRemoteLookupSupported ); |
75 TBool aRemoteLookupSupported ); |
54 |
76 |
55 /* |
77 /* |
56 * @param aMailBox reference to current mailbox item |
78 * @param aMailBox reference to current mailbox item |
57 */ |
79 */ |
58 void ConstructL( const CCoeControl* aParent ); |
80 void ConstructL( const CCoeControl* aParent ); |
59 |
81 |
60 /* |
82 /* |
61 * |
83 * Initialises popup and begins the search. |
62 * |
84 * @param aText Search text. |
63 * @param aText |
85 */ |
64 */ |
|
65 void InitAndSearchL( const TDesC& aText, TInt aMode = -1 ); |
86 void InitAndSearchL( const TDesC& aText, TInt aMode = -1 ); |
66 |
87 |
|
88 /** |
|
89 * Hides the popup window. |
|
90 */ |
|
91 void ClosePopupL(); |
|
92 |
67 // Destructor |
93 // Destructor |
68 virtual ~CNcsPopupListBox(); |
94 virtual ~CNcsPopupListBox(); |
69 |
95 |
70 public: // from CEikTextListBox |
96 public: // from CEikTextListBox |
71 |
97 |
161 |
187 |
162 void CreateTextArrayAndSetToTheListboxL( const TBool& aResetIfExists ); |
188 void CreateTextArrayAndSetToTheListboxL( const TBool& aResetIfExists ); |
163 |
189 |
164 private: |
190 private: |
165 |
191 |
166 CNcsPopupListBox( CNcsHeaderContainer& aHeaderContainer, |
192 CNcsPopupListBox( CFSMailBox& aMailbox, |
167 TBool aRemoteLookupSupported, CFSMailBox& aMailbox ); |
193 MNcsPopupListBoxObserver& aObserver, |
|
194 TBool aRemoteLookupSupported ); |
168 |
195 |
169 virtual void CreateItemDrawerL(); |
196 virtual void CreateItemDrawerL(); |
170 |
197 |
171 void UpdateListL(); |
198 void UpdateListL(); |
172 |
199 void UpdateVisibilityL( TBool aVisible ); |
173 void UpdateTextColors(); |
200 void UpdateTextColors(); |
174 |
201 |
175 // From CCoeControl. |
202 // From CCoeControl. |
176 void Draw( const TRect& aRect ) const; |
203 void Draw( const TRect& aRect ) const; |
177 |
204 |
178 private: // data |
205 private: // data |
179 |
206 |
180 CNcsHeaderContainer& iHeaderContainer; |
207 // Background control context. Own. |
181 |
|
182 CAknsFrameBackgroundControlContext* iBackgroundContext; |
208 CAknsFrameBackgroundControlContext* iBackgroundContext; |
183 |
209 // Items matching the current searh string. Own. |
184 RPointerArray<CFSEmailUiClsItem> iMatchingItems; |
210 RPointerArray<CFSEmailUiClsItem> iMatchingItems; |
185 |
211 |
186 CFSEmailUiContactHandler* iContactHandler; // Owned |
212 // Contact handler. |
187 CFSMailBox& iMailBox; |
213 CFSEmailUiContactHandler* iContactHandler; |
188 |
214 CFSMailBox& iMailBox; |
189 TRect iPopupMaxRect; |
215 // Observer for popup visibility changes. |
190 |
216 MNcsPopupListBoxObserver& iObserver; |
191 CDesCArray* iItemTextsArray; |
217 TRect iPopupMaxRect; |
192 HBufC* iCurrentSearchText; |
218 |
193 TInt iRemoteLookupItemPos; |
219 CDesCArray* iItemTextsArray; |
194 |
220 // Current search text. Own. |
195 TBool iRemoteLookupSupported; |
221 HBufC* iCurrentSearchText; |
196 TBool iCachingInProgress; |
222 TInt iRemoteLookupItemPos; |
197 |
223 |
198 CFreestyleEmailUiAppUi* iAppUi; //<cmail> not owned |
224 TBool iRemoteLookupSupported; |
|
225 TBool iCachingInProgress; |
|
226 |
|
227 CFreestyleEmailUiAppUi* iAppUi; // not owned |
|
228 |
199 }; |
229 }; |
200 |
230 |
201 |
231 |
202 /** |
232 /** |
203 * CNcsListItemDrawer |
233 * CNcsListItemDrawer |