1 /* |
|
2 * Copyright (c) 2007-2008 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: Class header for CWsfMainViewContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_WSFMAINVIEWCONTAINER_H |
|
19 #define C_WSFMAINVIEWCONTAINER_H |
|
20 |
|
21 // EXTERNAL INCLUDES |
|
22 #include <coecntrl.h> |
|
23 #include <AknIconArray.h> |
|
24 #include <AknsConstants.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CAknDoubleGraphicStyleListBox; |
|
28 class MWsfMainViewControllerPartner; |
|
29 class CAknNavigationDecorator; |
|
30 class CAknNavigationControlContainer; |
|
31 class CWsfMainView; |
|
32 |
|
33 // CLASS DEFINITION |
|
34 /** |
|
35 * The container of the Main view. |
|
36 * @since S60 v5.0 |
|
37 */ |
|
38 class CWsfMainViewContainer : public CCoeControl |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor |
|
44 * @since S60 5.0 |
|
45 * @param aRect gives the correct TRect for construction. |
|
46 * @return instance of CWsfMainViewContainer class |
|
47 */ |
|
48 static CWsfMainViewContainer* NewL( const TRect& aRect, |
|
49 CWsfMainView* aParentView ); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. Leaves the object on CleanupStack |
|
53 * @since S60 5.0 |
|
54 * @param aRect gives the correct TRect for construction. |
|
55 * @return instance of CWsfMainViewContainer class |
|
56 */ |
|
57 static CWsfMainViewContainer* NewLC( const TRect& aRect, |
|
58 CWsfMainView* aParentView ); |
|
59 |
|
60 /** |
|
61 * Destructor of CWsfMainViewContainer class |
|
62 * @since S60 5.0 |
|
63 */ |
|
64 ~CWsfMainViewContainer(); |
|
65 |
|
66 private: // Constructors |
|
67 |
|
68 /** |
|
69 * Default C++ constructor |
|
70 * @since S60 5.0 |
|
71 */ |
|
72 CWsfMainViewContainer(); |
|
73 |
|
74 /** |
|
75 * 2nd phase constructor |
|
76 * @since S60 5.0 |
|
77 * @param aRect gives the correct TRect for construction. |
|
78 */ |
|
79 void ConstructL( const TRect& aRect, CWsfMainView* aParentView ); |
|
80 |
|
81 public: // New methods |
|
82 |
|
83 /** |
|
84 * Update the contents of control |
|
85 * Set the focus on aCurrentImte |
|
86 * @param aItemTextArray text of the current item |
|
87 * @param aCurrentItem index of the current item |
|
88 */ |
|
89 void UpdateHotSpotsL( MDesCArray* aItemTextArray, |
|
90 TInt aCurrentItem ); |
|
91 |
|
92 /** |
|
93 * Gives back the index of the selected item |
|
94 * @return the index of the selected item |
|
95 */ |
|
96 TInt SelectedItem(); |
|
97 |
|
98 /** |
|
99 * Set partner interface to container |
|
100 * @param aPartner - partner interface |
|
101 */ |
|
102 void SetPartner( MWsfMainViewControllerPartner& aPartner ); |
|
103 |
|
104 /** |
|
105 * Refresh the content of Navi pane and |
|
106 * Push it to stack. |
|
107 * @param aPaneText - text to be show on pane |
|
108 */ |
|
109 void UpdateNaviPaneL( const TDesC& aPaneText ); |
|
110 |
|
111 /** |
|
112 * Returns pointer to the listbox. |
|
113 * @return pointer to the listbox. |
|
114 */ |
|
115 CAknDoubleGraphicStyleListBox* ListBox() const; |
|
116 |
|
117 protected: // Functions from CoeControl |
|
118 |
|
119 /** |
|
120 * From CCoeControl. |
|
121 * Responds to changes to the size and position of the contents |
|
122 * of this control. |
|
123 */ |
|
124 void SizeChanged(); |
|
125 |
|
126 /** |
|
127 * From CCoeControl. |
|
128 * Gets the number of controls contained in a compound control. |
|
129 * @return the number of controls this component contains. |
|
130 */ |
|
131 TInt CountComponentControls() const; |
|
132 |
|
133 /** |
|
134 * From CCoeControl. |
|
135 * Gets an indexed component of a compound control. |
|
136 * @return The required component control. |
|
137 */ |
|
138 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
139 |
|
140 /** |
|
141 * From CCoeControl. |
|
142 * Handles key events. |
|
143 * @param aKeyEvent key event. |
|
144 * @param aType type of key event. |
|
145 */ |
|
146 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
147 TEventCode aType ); |
|
148 |
|
149 /** |
|
150 * From CCoeControl, |
|
151 * used for sclable ui and landscape support. |
|
152 * Handles a change to the control's resources. |
|
153 * @param aType type of change. |
|
154 */ |
|
155 void HandleResourceChange( TInt aType ); |
|
156 |
|
157 /** |
|
158 * From CCoeControl. |
|
159 * Returns the help context |
|
160 * @param aContext the returned help context |
|
161 */ |
|
162 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
163 |
|
164 |
|
165 private: // New methods |
|
166 |
|
167 /** |
|
168 * Create the iconarray. Derived classes please don't forget that the |
|
169 * 0th icon must be the markable listbox's mark icon. |
|
170 * @return The created iconarray. Owner is the caller. |
|
171 */ |
|
172 CAknIconArray* LoadGraphicsL(); |
|
173 |
|
174 /** |
|
175 * Creates a new icon of desired type. |
|
176 * @param aIconId UID Icon type UID of the icon to be created. |
|
177 * @return Pointer of the icon. |
|
178 */ |
|
179 CGulIcon* LoadIconLC( TInt aIconId ); |
|
180 |
|
181 /** |
|
182 * Creates a new icon of desired type. |
|
183 * @param aIconId UID Icon type UID of the icon to be created. |
|
184 * @return Pointer of the icon. |
|
185 */ |
|
186 CGulIcon* LoadBlackIconLC( TInt aIconId ); |
|
187 |
|
188 /** |
|
189 * Creates a new icon of desired type. |
|
190 * @param aAknItemId An Akvon skin item ID of the graphical item |
|
191 * (e.g. an icon) to load. |
|
192 * @param aIconId UID Icon type UID of the icon to be created. |
|
193 * @return Pointer of the icon. |
|
194 */ |
|
195 CGulIcon* LoadSkinnableIconLC( const TAknsItemID aAknItemId, |
|
196 const TInt aIconId ); |
|
197 |
|
198 /** |
|
199 * Creates a new icon of desired type. |
|
200 * @param aAknItemId An Akvon skin item ID of the graphical item |
|
201 * (e.g. an icon) to load. |
|
202 * @param aIconId UID Icon type UID of the icon to be created. |
|
203 * @return Pointer of the icon. |
|
204 */ |
|
205 CGulIcon* LoadSkinnableBlackIconLC( const TAknsItemID aAknItemId, |
|
206 const TInt aIconId ); |
|
207 |
|
208 /** |
|
209 * CleanUp for NaviPane |
|
210 */ |
|
211 void PopNaviPane(); |
|
212 |
|
213 /** |
|
214 * Get the Navipane from the framework |
|
215 */ |
|
216 void GetPanesL(); |
|
217 |
|
218 /** |
|
219 * Set the icons for the ListBox |
|
220 */ |
|
221 void SetListboxIconsL(); |
|
222 |
|
223 /** |
|
224 * Cleanup function for a flat pointer array |
|
225 * @since S60 5.0 |
|
226 * @param aArray The array whose elements are to be cleaned up |
|
227 */ |
|
228 static void CleanUpResetAndDestroy( TAny* aArray ); |
|
229 |
|
230 /* |
|
231 * Parses the string into ui component data |
|
232 * @param aString - a string into ui |
|
233 * @return - TBool - ETrue if connecting is found |
|
234 */ |
|
235 TBool ParseStringForAnimationL( TDes& aString ); |
|
236 |
|
237 /** |
|
238 * Set connecting status on. |
|
239 */ |
|
240 void StartConnectingAnimationL(); |
|
241 |
|
242 /** |
|
243 * Set connecting status off. |
|
244 */ |
|
245 void StopConnectingAnimation(); |
|
246 |
|
247 /** |
|
248 * Steps the connecting animation |
|
249 * @param ptr Pointer to an instance of this class |
|
250 */ |
|
251 static TInt DoConnectingAnimationStepL( TAny* ptr ); |
|
252 |
|
253 /** |
|
254 * Steps the connecting animation |
|
255 */ |
|
256 void DoConnectingAnimationStepL(); |
|
257 |
|
258 /** |
|
259 * Initialize the connecting animation |
|
260 */ |
|
261 void InitializeConnectingAnimation(); |
|
262 |
|
263 /* |
|
264 * Step the animation |
|
265 */ |
|
266 void AnimateConnecting(); |
|
267 |
|
268 private: // Data |
|
269 |
|
270 /* |
|
271 * Pointer to the listbox |
|
272 */ |
|
273 CAknDoubleGraphicStyleListBox* iListBox; |
|
274 |
|
275 /** |
|
276 * Partner reference |
|
277 * Ref. |
|
278 */ |
|
279 MWsfMainViewControllerPartner* iPartner; |
|
280 |
|
281 /** |
|
282 * NaviDecorator pointer for NaviPane. |
|
283 * Own. |
|
284 */ |
|
285 CAknNavigationDecorator* iNaviDecorator; |
|
286 |
|
287 /** |
|
288 * NaviDecorator's default control pointer For NaviPane. |
|
289 * Ref. |
|
290 */ |
|
291 CAknNavigationControlContainer* iNaviPane; |
|
292 |
|
293 /** |
|
294 * List of animation states of connecting icon |
|
295 */ |
|
296 TFixedArray<TInt, 4> iConnectingIcons; |
|
297 |
|
298 /** |
|
299 * The connecting animation frame index |
|
300 */ |
|
301 TInt iConnectingIndex; |
|
302 |
|
303 /** |
|
304 * The periodic that steps the animation |
|
305 */ |
|
306 CPeriodic* iAnimationPeriodic; |
|
307 |
|
308 /** |
|
309 * Constants for 'Connecting' text |
|
310 * Own. |
|
311 */ |
|
312 HBufC* iStatusConnecting; |
|
313 |
|
314 /** |
|
315 * Reference to the parent view |
|
316 */ |
|
317 CWsfMainView* iParentView; |
|
318 |
|
319 }; |
|
320 |
|
321 |
|
322 |
|
323 #endif // C_WSFMAINVIEWCONTAINER_H |
|
324 |
|
325 // End of file |
|