|
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 location field. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRLOCATIONFIELD_H |
|
20 #define CESMRLOCATIONFIELD_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <eikedwob.h> // MEikEdwinSizeObserver |
|
24 #include <eikmobs.h> // MEikMenuObserver |
|
25 |
|
26 #include "cesmrfield.h" |
|
27 |
|
28 //Forward declarations |
|
29 class CESMREditor; |
|
30 class CESMRFeatureSettings; |
|
31 class CFbsBitmap; |
|
32 class CMRImage; |
|
33 class CAknsBasicBackgroundControlContext; |
|
34 class CMRStylusPopupMenu; |
|
35 class CMRLabel; |
|
36 class CMRButton; |
|
37 |
|
38 /** |
|
39 * This class is a custom field control that shows the location of calendar events |
|
40 */ |
|
41 NONSHARABLE_CLASS( CESMRLocationField ): public CESMRField, |
|
42 public MEikEdwinSizeObserver, |
|
43 public MEikEdwinObserver, |
|
44 public MEikMenuObserver |
|
45 { |
|
46 public: |
|
47 /** |
|
48 * Creates new CESMRLocationField object. Ownership |
|
49 * is transferred to caller. |
|
50 * @return Pointer to created object, |
|
51 */ |
|
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 ); |
|
71 |
|
72 protected: // From MEikEdwinSizeObserver |
|
73 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); |
|
74 |
|
75 protected: // From MEikEdwinObserver |
|
76 void HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType); |
|
77 |
|
78 protected: // From MEikMenuObserver |
|
79 void ProcessCommandL( TInt aCommandId ); |
|
80 void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/){} |
|
81 |
|
82 protected: // From CCoeControl |
|
83 TInt CountComponentControls() const; |
|
84 CCoeControl* ComponentControl( TInt aInd ) const; |
|
85 void SizeChanged(); |
|
86 void SetContainerWindowL( const CCoeControl& aContainer ); |
|
87 TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, |
|
88 TEventCode aType ); |
|
89 TBool HandleRawPointerEventL( const TPointerEvent &aPointerEvent ); |
|
90 |
|
91 private: |
|
92 /** |
|
93 * Constructor. |
|
94 */ |
|
95 CESMRLocationField(); |
|
96 |
|
97 /** |
|
98 * Second phase constructor. |
|
99 */ |
|
100 void ConstructL(); |
|
101 |
|
102 CESMRFeatureSettings& FeaturesL(); |
|
103 void SetWaypointIconL( TBool aEnabled ); |
|
104 |
|
105 // From MESMRFieldEventObserver |
|
106 void HandleFieldEventL( const MESMRFieldEvent& aEvent ); |
|
107 |
|
108 private: |
|
109 // Own: Title of this field |
|
110 CMRLabel* iTitle; |
|
111 // Not owned. Location editor. |
|
112 CESMREditor* iLocation; |
|
113 // Own: Edwin size |
|
114 TSize iSize; |
|
115 // Feature settings. own. |
|
116 CESMRFeatureSettings* iFeatures; |
|
117 // Location text. Own. |
|
118 HBufC* iLocationText; |
|
119 // Own:Field left button |
|
120 CMRButton* iFieldButton; |
|
121 // Own: Waypoint icon |
|
122 CMRImage* iWaypointIcon; |
|
123 // Field editor line count |
|
124 TInt iLineCount; |
|
125 // Own: Background for the editor when it is focused |
|
126 CAknsBasicBackgroundControlContext* iBgControlContext; |
|
127 // Field rect for comparison purposes |
|
128 TRect iFieldRect; |
|
129 /// Own: Stylus popup menu |
|
130 CMRStylusPopupMenu* iMenu; TBool iMenuIsShown; |
|
131 }; |
|
132 |
|
133 #endif // CESMRLOCATIONFIELD_H |
|
134 |