25 |
25 |
26 #include "FreestyleEmailUi.hrh" |
26 #include "FreestyleEmailUi.hrh" |
27 #include "ncsaddressinputfield.h" |
27 #include "ncsaddressinputfield.h" |
28 #include "ncsfieldsizeobserver.h" |
28 #include "ncsfieldsizeobserver.h" |
29 #include "ncsconstants.h" |
29 #include "ncsconstants.h" |
30 #include "ncspopuplistbox.h" |
30 |
|
31 #include "ncsattachmentfield.h" |
31 |
32 |
32 class CFSMailBox; |
33 class CFSMailBox; |
33 class CNcsAttachmentField; |
|
34 class CNcsEmailAddressObject; |
34 class CNcsEmailAddressObject; |
|
35 class CNcsPopupListBox; |
35 class CNcsSubjectField; |
36 class CNcsSubjectField; |
36 class CAknPhysics; |
37 class CAknPhysics; |
37 |
38 |
38 /** |
39 /** |
39 * CNcsHeaderContainer |
40 * CNcsHeaderContainer |
40 */ |
41 */ |
41 class CNcsHeaderContainer : public CCoeControl, public MNcsAddressPopupList, |
42 class CNcsHeaderContainer : public CCoeControl, |
42 public MNcsPopupListBoxObserver |
43 public MNcsAddressPopupList, |
|
44 public MNcsAttachmentFieldObserver |
43 { |
45 { |
44 |
46 |
45 public: |
47 public: |
46 |
48 |
47 /** Initialisation flags. */ |
49 /** Initialisation flags. */ |
71 void EnableKineticScrollingL(CAknPhysics* aPhysics); |
73 void EnableKineticScrollingL(CAknPhysics* aPhysics); |
72 |
74 |
73 private: // constructor/destructor |
75 private: // constructor/destructor |
74 |
76 |
75 /** |
77 /** |
76 * CNcsHeaderContainer |
78 * CNcsHeaderContainer |
77 * C++ constructor. |
79 * C++ constructor. |
78 * @param aParent Parent control. |
80 * @param aParent Parent control. |
79 * @param aMailBox reference to current mailbox item |
81 * @param aMailBox reference to current mailbox item |
80 */ |
82 */ |
81 CNcsHeaderContainer( CCoeControl& aParent, CFSMailBox& aMailBox, CAknPhysics* aPhysics ); |
83 CNcsHeaderContainer( CCoeControl& aParent, CFSMailBox& aMailBox, CAknPhysics* aPhysics ); |
82 |
84 |
83 /** |
85 /** |
84 * ConstructL |
86 * ConstructL |
85 * 2nd phase constructor. |
87 * 2nd phase constructor. |
86 */ |
88 */ |
87 void ConstructL( TInt aFlags ); |
89 void ConstructL( TInt aFlags ); |
88 |
90 |
89 public: // function members |
91 public: // function members |
90 |
92 |
91 /** |
93 /** |
92 * From MNcsPopupListBoxObserver. |
94 * GetToFieldAddressesL |
93 */ |
95 * Get addresses in TO-field. |
94 TBool PopupVisibilityChangingL( TBool aVisible ); |
96 * @return Array of addresses. |
95 |
97 */ |
96 /** |
98 const RPointerArray<CNcsEmailAddressObject>& GetToFieldAddressesL( |
97 * From MNcsPopupListBoxObserver. |
|
98 */ |
|
99 void PopupItemSelectedL(); |
|
100 |
|
101 /** |
|
102 * GetToFieldAddressesL |
|
103 * Get addresses in TO-field. |
|
104 * @return Array of addresses. |
|
105 */ |
|
106 const RPointerArray<CNcsEmailAddressObject>& GetToFieldAddressesL( |
|
107 TBool aParseNow = ETrue ); |
99 TBool aParseNow = ETrue ); |
108 |
100 |
109 /** |
101 /** |
110 * GetCcFieldAddressesL |
102 * GetCcFieldAddressesL |
111 * Get addresses in CC-field. |
103 * Get addresses in CC-field. |
231 |
223 |
232 void SetMenuBar( CEikButtonGroupContainer* aMenuBar ); |
224 void SetMenuBar( CEikButtonGroupContainer* aMenuBar ); |
233 |
225 |
234 void SetAttachmentLabelTextsLD( CDesCArray* aAttachmentNames, |
226 void SetAttachmentLabelTextsLD( CDesCArray* aAttachmentNames, |
235 CDesCArray* aAttachmentSizes ); |
227 CDesCArray* aAttachmentSizes ); |
236 TInt FocusedAttachmentLabelIndex(); |
228 TInt FocusedAttachmentLabelIndex() const; |
237 void ShowAttachmentLabelL(); |
229 void ShowAttachmentLabelL(); |
238 void HideAttachmentLabel(); |
230 void HideAttachmentLabel(); |
239 |
231 |
240 void SetCcFieldVisibleL( |
232 void SetCcFieldVisibleL( |
241 TBool aVisible, |
233 TBool aVisible, |
314 void SelectAllCcFieldTextL(); |
306 void SelectAllCcFieldTextL(); |
315 |
307 |
316 void SelectAllBccFieldTextL(); |
308 void SelectAllBccFieldTextL(); |
317 |
309 |
318 void SelectAllSubjectFieldTextL(); |
310 void SelectAllSubjectFieldTextL(); |
319 |
311 |
320 void FocusToField(); |
312 void FocusToField(); |
321 |
313 |
322 void FocusAttachmentField(); |
314 void FocusAttachmentField(); |
|
315 |
|
316 void SetFocusToBottom( TDrawNow aDrawNow = ENoDrawNow ); |
323 |
317 |
324 void SetPriority( TMsgPriority aPriority ); |
318 void SetPriority( TMsgPriority aPriority ); |
325 |
319 |
326 void SetFollowUp( TBool aFollowUp ); |
320 void SetFollowUp( TBool aFollowUp ); |
327 |
321 |
355 virtual TInt LayoutLineCount() const; |
349 virtual TInt LayoutLineCount() const; |
356 |
350 |
357 TBool IsAddressInputField( const CCoeControl* aControl ) const; |
351 TBool IsAddressInputField( const CCoeControl* aControl ) const; |
358 |
352 |
359 TBool IsRemoteSearchInprogress() const; |
353 TBool IsRemoteSearchInprogress() const; |
|
354 |
|
355 /** |
|
356 * Shows/hides cursor. |
|
357 * |
|
358 * @param aShow ETrue - shows, EFalse - hides cursor. |
|
359 */ |
|
360 void ShowCursor( TBool aShow, TDrawNow aDrawNow = ENoDrawNow ); |
360 |
361 |
361 void DoScroll(); |
362 void DoScroll(); |
362 void DoScrollFocusToTop(); |
363 |
363 |
|
364 void SetPhysicsEmulationOngoing( TBool aPhysOngoing ); |
364 void SetPhysicsEmulationOngoing( TBool aPhysOngoing ); |
365 |
365 |
366 virtual void HandleResourceChange( TInt aType ); |
|
367 |
|
368 // Set origin for header's top position. |
|
369 void SetOrigin( TPoint& aPoint ); |
|
370 |
|
371 private: // Function members |
366 private: // Function members |
372 |
367 |
373 void FocusChanged(TDrawNow aDrawNow); |
368 void FocusChanged(TDrawNow aDrawNow); |
374 |
369 |
375 void UpdatePopupContactListL( const TDesC& aMatchString, TBool aListAll ); |
370 void UpdatePopupContactListL( const TDesC& aMatchString, TBool aListAll ); |
376 |
371 |
377 CCoeControl* FindFocused() const; |
372 CCoeControl* FindFocused() const; |
378 |
373 |
379 void Draw( const TRect& aRect ) const; |
374 void Draw( const TRect& aRect ) const; |
380 |
|
381 void DrawAttachmentFocusNow(); |
|
382 |
375 |
383 TKeyResponse ChangeFocusL( const TKeyEvent& aKeyEvent ); |
376 TKeyResponse ChangeFocusL( const TKeyEvent& aKeyEvent ); |
384 |
377 |
385 void SizeChanged(); |
378 void SizeChanged(); |
386 |
379 |
410 |
403 |
411 void ChangeMskCommandL( TInt aLabelResourceId ); |
404 void ChangeMskCommandL( TInt aLabelResourceId ); |
412 |
405 |
413 void CommitFieldL( CCoeControl* aField ); |
406 void CommitFieldL( CCoeControl* aField ); |
414 |
407 |
|
408 private: //From MNcsAttachmentFieldObserver |
|
409 /** |
|
410 * AttachmentOpenL |
|
411 * Handles attachment open event from iAttachmentField |
|
412 */ |
|
413 void AttachmentOpenL(); |
|
414 |
|
415 /** |
|
416 * AttachmentRemoveL |
|
417 * Handles attachment remove event from iAttachmentField |
|
418 */ |
|
419 void AttachmentRemoveL(); |
415 private: //From MAknLongTapDetectorCallBack |
420 private: //From MAknLongTapDetectorCallBack |
416 |
421 |
417 void HandleLongTapEventL( const TPoint& aPenEventLocation, |
422 void HandleLongTapEventL( const TPoint& aPenEventLocation, |
418 const TPoint& aPenEventScreenLocation ); |
423 const TPoint& aPenEventScreenLocation ); |
419 |
424 |
420 private: // Data members |
425 private: // Data members |
421 |
426 |
422 // Parent window. |
427 /* |
|
428 * Parent window |
|
429 * Not Own |
|
430 */ |
423 CCoeControl& iParent; |
431 CCoeControl& iParent; |
424 |
432 |
425 MNcsFieldSizeObserver& iFieldSizeObserver; |
433 MNcsFieldSizeObserver& iFieldSizeObserver; |
426 |
434 |
427 CAknLongTapDetector* iLongTapDetector; |
435 CAknLongTapDetector* iLongTapDetector; |
428 |
436 |
429 CEikButtonGroupContainer* iMenuBar; |
437 CEikButtonGroupContainer* iMenuBar; |
430 |
438 |
431 CNcsAddressInputField* iToField; |
439 CNcsAddressInputField* iToField; |
|
440 |
432 CNcsAddressInputField* iCcField; |
441 CNcsAddressInputField* iCcField; |
|
442 |
433 CNcsAddressInputField* iBccField; |
443 CNcsAddressInputField* iBccField; |
434 |
444 |
435 CNcsSubjectField* iSubjectField; |
445 CNcsSubjectField* iSubjectField; |
436 |
446 |
437 CNcsAttachmentField* iAttachmentField; |
447 CNcsAttachmentField* iAttachmentField; |
438 |
448 |
439 // The attachments count |
449 // The attachments count |
440 TInt iAttachmentCount; |
450 TInt iAttachmentCount; |
441 |
451 |
442 // Popup for resently used email addressses. Own. |
452 // Address popup data members |
443 CNcsPopupListBox* iAacListBox; |
453 CNcsPopupListBox* iAacListBox; |
444 |
454 |
445 CFSMailBox& iMailBox; |
455 CFSMailBox& iMailBox; |
446 |
456 |
447 //flag which disables changes of MSK label if any popup dialog is open |
457 //flag which disables changes of MSK label if any popup dialog is open |
448 TBool iSwitchChangeMskOff; |
458 TBool iSwitchChangeMskOff; |
449 |
459 |
450 TBool iLongTapEventConsumed; |
460 TBool iLongTapEventConsumed; |
451 TBool iRALInProgress; |
461 TBool iRALInProgress; |
452 |
462 |
453 // Currently focused control |
463 // Currently focused control |
454 CCoeControl* iFocused; |
464 CCoeControl* iFocused; |
455 |
465 |
456 // panning related |
466 // panning related |
457 CAknPhysics* iPhysics; |
467 CAknPhysics* iPhysics; |
458 |
|
459 // Header containers default top left position. |
|
460 TPoint iOrigin; |
|
461 |
|
462 TBool iSplitScreenVKBEnabled; |
|
463 }; |
468 }; |
464 |
469 |
465 |
470 |
466 #endif |
471 #endif |