|
1 /* |
|
2 * Copyright (c) 2008-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: Cloud view implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_GLXCLOUDVIEWIMP_H |
|
22 #define C_GLXCLOUDVIEWIMP_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <AknLayout2Def.h> |
|
26 #include <alf/alfanchorlayout.h> |
|
27 |
|
28 #include "mglxcloudviewmskobserver.h" |
|
29 #include "mglxenterkeyeventobserver.h" |
|
30 |
|
31 #include "glxcloudview.h" //base class |
|
32 #include "mglxcloudviewlayoutobserver.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CGlxCloudViewControl; |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * CGlxCloudViewImp |
|
42 * Implementation class for Cloud control |
|
43 */ |
|
44 namespace Alf |
|
45 { |
|
46 class IAlfScrollBarWidget; |
|
47 class IAlfScrollBarDefaultBaseElement; |
|
48 |
|
49 |
|
50 NONSHARABLE_CLASS(CGlxCloudViewImp): public CGlxCloudView, |
|
51 public MGlxCloudViewMskObserver, |
|
52 public MGlxEnterKeyEventObserver, |
|
53 public MGlxCloudViewLayoutObserver |
|
54 { |
|
55 public: |
|
56 |
|
57 /** |
|
58 * @since S60 3.2 |
|
59 * Perform the two phase construction |
|
60 * @param aMediaListFactory - Handle to the medialist provider |
|
61 * @param aViewResId - Resource id of the View |
|
62 * @param aTitleResId - Resource id for the Title text |
|
63 * @param aEmptyListResId - Resource id for the empty listbox text |
|
64 * @param aSoftKeyResId - Resource id for the softkey texts |
|
65 * @param aSoftkeyMskDisabledId -Respource id for Msk Disabled |
|
66 * @return Pointer to newly created object |
|
67 */ |
|
68 IMPORT_C static CGlxCloudViewImp *NewL(MGlxMediaListFactory |
|
69 *aMediaListFactory, const TDesC &aFileName, TInt aViewResId, |
|
70 TInt aEmptyListResId, TInt aSoftKeyResId, TInt aSoftkeyMskDisabledId); |
|
71 |
|
72 /** |
|
73 * @since S60 3.2 |
|
74 * Perform the two phase construction |
|
75 * @param aMediaListFactory - Handle to the medialist provider |
|
76 * @param aViewResId - Resource id of the View |
|
77 * @param aTitleResId - Resource id for the Title text |
|
78 * @param aEmptyListResId - Resource id for the empty listbox text |
|
79 * @param aSoftKeyResId - Resource id for the softkey texts |
|
80 * @param aSoftkeyMskDisabledId -Respource id for Msk Disabled |
|
81 * @return Pointer to newly created object |
|
82 */ |
|
83 IMPORT_C static CGlxCloudViewImp *NewLC(MGlxMediaListFactory |
|
84 *aMediaListFactory, const TDesC &aFileName, TInt aViewResId, |
|
85 TInt aEmptyListResId, TInt aSoftKeyResId, TInt aSoftkeyMskDisabledId); |
|
86 |
|
87 /** |
|
88 * Destructor. |
|
89 */ |
|
90 virtual ~CGlxCloudViewImp(); |
|
91 |
|
92 public: // MGlxCloudViewMskObserver |
|
93 |
|
94 /** |
|
95 * Called when msk status change is required |
|
96 * @param aDirection The direction of the focus change |
|
97 */ |
|
98 void HandleMskChangedL(TBool aMskEnabled); |
|
99 public: // MGlxEnterKeyEventObserver |
|
100 /** |
|
101 * Called when Key Event is handled. |
|
102 */ |
|
103 |
|
104 void HandleEnterKeyEventL(TInt aCommand); |
|
105 |
|
106 public: |
|
107 // MGlxCloudViewLayoutObserver |
|
108 /** |
|
109 * Called when layout is changed |
|
110 */ |
|
111 void HandleLayoutChanged(); |
|
112 |
|
113 protected: |
|
114 // From CGlxViewBase |
|
115 |
|
116 /** |
|
117 * @since S60 3.2 |
|
118 * @param aCommand command to be handled |
|
119 */ |
|
120 virtual TBool HandleViewCommandL(TInt aCommand); |
|
121 |
|
122 |
|
123 private: |
|
124 |
|
125 /** |
|
126 * @function C++ default constructor |
|
127 * @since S60 3.2 |
|
128 */ |
|
129 CGlxCloudViewImp(TInt aSoftKeyResId,TInt aSoftkeyMskDisabledId); |
|
130 |
|
131 /** |
|
132 * @function ControlGroupId |
|
133 * @since S60 3.2 |
|
134 * @returns Control group id |
|
135 */ |
|
136 TInt ControlGroupId()const; |
|
137 |
|
138 /** |
|
139 * @since S60 3.2 |
|
140 * Perform the two phase construction |
|
141 * @param aMediaListFactory - Handle to the medialist provider |
|
142 * @param aViewResId - Resource id of the View |
|
143 * @param aTitleResId - Resource id for the Title text |
|
144 * @param aEmptyListResId - Resource id for the empty listbox text |
|
145 * @param aSoftKeyResId - Resource id for the softkey texts |
|
146 */ |
|
147 void ConstructL(MGlxMediaListFactory *aMediaListFactory, const TDesC |
|
148 &aFileName, TInt aViewResId, TInt aEmptyListResId, TInt aSoftKeyResId); |
|
149 |
|
150 // from base class CAknView |
|
151 |
|
152 /** |
|
153 * @since S60 3.2 |
|
154 * Returns the unique identifier of the view |
|
155 * @return Unique identifier |
|
156 */ |
|
157 TUid Id()const; |
|
158 |
|
159 /** |
|
160 * @since S60 3.2 |
|
161 * This will be called when the view is activated |
|
162 * @param aPrevViewId Specifies the view previously active. |
|
163 * @param aCustomMessageId Specifies the message type. |
|
164 * @param aCustomMessage The activation message. |
|
165 */ |
|
166 void DoMLViewActivateL(const TVwsViewId &aPrevViewId, TUid |
|
167 aCustomMessageId, const TDesC8 &aCustomMessage); |
|
168 |
|
169 /** |
|
170 * @since S60 3.2 |
|
171 * This will be called when the view is deactivated |
|
172 */ |
|
173 void DoMLViewDeactivate(); |
|
174 |
|
175 /** |
|
176 * Cleanup the visuals: called after deactivate animation is complete, |
|
177 * and when the view is destroyed |
|
178 */ |
|
179 void CleanupVisuals(); |
|
180 |
|
181 private: |
|
182 |
|
183 //added for scrollbar widget implementation |
|
184 void ConstructCloudControlL(); |
|
185 |
|
186 //set the rect for scrollbar |
|
187 void SetScrollBarRect(); |
|
188 |
|
189 |
|
190 private: |
|
191 // Data |
|
192 /**used for resource fetching */ |
|
193 TInt iResourceOffset; |
|
194 |
|
195 /**For Cloud View Control */ |
|
196 CGlxCloudViewControl *iCloudControl; |
|
197 |
|
198 /**variable for Alf display*/ |
|
199 CAlfDisplay* iDisplay; |
|
200 |
|
201 /** Empty listbox text */ |
|
202 HBufC* iEmptyListText; |
|
203 |
|
204 /** The animation being applied to the view */ |
|
205 MGlxAnimation* iViewAnimation; |
|
206 |
|
207 /**Resource id for MSk */ |
|
208 TInt iSoftKeyResId; |
|
209 |
|
210 /**Resource id for MSk Disabled */ |
|
211 TInt iSoftkeyMskDisabledId; |
|
212 |
|
213 //view widget |
|
214 IAlfViewWidget *iViewWidget; |
|
215 |
|
216 //scrollbar widget |
|
217 IAlfScrollBarWidget* iScrollWidget; |
|
218 |
|
219 IAlfScrollBarDefaultBaseElement* iScrollbarDefaultBaseElement; |
|
220 |
|
221 //scrollpane layout |
|
222 TAknWindowLineLayout iScrollPaneHandle; |
|
223 |
|
224 //anchor layout from the view widget |
|
225 CAlfAnchorLayout* iAnchorlayout; |
|
226 |
|
227 // save title text |
|
228 HBufC* iTitletext; |
|
229 |
|
230 }; |
|
231 } |
|
232 #endif // C_GLXTESTTILEVIEWIMP_H |
|
233 |
|
234 // End of File |