1 /* |
|
2 * Copyright (c) 2006 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: CCSXHLegacyTopicContainer class declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include <aknview.h> |
|
21 #include <eikedwob.h> |
|
22 #include <txtfrmat.h> |
|
23 |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CEikRichTextEditor; |
|
27 class CEikGlobalTextEditor; |
|
28 class CRichText; |
|
29 class CAknsBasicBackgroundControlContext; |
|
30 class CCSXHDocument; |
|
31 class CCSXHLegacyTOC2; |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * CCsHelpTopicContainer |
|
36 * container control class for legacy topic view |
|
37 * @lib etext.lib, eikcoctl.lib |
|
38 * @since 3.2 |
|
39 */ |
|
40 class CCSXHLegacyTopicContainer : public CCoeControl |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * @function NewL |
|
45 * @since S60 3.2 |
|
46 * Construct a CCSXHLegacyTopicContainer |
|
47 * and return a pointer to the created object |
|
48 * @param aRect - TRect Object |
|
49 * aDocument - Document Object |
|
50 * aTopic - LegacyTOC2 Pointer |
|
51 * @return a CCSXHLegacyTopicContainer Pointer |
|
52 */ |
|
53 static CCSXHLegacyTopicContainer* NewL(const TRect& aRect,CCSXHDocument |
|
54 &aDocument,CCSXHLegacyTOC2 *aTopic); |
|
55 |
|
56 /** |
|
57 * @function NewLC |
|
58 * @since S60 3.2 |
|
59 * Construct a CCSXHLegacyTopicContainer |
|
60 * and return a pointer to the created object using two phase constuction |
|
61 * @param aRect - TRect Object |
|
62 * aDocument - Document Object |
|
63 * aTopic - LegacyTOC2 Pointer |
|
64 * @return a CCSXHLegacyTopicContainer Pointer |
|
65 */ |
|
66 static CCSXHLegacyTopicContainer* NewLC(const TRect& aRect,CCSXHDocument |
|
67 &aDocument,CCSXHLegacyTOC2 *aTopic); |
|
68 |
|
69 /** |
|
70 * @function CCSXHLegacyTopicContainer |
|
71 * @since S60 3.2 |
|
72 * Construct a CCSXHLegacyTopicContainer |
|
73 * and return a pointer to the created object using two phase constuction |
|
74 * @param aDocument - Document Object |
|
75 * aTopic - LegacyTOC2 Pointer |
|
76 * @return a CCSXHHtmlTopicContainer Pointer |
|
77 */ |
|
78 CCSXHLegacyTopicContainer(CCSXHDocument &aDocument,CCSXHLegacyTOC2 *aTopic); |
|
79 |
|
80 /** |
|
81 * @function RefreshL |
|
82 * @since S60 3.2 |
|
83 * Used to Refresh the Content |
|
84 * @param aTopic - CCSXHLegacyTOC2 Object |
|
85 */ |
|
86 void RefreshL(CCSXHLegacyTOC2 *aTopic); |
|
87 |
|
88 /** |
|
89 @function ConstructL |
|
90 @since S60 3.2 |
|
91 Perform the second phase construction of a LegacyTopicContainer object |
|
92 @param aRect the rectangle this view will be drawn to |
|
93 */ void ConstructL(const TRect& aRect); |
|
94 |
|
95 /** |
|
96 * @The Mopsupply object gives the skin context to |
|
97 * @the scrollbar, so that the scrollbar is skinned |
|
98 * @according the skin parameters and look transparent |
|
99 */ |
|
100 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
101 |
|
102 /** |
|
103 * @function ~CCSXHLegacyTopicContainer |
|
104 * @since S60 3.2 |
|
105 * Destroy the object and release all memory objects |
|
106 */ |
|
107 virtual ~CCSXHLegacyTopicContainer(); |
|
108 |
|
109 public: // New functions |
|
110 /** |
|
111 * @function HandleResourceChange |
|
112 * @since S60 3.2 |
|
113 * Handles resource changes. |
|
114 * This function is called by framework when when e.g skin or locale is changed. |
|
115 * @param aType resource change type |
|
116 */ |
|
117 void HandleResourceChange(TInt aType); |
|
118 |
|
119 /** |
|
120 * @function HandleResourceChangeImpl |
|
121 * @since S60 3.2 |
|
122 * Handles resource changes. |
|
123 * Implementation function for resource change |
|
124 * @param aType resource change type |
|
125 */ |
|
126 void HandleResourceChangeImpl(TInt aType); |
|
127 |
|
128 |
|
129 protected: // New functions |
|
130 /** |
|
131 * @function SetTextL |
|
132 * @since S60 3.2 |
|
133 * Handles resource changes. |
|
134 * set topic's text to a rich text editor |
|
135 * @param aText help document |
|
136 */ |
|
137 void SetTextL(CRichText* aText); |
|
138 |
|
139 protected: // From base classes. |
|
140 /** |
|
141 * When focus is changed, called. |
|
142 * Set focus editor(viewer). |
|
143 * @function FocusChanged |
|
144 * @since 3.2 |
|
145 * @param aDrawNow used to determine whether or not |
|
146 * redraw should occur now, or later |
|
147 */ |
|
148 void FocusChanged(TDrawNow aDrawNow); |
|
149 |
|
150 |
|
151 private: // new function |
|
152 /** |
|
153 * Get rich text format from resource. |
|
154 * @function GetTextFormat |
|
155 * @since 3.2 |
|
156 */ |
|
157 void GetTextFormat(); |
|
158 |
|
159 /* |
|
160 * Format the rich text help data |
|
161 * @function FormatRichTextL |
|
162 * @since 3.2 |
|
163 * @param aText instance of the CRichText object to format |
|
164 */ |
|
165 void FormatRichTextL(CRichText& aText); |
|
166 |
|
167 private: // Functions from base classes |
|
168 /** |
|
169 * From CoeControl class |
|
170 * @function SizeChanged |
|
171 * @since S60 3.2 |
|
172 * re-allocates and re-sizes components. |
|
173 */ |
|
174 void SizeChanged(); |
|
175 |
|
176 /** |
|
177 * From CoeControl class |
|
178 * @function OfferKeyEventL |
|
179 * @since S60 3.2 |
|
180 * Progress Key Event |
|
181 * @param aKeyEvent the key event |
|
182 * @param aType EEventKey | EEventKeyUp | EEventKeyDown |
|
183 * @return EKeyWasConsumed if key event is processed, |
|
184 * otherwise EKeyWasNotConsumed |
|
185 */ |
|
186 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, |
|
187 TEventCode aType); |
|
188 |
|
189 /** |
|
190 * From CoeControl class |
|
191 * @function CountComponentControls |
|
192 * @since S60 3.2 |
|
193 * @return Number of child controls this has. |
|
194 */ |
|
195 TInt CountComponentControls() const; |
|
196 |
|
197 /** |
|
198 * From CoeControl class |
|
199 * @function ComponentControl |
|
200 * @since S60 3.2 |
|
201 * @param aIndex index of child controls |
|
202 * @retrun pointer to child control |
|
203 */ |
|
204 CCoeControl* ComponentControl(TInt aIndex) const; |
|
205 |
|
206 /** |
|
207 * From CoeControl class |
|
208 * @function Draw |
|
209 * @since S60 3.2 |
|
210 * Draw() for drawing the Background |
|
211 */ |
|
212 void Draw(const TRect& aRect) const; |
|
213 |
|
214 |
|
215 private: //data |
|
216 // to show help document |
|
217 CEikEdwin* iEdwin; |
|
218 |
|
219 // rich text format |
|
220 TCharFormat iCharFormat; |
|
221 TCharFormatMask iCharFormatMask; |
|
222 CAknsBasicBackgroundControlContext* iSkinContext; // skin data |
|
223 CRichText* iText; // skin data |
|
224 CCSXHDocument& iDocument; |
|
225 CCSXHLegacyTOC2* iTopic; |
|
226 }; |
|
227 // End of File |
|