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