1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
17 |
17 |
18 |
18 |
19 #ifndef CESMRATTENDEEFIELD_H |
19 #ifndef CESMRATTENDEEFIELD_H |
20 #define CESMRATTENDEEFIELD_H |
20 #define CESMRATTENDEEFIELD_H |
21 |
21 |
|
22 #include <e32base.h> |
|
23 #include <fbs.h> |
22 #include <caluser.h> |
24 #include <caluser.h> |
23 #include <eikedwob.h> |
25 #include <eiklbo.h> |
|
26 |
24 //<cmail> |
27 //<cmail> |
25 #include "esmrdef.h" |
28 #include "esmrdef.h" |
26 //</cmail> |
29 //</cmail> |
27 #include "cesmrfield.h" |
30 #include "cesmrfield.h" |
28 #include "cesmrcontacthandler.h" |
31 #include "cesmrcontacthandler.h" |
29 #include "mesmrcontacthandlerobserver.h" |
32 #include "mesmrcontacthandlerobserver.h" |
30 #include "cesmrncsaifeditor.h" |
33 #include "cesmrncsaifeditor.h" |
31 |
34 |
32 class CEikLabel; |
|
33 class CESMRNcsPopupListBox; |
35 class CESMRNcsPopupListBox; |
34 class CEikButtonGroupContainer; |
36 class CEikButtonGroupContainer; |
35 class MESMRMeetingRequestEntry; |
37 class MESMRMeetingRequestEntry; |
36 class CAknsFrameBackgroundControlContext; |
38 class CAknsFrameBackgroundControlContext; |
|
39 class CMRLabel; |
|
40 class CAknsBasicBackgroundControlContext; |
|
41 class CMRImage; |
|
42 class CAknButton; |
|
43 class CMRButton; |
37 |
44 |
38 NONSHARABLE_CLASS( CESMRAttendeeField ): |
45 NONSHARABLE_CLASS( CESMRAttendeeField ): public CESMRField, |
39 public CESMRField, |
46 MEikEdwinSizeObserver, |
40 public MEikEdwinSizeObserver, |
47 MESMRNcsAddressPopupList, |
41 public MESMRNcsAddressPopupList, |
48 MESMRContactHandlerObserver, |
42 public MESMRContactHandlerObserver, |
49 MCoeControlObserver, |
43 public MCoeControlObserver |
50 MEikListBoxObserver |
44 { |
51 { |
45 public: |
52 public: |
46 /** |
53 /** |
47 * Two phase constructor. |
54 * Two phase constructor. |
48 * @param aRole attendee role |
55 * @param aRole attendee role |
52 /** |
59 /** |
53 * Destructor. |
60 * Destructor. |
54 */ |
61 */ |
55 ~CESMRAttendeeField(); |
62 ~CESMRAttendeeField(); |
56 |
63 |
57 public: // From CESMRField |
64 protected: // MESMRNcsAddressPopupList |
|
65 void UpdatePopupContactListL( const TDesC& aMatchString, TBool iListAll ); |
|
66 |
|
67 protected: // from MFSEmailUiContactHandlerObserver |
|
68 void OperationCompleteL( TContactHandlerCmd aCmd, const RPointerArray<CESMRClsItem>* aContacts ); |
|
69 void OperationErrorL( TContactHandlerCmd aCmd, TInt aError ); |
|
70 |
|
71 protected: // from MCoeControlObserver |
|
72 void HandleControlEventL( CCoeControl *aControl, TCoeEvent aEventType ); |
|
73 |
|
74 protected: // From CESMRField |
|
75 TSize MinimumSize(); |
58 void InitializeL(); |
76 void InitializeL(); |
59 void InternalizeL( MESMRCalEntry& aEntry ); |
77 void InternalizeL( MESMRCalEntry& aEntry ); |
60 void ExternalizeL( MESMRCalEntry& aEntry ); |
78 void ExternalizeL( MESMRCalEntry& aEntry ); |
61 TInt ExpandedHeight() const; |
79 TBool ExecuteGenericCommandL( TInt aCommand ); |
62 void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
|
63 void ExecuteGenericCommandL( TInt aCommand ); |
|
64 void SetOutlineFocusL( TBool aFocus ); |
80 void SetOutlineFocusL( TBool aFocus ); |
|
81 TBool HandleSingletapEventL( const TPoint& aPosition ); |
|
82 void HandleLongtapEventL( const TPoint& aPosition ); |
65 |
83 |
66 public: // From CCoeControl |
84 protected: // From CCoeControl |
67 TInt CountComponentControls() const; |
85 TInt CountComponentControls() const; |
68 CCoeControl* ComponentControl( TInt aInd ) const; |
86 CCoeControl* ComponentControl( TInt aInd ) const; |
69 void SizeChanged(); |
87 void SizeChanged(); |
70 void PositionChanged(); |
|
71 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
88 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
72 void SetContainerWindowL( const CCoeControl& aControl ); |
89 void SetContainerWindowL( const CCoeControl& aControl ); |
73 void ActivateL(); |
90 |
74 |
91 protected: // From MEikEdwinSizeObserver |
75 public: // From MEikEdwinSizeObserver |
|
76 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aDesirableEdwinSize); |
92 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aDesirableEdwinSize); |
77 |
93 |
78 public: // MESMRNcsAddressPopupList |
94 protected: // from MEikListBoxObserver |
79 void UpdatePopupContactListL( const TDesC& aMatchString, TBool iListAll ); |
95 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
80 |
96 |
81 public: // from MFSEmailUiContactHandlerObserver |
|
82 void OperationCompleteL( TContactHandlerCmd aCmd, const RPointerArray<CESMRClsItem>* aContacts ); |
|
83 void OperationErrorL( TContactHandlerCmd aCmd, TInt aError ); |
|
84 |
|
85 public: // from MCoeControlObserver |
|
86 void HandleControlEventL( CCoeControl *aControl, TCoeEvent aEventType ); |
|
87 |
|
88 private: // Implementation |
97 private: // Implementation |
89 /** |
98 /** |
90 * Constructor. |
99 * Constructor. |
91 * @param aRole attendee role |
100 * @param aRole attendee role |
92 */ |
101 */ |
94 |
103 |
95 /** |
104 /** |
96 * Second phase constructor. |
105 * Second phase constructor. |
97 */ |
106 */ |
98 void ConstructL(); |
107 void ConstructL(); |
99 |
|
100 /** |
|
101 * Removes all attendees. |
|
102 * @param aEntry calendar entry |
|
103 */ |
|
104 void ClearAttendeeListL( CCalEntry& aEntry ); |
|
105 |
|
106 /** |
|
107 * Adds attendees to calendar entry. |
|
108 * @param aEntry calendar entry |
|
109 * @param aPhoneOwnerRole Phone owner's role |
|
110 */ |
|
111 void ParseAttendeesL( |
|
112 MESMRMeetingRequestEntry& aMREntry ); |
|
113 |
108 |
114 /** |
109 /** |
115 * Calculates rect for predictive participant popup. |
110 * Calculates rect for predictive participant popup. |
116 * @return rect for popup |
111 * @return rect for popup |
117 */ |
112 */ |
151 * @param aShow hide or show popuplist |
146 * @param aShow hide or show popuplist |
152 */ |
147 */ |
153 void ShowPopupCbaL( TBool aShow ); |
148 void ShowPopupCbaL( TBool aShow ); |
154 |
149 |
155 void UpdateSendOptionL(); |
150 void UpdateSendOptionL(); |
|
151 void GetCursorLineVerticalPos( TInt& aUpper, TInt& aLower ); |
|
152 void UpdateAttendeesL( |
|
153 MESMRMeetingRequestEntry& aEntry ); |
|
154 |
|
155 private: //data |
156 |
156 |
157 private: //data |
157 // Editor size provided by edwin event. |
158 /** |
158 TSize iSize; |
159 * Own. Field title label. |
159 // Field title size. |
160 */ |
|
161 CEikLabel* iTitle; |
|
162 |
|
163 /** |
|
164 * Temporary expanded size when editor line count grows. |
|
165 */ |
|
166 TSize iExpandedSize; |
|
167 |
|
168 /** |
|
169 * Field title size. |
|
170 */ |
|
171 TSize iTitleSize; |
160 TSize iTitleSize; |
172 |
161 // Attendee role. |
173 /** |
|
174 * Attendee role. |
|
175 */ |
|
176 CCalAttendee::TCalRole iRole; |
162 CCalAttendee::TCalRole iRole; |
177 |
163 // Own: Title of this field |
178 /** |
164 CMRLabel* iTitle; |
179 * Not owned. Attendee editor. |
165 // Owned. Attendee editor. |
180 */ |
|
181 CESMRNcsAifEditor* iEditor; |
166 CESMRNcsAifEditor* iEditor; |
182 |
167 // Own. Predictive attendee popup. |
183 /** |
|
184 * Own. Predictive attendee popup. |
|
185 */ |
|
186 CESMRNcsPopupListBox* iAacListBox; |
168 CESMRNcsPopupListBox* iAacListBox; |
187 |
169 // Own. Contact handler |
188 /** |
|
189 * Own. |
|
190 */ |
|
191 CESMRContactHandler* iContactHandler; |
170 CESMRContactHandler* iContactHandler; |
192 |
171 // Own. for default text of this field. |
193 /** |
|
194 * Own. for default text of this field. |
|
195 */ |
|
196 HBufC* iDefaultText; |
172 HBufC* iDefaultText; |
197 |
173 // Enable / Disable contact popup list |
198 /** |
|
199 * Enable / Disable contact popup list |
|
200 */ |
|
201 TBool iAacListBoxEnabled; |
174 TBool iAacListBoxEnabled; |
202 |
175 // Not owned. CBA. |
203 /** |
|
204 * Not owned. CBA. |
|
205 */ |
|
206 CEikButtonGroupContainer* iButtonGroupContainer; |
176 CEikButtonGroupContainer* iButtonGroupContainer; |
207 |
177 // Own. Background control context. |
208 // Not owned. Background control context |
178 CAknsBasicBackgroundControlContext* iBgCtrlContext; |
209 MAknsControlContext* iBackground; |
179 /// Own: Field icon |
210 |
180 CMRButton* iFieldButton; |
211 /** |
181 // Own: Listboxes previous highlighted index |
212 * Own. for record entry's phone owner |
182 TInt iPreviousIndex; |
213 */ |
|
214 HBufC* iPhoneOwnerAddr; |
|
215 |
|
216 // Owned. Actual background for the editor |
|
217 CAknsFrameBackgroundControlContext* iFrameBgContext; |
|
218 }; |
183 }; |
219 |
184 |
220 #endif // CESMRATTENDEEFIELD_H |
185 #endif // CESMRATTENDEEFIELD_H |