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 CESMRDATEFIELD_H |
19 #ifndef CESMRDATEFIELD_H |
20 #define CESMRDATEFIELD_H |
20 #define CESMRDATEFIELD_H |
21 |
21 |
22 #include "cesmriconfield.h" |
22 #include "cesmrfield.h" |
23 |
23 |
24 class MESMRFieldValidator; |
24 class MESMRFieldValidator; |
25 class CEikDateEditor; |
25 class CEikDateEditor; |
26 class CAknsFrameBackgroundControlContext; |
26 class CMRImage; |
27 class MAknsControlContext; |
27 class CAknsBasicBackgroundControlContext; |
28 |
28 |
29 NONSHARABLE_CLASS( CESMRDateField ): public CESMRIconField |
29 NONSHARABLE_CLASS( CESMRDateField ): public CESMRField |
30 { |
30 { |
31 public: |
31 public: |
32 /** |
32 /** |
33 * Two phase constructor. |
33 * Two phase constructor. |
34 * |
34 * |
40 /** |
40 /** |
41 * Destructor. |
41 * Destructor. |
42 */ |
42 */ |
43 ~CESMRDateField(); |
43 ~CESMRDateField(); |
44 |
44 |
45 public: // From CESMRField |
45 protected: // From CESMRField |
46 void InitializeL(); |
|
47 TBool OkToLoseFocusL( TESMREntryFieldId aId ); |
46 TBool OkToLoseFocusL( TESMREntryFieldId aId ); |
48 void SetOutlineFocusL( TBool aFocus ); |
47 void SetOutlineFocusL( TBool aFocus ); |
|
48 void SetValidatorL( MESMRFieldValidator* aValidator ); |
|
49 TBool ExecuteGenericCommandL( TInt aCommand ); |
49 |
50 |
50 public: // From CCoeControl |
51 protected: // From CCoeControl |
51 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
52 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
52 void ActivateL(); |
53 TInt CountComponentControls() const; |
53 void PositionChanged(); |
54 CCoeControl* ComponentControl( TInt aInd ) const; |
|
55 void SizeChanged(); |
|
56 void SetContainerWindowL( const CCoeControl& aContainer ); |
54 |
57 |
55 private: // Implementation |
58 private: // Implementation |
56 CESMRDateField( MESMRFieldValidator* aValidator ); |
59 CESMRDateField( MESMRFieldValidator* aValidator ); |
57 void ConstructL( TESMREntryFieldId aId ); |
60 void ConstructL( TESMREntryFieldId aId ); |
58 void CheckIfValidatingNeededL( |
61 void CheckIfValidatingNeededL( |
59 TInt aStartFieldIndex ); |
62 TInt aStartFieldIndex ); |
60 TBool TriggerValidatorL(); |
63 TBool TriggerValidatorL(); |
|
64 void InitializeValidatorL(); |
|
65 void DoEnvChangeL(); |
61 |
66 |
62 private: |
67 private: |
63 /** |
68 |
64 * Not owned. Date editor. |
69 // Not owned. Date editor. |
65 */ |
|
66 CEikDateEditor* iDate; |
70 CEikDateEditor* iDate; |
67 |
|
68 /** |
|
69 * Not owned. Validator object. |
|
70 */ |
|
71 MESMRFieldValidator* iValidator; |
|
72 |
|
73 // Background control context |
|
74 MAknsControlContext* iBackground; |
|
75 |
|
76 // Actual background for the editor |
|
77 CAknsFrameBackgroundControlContext* iFrameBgContext;//own |
|
78 |
71 |
79 // Rect of this field |
72 // Rect of this field |
80 TRect iFieldRect; |
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; |
81 }; |
83 }; |
82 |
84 |
83 #endif // CESMRDATEFIELD_H |
85 #endif // CESMRDATEFIELD_H |
84 |
86 |