|
1 /* |
|
2 * Copyright (c) 2007-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: ESMR titled field implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRATTENDEEFIELD_H |
|
20 #define CESMRATTENDEEFIELD_H |
|
21 |
|
22 #include <caluser.h> |
|
23 #include <eikedwob.h> |
|
24 //<cmail> |
|
25 #include "esmrdef.h" |
|
26 //</cmail> |
|
27 #include "cesmrfield.h" |
|
28 #include "cesmrcontacthandler.h" |
|
29 #include "mesmrcontacthandlerobserver.h" |
|
30 #include "cesmrncsaifeditor.h" |
|
31 |
|
32 class CEikLabel; |
|
33 class CESMRNcsPopupListBox; |
|
34 class CEikButtonGroupContainer; |
|
35 class MESMRMeetingRequestEntry; |
|
36 class CAknsFrameBackgroundControlContext; |
|
37 |
|
38 NONSHARABLE_CLASS( CESMRAttendeeField ): |
|
39 public CESMRField, |
|
40 public MEikEdwinSizeObserver, |
|
41 public MESMRNcsAddressPopupList, |
|
42 public MESMRContactHandlerObserver, |
|
43 public MCoeControlObserver |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Two phase constructor. |
|
48 * @param aRole attendee role |
|
49 */ |
|
50 static CESMRAttendeeField* NewL( CCalAttendee::TCalRole aRole ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CESMRAttendeeField(); |
|
56 |
|
57 public: // From CESMRField |
|
58 void InitializeL(); |
|
59 void InternalizeL( MESMRCalEntry& aEntry ); |
|
60 void ExternalizeL( MESMRCalEntry& aEntry ); |
|
61 TInt ExpandedHeight() const; |
|
62 void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
|
63 void ExecuteGenericCommandL( TInt aCommand ); |
|
64 void SetOutlineFocusL( TBool aFocus ); |
|
65 |
|
66 public: // From CCoeControl |
|
67 TInt CountComponentControls() const; |
|
68 CCoeControl* ComponentControl( TInt aInd ) const; |
|
69 void SizeChanged(); |
|
70 void PositionChanged(); |
|
71 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
72 void SetContainerWindowL( const CCoeControl& aControl ); |
|
73 void ActivateL(); |
|
74 |
|
75 public: // From MEikEdwinSizeObserver |
|
76 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aDesirableEdwinSize); |
|
77 |
|
78 public: // MESMRNcsAddressPopupList |
|
79 void UpdatePopupContactListL( const TDesC& aMatchString, TBool iListAll ); |
|
80 |
|
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 |
|
89 /** |
|
90 * Constructor. |
|
91 * @param aRole attendee role |
|
92 */ |
|
93 CESMRAttendeeField( CCalAttendee::TCalRole aRole ); |
|
94 |
|
95 /** |
|
96 * Second phase constructor. |
|
97 */ |
|
98 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 |
|
114 /** |
|
115 * Calculates rect for predictive participant popup. |
|
116 * @return rect for popup |
|
117 */ |
|
118 TRect ResolvePopupRectL(); |
|
119 |
|
120 /** |
|
121 * launches search popup dialog for remote contact search. |
|
122 */ |
|
123 void DoPopupSelectL(); |
|
124 |
|
125 /** |
|
126 * close contact popup list |
|
127 */ |
|
128 void ClosePopupContactListL(); |
|
129 |
|
130 /** |
|
131 * Launch remote lookup |
|
132 * @param aExitReason optional error handling |
|
133 * @param aSearchText descriptor containing the search string |
|
134 */ |
|
135 CESMRNcsEmailAddressObject* ExecuteRemoteSearchL( |
|
136 CPbkxRemoteContactLookupServiceUiContext::TResult::TExitReason& aExitReason, |
|
137 const TDesC& aSearchText ); |
|
138 |
|
139 /** |
|
140 * Set default text for attendee field |
|
141 */ |
|
142 void AppendDefaultTextL(); |
|
143 |
|
144 /** |
|
145 * Clear editor |
|
146 */ |
|
147 void ClearDefaultTextL(); |
|
148 |
|
149 /** |
|
150 * show contact pop up list under attendee field. |
|
151 * @param aShow hide or show popuplist |
|
152 */ |
|
153 void ShowPopupCbaL( TBool aShow ); |
|
154 |
|
155 void UpdateSendOptionL(); |
|
156 |
|
157 private: //data |
|
158 /** |
|
159 * Own. Field title label. |
|
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; |
|
172 |
|
173 /** |
|
174 * Attendee role. |
|
175 */ |
|
176 CCalAttendee::TCalRole iRole; |
|
177 |
|
178 /** |
|
179 * Not owned. Attendee editor. |
|
180 */ |
|
181 CESMRNcsAifEditor* iEditor; |
|
182 |
|
183 /** |
|
184 * Own. Predictive attendee popup. |
|
185 */ |
|
186 CESMRNcsPopupListBox* iAacListBox; |
|
187 |
|
188 /** |
|
189 * Own. |
|
190 */ |
|
191 CESMRContactHandler* iContactHandler; |
|
192 |
|
193 /** |
|
194 * Own. for default text of this field. |
|
195 */ |
|
196 HBufC* iDefaultText; |
|
197 |
|
198 /** |
|
199 * Enable / Disable contact popup list |
|
200 */ |
|
201 TBool iAacListBoxEnabled; |
|
202 |
|
203 /** |
|
204 * Not owned. CBA. |
|
205 */ |
|
206 CEikButtonGroupContainer* iButtonGroupContainer; |
|
207 |
|
208 // Not owned. Background control context |
|
209 MAknsControlContext* iBackground; |
|
210 |
|
211 /** |
|
212 * Own. for record entry's phone owner |
|
213 */ |
|
214 HBufC* iPhoneOwnerAddr; |
|
215 |
|
216 // Owned. Actual background for the editor |
|
217 CAknsFrameBackgroundControlContext* iFrameBgContext; |
|
218 }; |
|
219 |
|
220 #endif // CESMRATTENDEEFIELD_H |