|
1 /* |
|
2 * Copyright (c) 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 time (start-end) field implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRTIMEFIELD_H |
|
20 #define CESMRTIMEFIELD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "cesmrfield.h" |
|
24 |
|
25 //Forward declarations |
|
26 class CMRImage; |
|
27 class CMRTimeContainer; |
|
28 class MESMRFieldValidator; |
|
29 |
|
30 /** |
|
31 * Time field for ESMR editor. Time field has start and end time |
|
32 * separated by a '-'. Focus traverses from left to right and right |
|
33 * to left. |
|
34 */ |
|
35 NONSHARABLE_CLASS( CESMRTimeField ): public CESMRField |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Creates new CESMRTimeField object. Ownership |
|
40 * is transferred to caller. |
|
41 * @param aValidator validator object |
|
42 * @return Pointer to created object, |
|
43 */ |
|
44 static CESMRTimeField* NewL( MESMRFieldValidator* aValidator ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CESMRTimeField(); |
|
50 |
|
51 public: // From CCoeControl |
|
52 void SetContainerWindowL( const CCoeControl& aControl ); |
|
53 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
|
54 TInt CountComponentControls() const; |
|
55 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
56 void SizeChanged(); |
|
57 |
|
58 public: // From ESMRField |
|
59 TBool OkToLoseFocusL( TESMREntryFieldId aNext ); |
|
60 void SetOutlineFocusL( TBool aFocus ); |
|
61 void SetValidatorL( MESMRFieldValidator* aValidator ); |
|
62 TBool ExecuteGenericCommandL( TInt aCommand ); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * Constructor. |
|
67 */ |
|
68 CESMRTimeField(); |
|
69 |
|
70 /** |
|
71 * Second phase constructor. |
|
72 * |
|
73 * @param aValidator validator object |
|
74 */ |
|
75 void ConstructL( MESMRFieldValidator* aValidator ); |
|
76 |
|
77 private: |
|
78 /** |
|
79 * Ref: Container for the time fields. |
|
80 * Created by this class but deleted by base class. |
|
81 */ |
|
82 CMRTimeContainer* iContainer; |
|
83 |
|
84 /// Own: Field icon |
|
85 CMRImage* iFieldIcon; |
|
86 }; |
|
87 |
|
88 #endif // CESMRTIMEFIELD_H |
|
89 |