9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: ESMR location field for CESMRListComponent |
14 * Description: ESMR location field. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef CESMRLOCATIONFIELD_H |
19 #ifndef CESMRLOCATIONFIELD_H |
20 #define CESMRLOCATIONFIELD_H |
20 #define CESMRLOCATIONFIELD_H |
21 |
21 |
22 #include <e32base.h> |
22 #include <e32base.h> |
23 #include <eikedwob.h>//MEikEdwinSizeObserver |
23 #include <eikedwob.h> // MEikEdwinSizeObserver |
24 #include "cesmriconfield.h" |
24 #include <eikmobs.h> // MEikMenuObserver |
|
25 |
|
26 #include "cesmrfield.h" |
25 |
27 |
26 //Forward declarations |
28 //Forward declarations |
27 class CESMREditor; |
29 class CESMREditor; |
28 class CAknsFrameBackgroundControlContext; |
|
29 class MAknsControlContext; |
|
30 class CAknsFrameBackgroundControlContext; |
|
31 class CESMRFeatureSettings; |
30 class CESMRFeatureSettings; |
32 class CFbsBitmap; |
31 class CFbsBitmap; |
|
32 class CMRImage; |
|
33 class CAknsBasicBackgroundControlContext; |
|
34 class CMRStylusPopupMenu; |
|
35 class CMRLabel; |
|
36 class CMRButton; |
33 |
37 |
34 /** |
38 /** |
35 * This class is a custom field control that shows the location of calendar events |
39 * This class is a custom field control that shows the location of calendar events |
36 */ |
40 */ |
37 NONSHARABLE_CLASS( CESMRLocationField ): public CESMRIconField, |
41 NONSHARABLE_CLASS( CESMRLocationField ): public CESMRField, |
38 public MEikEdwinSizeObserver, |
42 public MEikEdwinSizeObserver, |
39 public MEikEdwinObserver |
43 public MEikEdwinObserver, |
|
44 public MEikMenuObserver |
40 { |
45 { |
41 public: |
46 public: |
42 /** |
47 /** |
43 * Creates new CESMRLocationField object. Ownership |
48 * Creates new CESMRLocationField object. Ownership |
44 * is transferred to caller. |
49 * is transferred to caller. |
45 * @return Pointer to created object, |
50 * @return Pointer to created object, |
46 */ |
51 */ |
47 static CESMRLocationField* NewL(); |
52 static CESMRLocationField* NewL(); |
|
53 |
|
54 /** |
|
55 * C++ Destructor. |
|
56 */ |
|
57 ~CESMRLocationField(); |
|
58 |
|
59 protected: // From CESMRField |
|
60 TSize MinimumSize(); |
|
61 void InitializeL(); |
|
62 void InternalizeL( MESMRCalEntry& aEntry ); |
|
63 void ExternalizeL( MESMRCalEntry& aEntry ); |
|
64 void SetOutlineFocusL( TBool aFocus ); |
|
65 void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); |
|
66 void ListObserverSet(); |
|
67 TBool ExecuteGenericCommandL( TInt aCommand ); |
|
68 TBool HandleSingletapEventL( const TPoint& aPosition ); |
|
69 void HandleLongtapEventL( const TPoint& aPosition ); |
|
70 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
48 |
71 |
49 /** |
72 protected: // From MEikEdwinSizeObserver |
50 * C++ Destructor. |
73 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); |
51 */ |
74 |
52 ~CESMRLocationField(); |
75 protected: // From MEikEdwinObserver |
|
76 void HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType); |
53 |
77 |
54 public: // From CESMRField |
78 protected: // From MEikMenuObserver |
55 void InitializeL(); |
79 void ProcessCommandL( TInt aCommandId ); |
56 void InternalizeL( MESMRCalEntry& aEntry ); |
80 void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/){} |
57 void ExternalizeL( MESMRCalEntry& aEntry ); |
81 |
58 void SetOutlineFocusL( TBool aFocus ); |
82 protected: // From CCoeControl |
59 TInt ExpandedHeight() const; |
83 TInt CountComponentControls() const; |
60 void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
84 CCoeControl* ComponentControl( TInt aInd ) const; |
61 void ListObserverSet(); |
85 void SizeChanged(); |
62 void ExecuteGenericCommandL( TInt aCommand ); |
86 void SetContainerWindowL( const CCoeControl& aContainer ); |
63 TSize BorderSize() const; |
87 TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, |
|
88 TEventCode aType ); |
|
89 TBool HandleRawPointerEventL( const TPointerEvent &aPointerEvent ); |
|
90 |
|
91 private: |
|
92 /** |
|
93 * Constructor. |
|
94 */ |
|
95 CESMRLocationField(); |
64 |
96 |
65 public: // From MEikEdwinSizeObserver |
97 /** |
66 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); |
98 * Second phase constructor. |
|
99 */ |
|
100 void ConstructL(); |
|
101 |
|
102 CESMRFeatureSettings& FeaturesL(); |
|
103 void SetWaypointIconL( TBool aEnabled ); |
67 |
104 |
68 public: // From MEikEdwinObserver |
105 // From MESMRFieldEventObserver |
69 void HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType); |
106 void HandleFieldEventL( const MESMRFieldEvent& aEvent ); |
70 |
|
71 public: // From CCoeControl |
|
72 void ActivateL(); |
|
73 void PositionChanged(); |
|
74 TInt CountComponentControls() const; |
|
75 CCoeControl* ComponentControl( TInt aInd ) const; |
|
76 void SizeChanged(); |
|
77 |
|
78 private: |
|
79 /** |
|
80 * Constructor. |
|
81 */ |
|
82 CESMRLocationField(); |
|
83 |
107 |
84 /** |
108 private: |
85 * Second phase constructor. |
109 // Own: Title of this field |
86 */ |
110 CMRLabel* iTitle; |
87 void ConstructL(); |
111 // Not owned. Location editor. |
88 |
112 CESMREditor* iLocation; |
89 CESMRFeatureSettings& FeaturesL(); |
113 // Own: Edwin size |
90 void SetWaypointIconL( TBool aEnabled ); |
114 TSize iSize; |
91 void PositionFieldElements(); |
115 // Feature settings. own. |
92 void LayoutWaypointIcon(); |
116 CESMRFeatureSettings* iFeatures; |
93 |
117 // Location text. Own. |
94 // From MESMRFieldEventObserver |
118 HBufC* iLocationText; |
95 void HandleFieldEventL( const MESMRFieldEvent& aEvent ); |
119 // Own:Field left button |
96 TSize CalculateEditorSize( const TSize& aSize ); |
120 CMRButton* iFieldButton; |
97 |
121 // Own: Waypoint icon |
98 private: |
122 CMRImage* iWaypointIcon; |
99 // Not owned. Location editor. |
123 // Field editor line count |
100 CESMREditor* iLocation; |
124 TInt iLineCount; |
101 // Field size. |
125 // Own: Background for the editor when it is focused |
102 TSize iSize; |
126 CAknsBasicBackgroundControlContext* iBgControlContext; |
103 // Background control context. not owned |
127 // Field rect for comparison purposes |
104 MAknsControlContext* iBackground; |
128 TRect iFieldRect; |
105 // Actual background for the editor. owned |
129 /// Own: Stylus popup menu |
106 CAknsFrameBackgroundControlContext* iFrameBgContext; |
130 CMRStylusPopupMenu* iMenu; TBool iMenuIsShown; |
107 // Feature settings. own. |
|
108 CESMRFeatureSettings* iFeatures; |
|
109 // waypointicon bitmap for coordinates. Own |
|
110 CFbsBitmap* iWaypointIcon; |
|
111 // waypointicon bitmap for coordinates. Own |
|
112 CFbsBitmap* iWaypointIconMask; |
|
113 // waypointicon icon for coordinates. Own |
|
114 CEikImage* iIcon; |
|
115 // Location text. Own. |
|
116 HBufC* iLocationText; |
|
117 }; |
131 }; |
118 |
132 |
119 #endif // CESMRLOCATIONFIELD_H |
133 #endif // CESMRLOCATIONFIELD_H |
120 |
134 |