|
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 Description field. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRDESCRIPTIONFIELD_H |
|
20 #define CESMRDESCRIPTIONFIELD_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <eikedwob.h> |
|
24 #include <frmtlay.h> |
|
25 #include "cesmrfield.h" |
|
26 |
|
27 class CESMREditor; |
|
28 class CCalEntry; |
|
29 class CESMRRichTextLink; |
|
30 class CESMRFeatureSettings; |
|
31 class CAknsBasicBackgroundControlContext; |
|
32 class CESMRUrlParserPlugin; |
|
33 |
|
34 /** |
|
35 * This class is a custom field control that shows the description of calendar events |
|
36 */ |
|
37 NONSHARABLE_CLASS( CESMRDescriptionField ): public CESMRField, |
|
38 public MEikEdwinSizeObserver, |
|
39 public MEikEdwinObserver |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Creates new CESMRDescriptionField object. Ownership |
|
44 * is transferred to caller. |
|
45 * @return Pointer to created object, |
|
46 */ |
|
47 static CESMRDescriptionField* NewL(); |
|
48 |
|
49 /** |
|
50 * C++ Destructor. |
|
51 */ |
|
52 ~CESMRDescriptionField(); |
|
53 |
|
54 public: // From CESMRField |
|
55 void InitializeL(); |
|
56 void InternalizeL( MESMRCalEntry& aEntry ); |
|
57 void ExternalizeL( MESMRCalEntry& aEntry ); |
|
58 void SetOutlineFocusL( TBool aFocus ); |
|
59 TInt GetVerticalFocusPosition(); |
|
60 void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); |
|
61 void ListObserverSet(); |
|
62 TBool ExecuteGenericCommandL( TInt aCommand ); |
|
63 |
|
64 public: // From CCoeControl |
|
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 ); |
|
72 |
|
73 public: // From MEikEdwinSizeObserver |
|
74 TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); |
|
75 |
|
76 public: // From MEikEdwinObserver |
|
77 void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); |
|
78 |
|
79 private: |
|
80 /** |
|
81 * Constructor. |
|
82 */ |
|
83 CESMRDescriptionField(); |
|
84 |
|
85 /** |
|
86 * Second phase constructor. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 /** |
|
91 * Converts raw URL text to a link in description editor field |
|
92 * |
|
93 * @param aEntry Calendar entry from which the description text is received |
|
94 */ |
|
95 void StoreLinkL( MESMRCalEntry& aEntry ); |
|
96 |
|
97 /** |
|
98 * Adds link to the beginning of text from editor field |
|
99 * |
|
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 ); |
|
105 |
|
106 /** |
|
107 * Gets feature settings |
|
108 */ |
|
109 CESMRFeatureSettings& FeaturesL(); |
|
110 |
|
111 /** |
|
112 * Converts location URL to vCal GEO value in calendar entry |
|
113 */ |
|
114 void StoreGeoValueL( CCalEntry& aCalEntry, |
|
115 const TDesC& aLocationUrl ); |
|
116 |
|
117 CESMRUrlParserPlugin& UrlParserL(); |
|
118 |
|
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; |
|
136 }; |
|
137 |
|
138 #endif // CESMRDESCRIPTIONFIELD_H |
|
139 |