83 * Set identifier for this field. |
86 * Set identifier for this field. |
84 * |
87 * |
85 * @param aFieldId Id for this field |
88 * @param aFieldId Id for this field |
86 */ |
89 */ |
87 IMPORT_C virtual void SetFieldId( TESMREntryFieldId aFieldId ); |
90 IMPORT_C virtual void SetFieldId( TESMREntryFieldId aFieldId ); |
|
91 |
|
92 /** |
|
93 * Set identifier for preceding item index. |
|
94 * |
|
95 * @param PreItemIndex Index for pre item in the list |
|
96 */ |
|
97 IMPORT_C void SetPreItemIndex( TInt aPreItemIndex ); |
|
98 |
|
99 /** |
|
100 * Set identifier for current item index. |
|
101 * |
|
102 * @param aCurrentItemIndex Index for current item in the list |
|
103 */ |
|
104 IMPORT_C void SetCurrentItemIndex( TInt aCurrentItemIndex ); |
88 |
105 |
89 public: |
106 public: |
90 /** |
107 /** |
91 * Layout this field relative to given TRect. Implementation MUST |
108 * Layout this field relative to given TRect. Implementation MUST |
92 * update the height of this field to given TRect so the calling |
109 * update the height of this field to given TRect so the calling |
93 * list component knows where to place the next field. |
110 * list component knows where to place the next field. |
94 * |
111 * |
95 * @param aRect Contains the rect for this field. The height must be updated. |
112 * @param aRect Contains the rect for this field. The height must be updated. |
96 * @param aMgr LayoutManager (LAF) |
|
97 * @deprecated Use InitializeL() and ExpandableHeight() instead. |
113 * @deprecated Use InitializeL() and ExpandableHeight() instead. |
98 */ |
114 */ |
99 IMPORT_C void DoLayout( TRect& aRect, CESMRLayoutManager& aMgr ); |
115 IMPORT_C void DoLayout( TRect& aRect ); |
100 |
|
101 /** |
|
102 * Method is called by list component to retrieve new height of the field. |
|
103 * |
|
104 * @see SetExpandable() |
|
105 * @return height after expansion |
|
106 */ |
|
107 IMPORT_C virtual TInt ExpandedHeight() const; |
|
108 |
116 |
109 /** |
117 /** |
110 * Called in the constuct phase. Font and colors are typically set here |
118 * Called in the constuct phase. Font and colors are typically set here |
111 */ |
119 */ |
112 IMPORT_C virtual void InitializeL(); |
120 IMPORT_C virtual void InitializeL(); |
184 * @param aLower, the lower vertical coordinate |
185 * @param aLower, the lower vertical coordinate |
185 */ |
186 */ |
186 IMPORT_C virtual void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
187 IMPORT_C virtual void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
187 |
188 |
188 /** |
189 /** |
|
190 * Get current cursor line virtical position, it's relative to current field |
|
191 * If no internal cursor in this field, default return whole field rect size. |
|
192 * @param aUpper, the upper vertical coordinate |
|
193 * @param aLower, the lower vertical coordinate |
|
194 */ |
|
195 IMPORT_C virtual void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); |
|
196 |
|
197 /** |
189 * Trigger for notifying when the list observer is set |
198 * Trigger for notifying when the list observer is set |
190 */ |
199 */ |
191 IMPORT_C virtual void ListObserverSet(); |
200 IMPORT_C virtual void ListObserverSet(); |
192 |
201 |
193 /** |
202 /** |
194 * Calculates the shown rect in given rect within the list area |
203 * Executes generic command if needed by the field. |
195 */ |
204 * |
196 IMPORT_C virtual TRect CalculateVisibleRect( TRect aRect ); |
|
197 |
|
198 /** |
|
199 * Executes generic command if needed by the field |
|
200 * @param aCommand, commandId to handle specific command |
205 * @param aCommand, commandId to handle specific command |
201 */ |
206 * @return ETrue if the command is used, EFalse otherwise |
202 IMPORT_C virtual void ExecuteGenericCommandL( TInt aCommand ); |
207 */ |
|
208 IMPORT_C virtual TBool ExecuteGenericCommandL( TInt aCommand ); |
|
209 |
|
210 /** |
|
211 * Notifies long tap event to field. |
|
212 * Calls virtual CESMRField::HandleLongtapEventL for |
|
213 * field specific event handling. |
|
214 * |
|
215 * @param aPosition position of the long tap event. |
|
216 * @see HandleLongtapEventL |
|
217 */ |
|
218 IMPORT_C void LongtapDetectedL( const TPoint& aPosition ); |
|
219 |
203 |
220 |
204 /** |
221 /** |
205 * Set titlepane observer to see title pane subject events |
222 * Set titlepane observer to see title pane subject events |
206 * @param aObserver title pane observer to be set |
223 * @param aObserver title pane observer to be set |
207 */ |
224 */ |
208 IMPORT_C virtual void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ); |
225 IMPORT_C virtual void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ); |
209 |
226 |
210 /** |
227 /** |
211 * From MESMRFieldEventNotifier |
228 * From MESMRFieldEventNotifier |
212 * Sets field event queue. |
229 * Sets field event queue. |
213 * @param aObserver observer to receive field events. |
230 * @param aObserver observer to receive field events. |
214 */ |
231 */ |
215 IMPORT_C void SetEventQueueL( MESMRFieldEventQueue* aEventQueue ); |
232 IMPORT_C void SetEventQueueL( MESMRFieldEventQueue* aEventQueue ); |
216 |
233 |
217 /** |
234 /** |
218 * Getter for retrieving outline focus state. |
235 * Getter for retrieving outline focus state. |
219 * @return ETrue if field is focused EFalse otherwise. |
236 * @return ETrue if field is focused EFalse otherwise. |
220 */ |
237 */ |
221 IMPORT_C TBool HasOutlineFocus() const; |
238 IMPORT_C TBool HasOutlineFocus() const; |
222 |
239 |
223 /** |
240 /** |
224 * Getter for focus rect. CMRBackground uses this to get rectangle |
241 * Getter for focus rect. CMRBackground uses this to get rectangle |
225 * it draws background focus to. |
242 * it draws background focus to. |
226 * Returned rectangle should be relative to Field's rect. |
243 * Returned rectangle should be relative to Field's rect. |
227 * @return focus rectangle. |
244 * @return focus rectangle. |
228 */ |
245 */ |
229 IMPORT_C TRect GetFocusRect() const; |
246 IMPORT_C TRect GetFocusRect() const; |
230 |
247 |
231 /** |
248 /** |
232 * Setter for background focus area. Every field should set |
249 * Setter for background focus area. Every field should set |
233 * this in their SizeChanged methods. |
250 * this in their SizeChanged methods. |
234 * Given rectangle should be relative to Field's rect. |
251 * Given rectangle should be relative to Field's rect. |
235 * @param aFocusRect rectangle for focus. |
252 * @param aFocusRect rectangle for focus. |
236 */ |
253 */ |
237 IMPORT_C void SetFocusRect( const TRect& aFocusRect ); |
254 IMPORT_C void SetFocusRect( const TRect& aFocusRect ); |
238 |
255 |
239 /** |
256 /** |
240 * Getter for background focus type. CMRBackground uses this |
257 * Getter for background focus type. CMRBackground uses this |
241 * method to determine how to draw focus. |
258 * method to determine how to draw focus. |
242 * @return focus type. |
259 * @return focus type. |
243 */ |
260 */ |
244 IMPORT_C TESMRFieldFocusType GetFocusType() const; |
261 IMPORT_C TESMRFieldFocusType GetFocusType() const; |
245 |
262 |
246 /** |
263 /** |
247 * Setter for focus type. Every field should set this in e.g. their |
264 * Setter for focus type. Every field should set this in e.g. their |
248 * ConstructL. |
265 * ConstructL. |
249 * @param aFocusType focus type. |
266 * @param aFocusType focus type. |
250 */ |
267 */ |
251 IMPORT_C void SetFocusType( TESMRFieldFocusType aFocusType ); |
268 IMPORT_C void SetFocusType( TESMRFieldFocusType aFocusType ); |
252 |
269 |
253 /** |
270 /** |
254 * Setter for field mode. Field is either in viewer or editor mode. |
271 * Setter for field mode. Field is either in viewer or editor mode. |
255 * @param aModeOfField Mode of the field |
272 * @param aModeOfField Mode of the field |
256 */ |
273 */ |
257 IMPORT_C void SetFieldMode( TESMRFieldMode aMode ); |
274 IMPORT_C void SetFieldMode( TESMRFieldMode aMode ); |
258 |
275 |
259 /** |
276 /** |
260 * Getter for the field mode. |
277 * Getter for the field mode. |
261 * @return Field mode |
278 * @return Field mode |
262 */ |
279 */ |
263 IMPORT_C TESMRFieldMode FieldMode() const; |
280 IMPORT_C TESMRFieldMode FieldMode() const; |
|
281 |
|
282 /** |
|
283 * Set middle softkey command and name |
|
284 * @param aCommandId, command to execute on MSK press |
|
285 * @param aResourceId, resource string to display on MSK |
|
286 */ |
|
287 IMPORT_C void ChangeMiddleSoftKeyL( TInt aCommandId, TInt aResourceId); |
|
288 |
|
289 /** |
|
290 * Sets validator for field. |
|
291 * |
|
292 * @param aValidator validator to use. |
|
293 */ |
|
294 IMPORT_C virtual void SetValidatorL( MESMRFieldValidator* aValidator ); |
|
295 |
|
296 /** |
|
297 * Tests if field control has been activated. |
|
298 */ |
|
299 IMPORT_C TBool IsFieldActivated() const; |
264 |
300 |
|
301 /** |
|
302 * Provides possibility for field to dynamically |
|
303 * intialize context menu. |
|
304 * |
|
305 * @param aResourceId Context menu resource ID |
|
306 * @param aMenuPane Pointer to menu pane |
|
307 */ |
|
308 IMPORT_C virtual void DynInitMenuPaneL( |
|
309 TInt aResourceId, |
|
310 CEikMenuPane* aMenuPane ); |
|
311 |
|
312 /** |
|
313 * Setter for field view mode. Enumeration TESMRFieldType |
|
314 * lists possible view modes. |
|
315 * @param aViewMode View mode of the field |
|
316 */ |
|
317 IMPORT_C void SetFieldViewMode( TESMRFieldType aViewMode ); |
|
318 |
|
319 /** |
|
320 * Getter for the field view mode. |
|
321 * @return Field view mode |
|
322 */ |
|
323 IMPORT_C TESMRFieldType FieldViewMode() const; |
|
324 |
|
325 /** |
|
326 * Updates field extension control and takes ownership |
|
327 * @param aControl Pointer to extension control. |
|
328 */ |
|
329 IMPORT_C void UpdateExtControlL( |
|
330 CCoeControl* aControl ); |
|
331 |
|
332 /** |
|
333 * Set field as locked field(can't be deleted or edited) |
|
334 */ |
|
335 IMPORT_C void virtual LockL(); |
|
336 |
|
337 /** |
|
338 * Get lock status of the field |
|
339 * @return ETrue shows field locked EFalse shows field not locked |
|
340 */ |
|
341 IMPORT_C TBool IsLocked(); |
|
342 |
265 protected: |
343 protected: |
266 |
344 |
267 /** |
345 /** |
268 * Sends event to the event queue. |
346 * Sends event to the event queue. |
269 * @param aEvent event to send. |
347 * @param aEvent event to send. |
270 */ |
348 */ |
271 IMPORT_C void NotifyEventL( const MESMRFieldEvent& aEvent ); |
349 IMPORT_C void NotifyEventL( const MESMRFieldEvent& aEvent ); |
272 |
350 |
273 /** |
351 /** |
274 * Sends command event to the event queue. |
352 * Sends command event to the event queue. |
275 * @param aCommand command to send |
353 * @param aCommand command to send |
276 */ |
354 */ |
277 IMPORT_C void NotifyEventL( TInt aCommand ); |
355 IMPORT_C void NotifyEventL( TInt aCommand ); |
278 |
356 |
279 /** |
357 /** |
280 * Sends event to the event queue asynchronously. |
358 * Sends event to the event queue asynchronously. |
281 * Ownership of the event is transferred to the event queue. |
359 * Ownership of the event is transferred to the event queue. |
282 * @param aEvent event to send. |
360 * @param aEvent event to send. |
283 */ |
361 */ |
312 * Sets middle softkey visible in field. |
383 * Sets middle softkey visible in field. |
313 * @param aVisible if ETrue sets middle softkey visible. |
384 * @param aVisible if ETrue sets middle softkey visible. |
314 */ |
385 */ |
315 IMPORT_C void SetMiddleSoftKeyVisible( TBool aVisible ); |
386 IMPORT_C void SetMiddleSoftKeyVisible( TBool aVisible ); |
316 |
387 |
317 public: // From CCoeControl |
388 /** |
|
389 * Long tap event handler for field. Subclasses should execute their |
|
390 * specific long tap action when this event handler is called. |
|
391 * |
|
392 * @param aPosition position of long tap event |
|
393 */ |
|
394 IMPORT_C virtual void HandleLongtapEventL( const TPoint& aPosition ); |
|
395 |
|
396 /** |
|
397 * Single tap event handler for field. Subclasses should execute their |
|
398 * specific single tap action when this event handler is called. |
|
399 * @param aPosition position of single tap event |
|
400 * @return ETrue if field handles single tap event. |
|
401 */ |
|
402 IMPORT_C virtual TBool HandleSingletapEventL( const TPoint& aPosition ); |
|
403 /** |
|
404 * Pointer event handler for field. This is being called if the received |
|
405 * pointer event has not been handled by single tap or long tap handler. |
|
406 * @param aPointerEvent the pointer event |
|
407 * @return ETrue if pointer event was consumed |
|
408 */ |
|
409 IMPORT_C virtual TBool HandleRawPointerEventL( const TPointerEvent& aPointerEvent ); |
|
410 |
|
411 public: // From base class CCoeControl |
318 IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer); |
412 IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer); |
319 IMPORT_C virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); |
413 IMPORT_C virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); |
320 IMPORT_C virtual void SizeChanged(); |
414 IMPORT_C virtual void SizeChanged(); |
321 IMPORT_C virtual TInt CountComponentControls() const; |
415 IMPORT_C virtual TInt CountComponentControls() const; |
322 IMPORT_C virtual CCoeControl* ComponentControl( TInt aInd ) const; |
416 IMPORT_C virtual CCoeControl* ComponentControl( TInt aInd ) const; |
323 IMPORT_C virtual TSize MinimumSize(); |
417 IMPORT_C virtual TSize MinimumSize(); |
|
418 |
|
419 private: // From base class CCoeControl |
|
420 |
|
421 /** |
|
422 * Implements pointer event handling for fields. |
|
423 * Subclasses must not override this but implement the field specific |
|
424 * actions using the template methods. |
|
425 * |
|
426 * @param aPointerEvent the pointer event to handle |
|
427 * @see HandleSingletapEventL |
|
428 * @see HandleRawPointerEventL |
|
429 */ |
|
430 IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
324 |
431 |
325 protected: |
432 protected: |
326 |
433 |
327 IMPORT_C CESMRField(); |
434 IMPORT_C CESMRField(); |
328 |
435 |
329 // From MESMRFieldEventObserver |
436 // From MESMRFieldEventObserver |
330 /** |
437 /** |
331 * Handles an event from other field. |
438 * Handles an event from other field. |
332 * Default implementation delegates command events to |
439 * Default implementation delegates command events to |
333 * <c>ExecuteGenericCommandL()</c> |
440 * <c>ExecuteGenericCommandL()</c> |
334 * @param aEvent event to handle |
441 * @param aEvent event to handle |
335 */ |
442 */ |
336 IMPORT_C void HandleFieldEventL( const MESMRFieldEvent& aEvent ); |
443 IMPORT_C void HandleFieldEventL( const MESMRFieldEvent& aEvent ); |
337 |
444 |
338 // From MESMRFieldEventNotifier |
445 // From MESMRFieldEventNotifier |
339 /** |
446 /** |
340 * Returns the event observer interface |
447 * Returns the event observer interface |
341 */ |
448 */ |
342 IMPORT_C MESMRFieldEventObserver* EventObserver() const; |
449 IMPORT_C MESMRFieldEventObserver* EventObserver() const; |
343 |
450 |
344 protected: |
451 /** |
345 /// Own: Border control. Draws the outline border |
452 * Initiates tactile feedback when called |
346 CESMRBorderLayer* iBorder; |
453 */ |
|
454 IMPORT_C void HandleTactileFeedbackL(); |
|
455 |
|
456 |
|
457 private: |
|
458 void AquireTactileFeedback(); |
|
459 |
|
460 protected: // data |
|
461 /// Own: control which is surrounded by border |
|
462 CCoeControl* iExtControl; |
347 /// Ref: Observer for notifying list component |
463 /// Ref: Observer for notifying list component |
348 MESMRListObserver* iObserver; |
464 MESMRListObserver* iObserver; |
349 /// Ref: Id for this field. |
465 /// Ref: Id for this field. |
350 TESMREntryFieldId iFieldId; |
466 TESMREntryFieldId iFieldId; |
351 /// Ref: Pointer to layoutmanager |
467 /// Ref: Id for preceding item index. |
352 CESMRLayoutManager* iLayout; |
468 TInt iPreItemIndex; |
353 /// Own: Flag to inform is this field expandable or not. |
469 /// Ref: Id for current item index. |
354 TBool iExpandable; |
470 TInt iCurrentItemIndex; |
355 /// Field event queue. |
471 /// Field event queue. |
356 MESMRFieldEventQueue* iEventQueue; |
472 MESMRFieldEventQueue* iEventQueue; |
357 /// Custom MSK flag |
473 /// Custom MSK flag |
358 TBool iCustomMsk; |
474 TBool iCustomMsk; |
359 /// Own: |
475 /// Redraw flag |
360 TBool iDisableRedraw; |
476 TBool iDisableRedraw; |
361 /// |
477 /// Field default value for MSK visibility |
362 TBool iDefaultMskVisible; |
478 TBool iDefaultMskVisible; |
363 /// Msk disable/enable flag |
479 /// Msk disable/enable flag |
364 TBool iMskVisible; |
480 TBool iMskVisible; |
365 /// Own: Background/focus layer |
481 /// Own: Background/focus layer |
366 CMRBackground* iBackground; |
482 CMRBackground* iBackground; |
367 /// Boolean whether field has outline focus |
483 /// Boolean whether field has outline focus |
368 TBool iOutlineFocus; |
484 TBool iOutlineFocus; |
369 /// Background focus rect |
485 /// Background focus rect |
370 TRect iFocusRect; |
486 TRect iFocusRect; |
371 /// Background focus type |
487 /// Background focus type |
372 TESMRFieldFocusType iFocusType; |
488 TESMRFieldFocusType iFocusType; |
373 /// Field mode (editor or viewer) |
489 /// Field mode (editor or viewer) |
374 TESMRFieldMode iFieldMode; |
490 TESMRFieldMode iFieldMode; |
|
491 /// Field view mode. Required for disabling a field |
|
492 TESMRFieldType iFieldViewMode; |
|
493 /// Ref: Reference to tactile feedback |
|
494 MTouchFeedback* iTactileFeedback; |
|
495 /// Ref: Validator |
|
496 MESMRFieldValidator* iValidator; |
|
497 /// Own: lock status |
|
498 TBool iLocked; |
375 }; |
499 }; |
376 |
500 |
377 #endif |
501 #endif |