|
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 date field impl. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRDATEFIELD_H |
|
20 #define CESMRDATEFIELD_H |
|
21 |
|
22 #include "cesmrfield.h" |
|
23 |
|
24 class MESMRFieldValidator; |
|
25 class CEikDateEditor; |
|
26 class CMRImage; |
|
27 class CAknsBasicBackgroundControlContext; |
|
28 |
|
29 NONSHARABLE_CLASS( CESMRDateField ): public CESMRField |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Two phase constructor. |
|
34 * |
|
35 * @param aValidator validator object |
|
36 * @param aId field id |
|
37 */ |
|
38 static CESMRDateField* NewL( MESMRFieldValidator* aValidator, TESMREntryFieldId aId ); |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 ~CESMRDateField(); |
|
44 |
|
45 protected: // From CESMRField |
|
46 TBool OkToLoseFocusL( TESMREntryFieldId aId ); |
|
47 void SetOutlineFocusL( TBool aFocus ); |
|
48 void SetValidatorL( MESMRFieldValidator* aValidator ); |
|
49 TBool ExecuteGenericCommandL( TInt aCommand ); |
|
50 |
|
51 protected: // From CCoeControl |
|
52 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
|
53 TInt CountComponentControls() const; |
|
54 CCoeControl* ComponentControl( TInt aInd ) const; |
|
55 void SizeChanged(); |
|
56 void SetContainerWindowL( const CCoeControl& aContainer ); |
|
57 |
|
58 private: // Implementation |
|
59 CESMRDateField( MESMRFieldValidator* aValidator ); |
|
60 void ConstructL( TESMREntryFieldId aId ); |
|
61 void CheckIfValidatingNeededL( |
|
62 TInt aStartFieldIndex ); |
|
63 TBool TriggerValidatorL(); |
|
64 void InitializeValidatorL(); |
|
65 void DoEnvChangeL(); |
|
66 |
|
67 private: |
|
68 |
|
69 // Not owned. Date editor. |
|
70 CEikDateEditor* iDate; |
|
71 |
|
72 // Rect of this field |
|
73 TRect iFieldRect; |
|
74 |
|
75 // Own: Field icon |
|
76 CMRImage* iFieldIcon; |
|
77 |
|
78 // Own: Background control context. |
|
79 CAknsBasicBackgroundControlContext* iBgCtrlContext; |
|
80 |
|
81 /// Ref: Pointer to container window |
|
82 const CCoeControl* iContainerWindow; |
|
83 }; |
|
84 |
|
85 #endif // CESMRDATEFIELD_H |
|
86 |