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 Description field for CESMRListComponent |
14 * Description: ESMR Description field. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef CESMRDESCRIPTIONFIELD_H |
19 #ifndef CESMRDESCRIPTIONFIELD_H |
20 #define CESMRDESCRIPTIONFIELD_H |
20 #define CESMRDESCRIPTIONFIELD_H |
21 |
21 |
|
22 #include <e32base.h> |
22 #include <eikedwob.h> |
23 #include <eikedwob.h> |
23 #include <frmtlay.h> |
24 #include <frmtlay.h> |
24 #include "cesmrfield.h" |
25 #include "cesmrfield.h" |
25 |
26 |
26 class CESMREditor; |
27 class CESMREditor; |
27 class CCalEntry; |
28 class CCalEntry; |
28 class CAknsFrameBackgroundControlContext; |
|
29 class CESMRRichTextLink; |
29 class CESMRRichTextLink; |
30 class CESMRFeatureSettings; |
30 class CESMRFeatureSettings; |
|
31 class CAknsBasicBackgroundControlContext; |
|
32 class CESMRUrlParserPlugin; |
31 |
33 |
32 /** |
34 /** |
33 * This class is a custom field control that shows the description of calendar events |
35 * This class is a custom field control that shows the description of calendar events |
34 */ |
36 */ |
35 NONSHARABLE_CLASS( CESMRDescriptionField ): public CESMRField, |
37 NONSHARABLE_CLASS( CESMRDescriptionField ): public CESMRField, |
36 public MEikEdwinSizeObserver, |
38 public MEikEdwinSizeObserver, |
37 public MEikEdwinObserver |
39 public MEikEdwinObserver |
38 { |
40 { |
39 public: |
41 public: |
40 /** |
42 /** |
41 * Creates new CESMRDescriptionField object. Ownership |
43 * Creates new CESMRDescriptionField object. Ownership |
42 * is transferred to caller. |
44 * is transferred to caller. |
43 * @return Pointer to created object, |
45 * @return Pointer to created object, |
44 */ |
46 */ |
45 static CESMRDescriptionField* NewL(); |
47 static CESMRDescriptionField* NewL(); |
46 |
48 |
47 /** |
49 /** |
48 * C++ Destructor. |
50 * C++ Destructor. |
49 */ |
51 */ |
50 ~CESMRDescriptionField(); |
52 ~CESMRDescriptionField(); |
51 |
53 |
52 public: // From CESMRField |
54 public: // From CESMRField |
53 void InitializeL(); |
55 void InitializeL(); |
54 void InternalizeL( MESMRCalEntry& aEntry ); |
56 void InternalizeL( MESMRCalEntry& aEntry ); |
55 void ExternalizeL( MESMRCalEntry& aEntry ); |
57 void ExternalizeL( MESMRCalEntry& aEntry ); |
56 void SetOutlineFocusL( TBool aFocus ); |
58 void SetOutlineFocusL( TBool aFocus ); |
57 TInt ExpandedHeight() const; |
59 TInt GetVerticalFocusPosition(); |
58 TInt GetVerticalFocusPosition(); |
60 void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); |
59 void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); |
61 void ListObserverSet(); |
60 void ListObserverSet(); |
62 TBool ExecuteGenericCommandL( TInt aCommand ); |
61 void ExecuteGenericCommandL( TInt aCommand ); |
|
62 public: // From CCoeControl |
|
63 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
|
64 void ActivateL(); |
|
65 void PositionChanged(); |
|
66 |
63 |
67 public: // From MEikEdwinSizeObserver |
64 public: // From CCoeControl |
68 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); |
65 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
|
66 TInt CountComponentControls() const; |
|
67 CCoeControl* ComponentControl( TInt aInd ) const; |
|
68 void SizeChanged(); |
|
69 TSize MinimumSize(); |
|
70 void SetContainerWindowL( |
|
71 const CCoeControl& aContainer ); |
69 |
72 |
70 public: // From MEikEdwinObserver |
73 public: // From MEikEdwinSizeObserver |
71 void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); |
74 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); |
72 |
|
73 private: |
|
74 /** |
|
75 * Constructor. |
|
76 */ |
|
77 CESMRDescriptionField(); |
|
78 |
75 |
79 /** |
76 public: // From MEikEdwinObserver |
80 * Second phase constructor. |
77 void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); |
81 */ |
|
82 void ConstructL(); |
|
83 |
78 |
84 /** |
79 private: |
85 * Converts raw URL text to a link in description editor field |
80 /** |
86 * |
81 * Constructor. |
87 * @param aEntry Calendar entry from which the description text is received |
82 */ |
88 */ |
83 CESMRDescriptionField(); |
89 void StoreLinkL( MESMRCalEntry& aEntry ); |
|
90 |
84 |
91 /** |
85 /** |
92 * Adds link to the beginning of text from editor field |
86 * Second phase constructor. |
93 * |
87 */ |
94 * @param abuf initial description text buffer before addition |
88 void ConstructL(); |
95 * |
|
96 * @return The description text buffer with link added |
|
97 */ |
|
98 HBufC* AddLinkToTextL( const TDesC& aBuf ); |
|
99 |
|
100 /** |
|
101 * Gets feature settings |
|
102 */ |
|
103 CESMRFeatureSettings& FeaturesL(); |
|
104 |
|
105 private: |
|
106 /** |
|
107 * Not owned. Description editor object. |
|
108 */ |
|
109 CESMREditor* iDescription; |
|
110 |
89 |
111 /** |
90 /** |
112 * Field size. |
91 * Converts raw URL text to a link in description editor field |
113 */ |
92 * |
114 TSize iSize; |
93 * @param aEntry Calendar entry from which the description text is received |
|
94 */ |
|
95 void StoreLinkL( MESMRCalEntry& aEntry ); |
115 |
96 |
116 /** |
97 /** |
117 * Background control context |
98 * Adds link to the beginning of text from editor field |
118 */ |
99 * |
119 MAknsControlContext* iBackground; |
100 * @param abuf initial description text buffer before addition |
|
101 * |
|
102 * @return The description text buffer with link added |
|
103 */ |
|
104 HBufC* AddLinkToTextL( const TDesC& aBuf ); |
120 |
105 |
121 /** |
106 /** |
122 * Actual background for the editor |
107 * Gets feature settings |
123 */ |
108 */ |
124 CAknsFrameBackgroundControlContext* iFrameBgContext; |
109 CESMRFeatureSettings& FeaturesL(); |
125 |
110 |
126 /** |
111 /** |
127 * Own: Location Url link |
112 * Converts location URL to vCal GEO value in calendar entry |
128 */ |
113 */ |
129 CESMRRichTextLink* iLocationLink; |
114 void StoreGeoValueL( CCalEntry& aCalEntry, |
130 |
115 const TDesC& aLocationUrl ); |
131 /** |
116 |
132 * Own: Feature settings. |
117 CESMRUrlParserPlugin& UrlParserL(); |
133 */ |
118 |
134 CESMRFeatureSettings* iFeatures; |
119 private: |
|
120 // Not owned. Description editor object. |
|
121 CESMREditor* iDescription; |
|
122 // Field size. |
|
123 TSize iSize; |
|
124 // Own: Location Url link |
|
125 CESMRRichTextLink* iLocationLink; |
|
126 // Own: Feature settings. |
|
127 CESMRFeatureSettings* iFeatures; |
|
128 // Field editor line count |
|
129 TInt iLineCount; |
|
130 // Own: Background for the editor when it is focused |
|
131 CAknsBasicBackgroundControlContext* iBgControlContext; |
|
132 // Field rect for comparison purposes |
|
133 TRect iFieldRect; |
|
134 // Own: URL parser plugin |
|
135 CESMRUrlParserPlugin* iUrlParser; |
135 }; |
136 }; |
136 |
137 |
137 #endif // CESMRDESCRIPTIONFIELD_H |
138 #endif // CESMRDESCRIPTIONFIELD_H |
138 |
139 |