|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef GLXFULLSCREENVIEW_H |
|
21 #define GLXFULLSCREENVIEW_H |
|
22 |
|
23 //Includes |
|
24 #include <hbeffect.h> |
|
25 |
|
26 //User Defined Includes |
|
27 #include <glxview.h> |
|
28 #include <glxcoverflow.h> |
|
29 |
|
30 #define NBR_ANIM_ITEM 2 |
|
31 |
|
32 //Orbit/Qt forward declartion |
|
33 class QTimer; |
|
34 class HbAction; |
|
35 class HbGridView; |
|
36 class HbMainWindow; |
|
37 class HbPushButton; |
|
38 class HbDocumentLoader; |
|
39 class QAbstractItemModel; |
|
40 class HbIconItem; |
|
41 |
|
42 //User Defined forward declartion |
|
43 class GlxZoomWidget; |
|
44 class GlxTvOutWrapper; |
|
45 |
|
46 /** |
|
47 * Class Description |
|
48 * This is full screen view class to show the image in fullscreen, zoom the image and |
|
49 * browse the image through coverflow and imagstrip |
|
50 */ |
|
51 class GlxFullScreenView : public GlxView |
|
52 { |
|
53 Q_OBJECT |
|
54 public : |
|
55 /** |
|
56 * Constructor |
|
57 * @param - HbMainWindow object |
|
58 * @param - fullscreen docloader object |
|
59 */ |
|
60 GlxFullScreenView(HbMainWindow *window,HbDocumentLoader *DocLoader); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 ~GlxFullScreenView(); |
|
66 |
|
67 /** |
|
68 * activate() |
|
69 * ///From GlxView |
|
70 */ |
|
71 void activate() ; |
|
72 |
|
73 /** |
|
74 * deActivate() |
|
75 * ///From GlxView |
|
76 */ |
|
77 void deActivate(); |
|
78 |
|
79 /** |
|
80 * initializeView() - Initialize the coverflow and partially creates the coverflow with one image |
|
81 * to make the widget light weight in order to make transition smooth |
|
82 * and also loads the widgets. |
|
83 * @param - pointer of model to retreive the view releted data |
|
84 * @parm - previous view pointer to get the staus of fullscreen mode of the view |
|
85 */ |
|
86 void initializeView( QAbstractItemModel *model, GlxView *preView ); |
|
87 |
|
88 /** |
|
89 * resetView() - resets the view, with just one icon being present in the widget |
|
90 * to make the widget light weight in order to make transition smooth |
|
91 */ |
|
92 void resetView(); |
|
93 |
|
94 /** |
|
95 * setmodel() |
|
96 * ///from GlxView |
|
97 */ |
|
98 void setModel(QAbstractItemModel *model); |
|
99 |
|
100 /** |
|
101 * setModelContext() - to set the context mode of the model. |
|
102 */ |
|
103 void setModelContext ( ); |
|
104 |
|
105 /** |
|
106 * cleanUp() - To clean the custom widgets. |
|
107 */ |
|
108 void cleanUp(); |
|
109 |
|
110 /** |
|
111 * getAnimationItem() - To return the animation object to play the view transition animation. |
|
112 * @return pointer of widget on which animation are suppose to play. |
|
113 */ |
|
114 QGraphicsItem * getAnimationItem(GlxEffect transitionEffect); |
|
115 |
|
116 |
|
117 public slots: |
|
118 /** |
|
119 * orientationChanged() - Slot to upadte the layout when orientation of device has changed |
|
120 * @param new orientation |
|
121 */ |
|
122 void orientationChanged( Qt::Orientation ); |
|
123 |
|
124 /** |
|
125 * activateUI() - To show the ui content like status bar, toolbar, and imzge strip. |
|
126 */ |
|
127 void activateUI(); |
|
128 |
|
129 /** |
|
130 * hideUi() - To hide the ui content like status bar, toolbar, and imzge strip. |
|
131 */ |
|
132 void hideUi(); |
|
133 |
|
134 /** |
|
135 * changeSelectedIndex() - Call back when index is chnaged due to browsing of images in coverflow |
|
136 * It will update the selected index in model and notify other widget about index changed. |
|
137 * @param - index of new selected item. |
|
138 */ |
|
139 void changeSelectedIndex(const QModelIndex &index); |
|
140 |
|
141 /** |
|
142 * indexChanged() - call back when index is changed from the image strip. |
|
143 * It will update the selected index in model and notify other widget about index changed. |
|
144 * @param - index of new selected item. |
|
145 */ |
|
146 void indexChanged(const QModelIndex &index ); |
|
147 |
|
148 /** |
|
149 * scrollingStarted() - Call back function to get notification of when scrolling of |
|
150 * image strip is start. |
|
151 */ |
|
152 void scrollingStarted(); |
|
153 |
|
154 /** |
|
155 * scrollingEnded() - Call back function to get notification of when scrolling of |
|
156 * image strip is stop. |
|
157 */ |
|
158 void scrollingEnded(); |
|
159 |
|
160 /** |
|
161 * pressed() - Call back function to get notification of user pressed mouse key or touch the fingure. |
|
162 * @param - index of selected item. |
|
163 */ |
|
164 void pressed(const QModelIndex &index ); |
|
165 |
|
166 /** |
|
167 * released() - Call back function to get notification of user released mouse key or released the fingure. |
|
168 * @param - index of new selected item. |
|
169 */ |
|
170 void released(const QModelIndex &index ); |
|
171 |
|
172 /** |
|
173 * setVisvalWindowIndex() - Set the viisual window index of medialist. |
|
174 */ |
|
175 void setVisvalWindowIndex(); |
|
176 |
|
177 /** |
|
178 * coverFlowEventHandle() - Handle the event generated by cover flow. |
|
179 * @param - cover flow event type |
|
180 */ |
|
181 void coverFlowEventHandle( GlxCoverFlowEvent e); |
|
182 |
|
183 /** |
|
184 * effectFinished() - call back when ui on\off effect has finished. |
|
185 * @param - staus of effect |
|
186 */ |
|
187 void effectFinished( const HbEffect::EffectStatus ); |
|
188 |
|
189 /** |
|
190 * imageSelectionEffectFinished() - call back when ui image strip selection effect has been finished. |
|
191 * @param - staus of effect |
|
192 */ |
|
193 void imageSelectionEffectFinished( const HbEffect::EffectStatus ); |
|
194 |
|
195 /** |
|
196 * orientChangeAnimFinished() - call back when custom orientation change effect has been finished. |
|
197 * @param - staus of effect |
|
198 */ |
|
199 void orientChangeAnimFinished( const HbEffect::EffectStatus ); |
|
200 |
|
201 /** |
|
202 * zoomOrientChangeAnimFinished() - call back when zoom orientation change effect has been finished. |
|
203 * @param - staus of effect |
|
204 */ |
|
205 void zoomOrientChangeAnimFinished( const HbEffect::EffectStatus status ); |
|
206 |
|
207 /** |
|
208 * effectFinished - call back when ui on\off effect has finished |
|
209 * @param - staus of effect |
|
210 */ |
|
211 void handleToolBarAction(); |
|
212 |
|
213 /** |
|
214 * In case of image fetcher handle select command and emit selected index and model |
|
215 */ |
|
216 void handleFSSelect(); |
|
217 |
|
218 protected : |
|
219 /** |
|
220 * eventFilter - To handle the application foregrond and background event |
|
221 * ///From HbView |
|
222 */ |
|
223 bool eventFilter(QObject *obj, QEvent *ev); |
|
224 |
|
225 private: |
|
226 /** |
|
227 * loadWidgets() - The widgets are retrieved from the docml |
|
228 */ |
|
229 void loadWidgets(); |
|
230 |
|
231 /** |
|
232 * loadViewSection() - Loads the corresponding sections in the docml while the orentation is changed. |
|
233 */ |
|
234 void loadViewSection(); |
|
235 |
|
236 /** |
|
237 * setLayout() - To set the widgets laout. |
|
238 */ |
|
239 void setLayout(); |
|
240 |
|
241 /** |
|
242 * addConnection() - Add the call back of the widgets. |
|
243 */ |
|
244 void addConnection(); |
|
245 |
|
246 /** |
|
247 * removeConnection() - Remove the call back of widgets. |
|
248 */ |
|
249 void removeConnection(); |
|
250 |
|
251 /** |
|
252 * setImageStripModel() - set the image strip model. |
|
253 */ |
|
254 void setImageStripModel(); |
|
255 |
|
256 /** |
|
257 * loadFullScreenToolBar() - load the fullscreen tool bar from the docml. |
|
258 */ |
|
259 void loadFullScreenToolBar(); |
|
260 |
|
261 /** |
|
262 * addToolBarAction() - Crete and add the toolbar acton in toolbar. |
|
263 * @param - coomand id to recognise the action. |
|
264 * @param - toolbar action icon. |
|
265 * @param - action name it is used for automation of test cases. |
|
266 */ |
|
267 void addToolBarAction( int commandId, const QString &iconName, const QString &name) ; |
|
268 |
|
269 /** |
|
270 * initAnimationItem() - Initialise the custom animation item. |
|
271 */ |
|
272 void initAnimationItem(); |
|
273 |
|
274 /** |
|
275 * imageSelectionAnimation() - To trigger the image setection animtaion form the imge strip. |
|
276 */ |
|
277 void imageSelectionAnimation( const QModelIndex &index ); |
|
278 |
|
279 /** |
|
280 * cancelSelectionAnimation()- To cancel the image selection animation. |
|
281 */ |
|
282 void cancelSelectionAnimation( ); |
|
283 |
|
284 /** |
|
285 * playOrientChangeAnim() - To trigger the custom orientation change animation. |
|
286 */ |
|
287 void playOrientChangeAnim(); |
|
288 |
|
289 /** |
|
290 * playZoomOrientChangeAnim() - To trigger the custom orientation change animation for zoom image. |
|
291 */ |
|
292 void playZoomOrientChangeAnim(); |
|
293 |
|
294 /** |
|
295 * get the substate of fullscreen state. |
|
296 */ |
|
297 int getSubState(); |
|
298 |
|
299 /** |
|
300 * setHdmiModel() - set the image strip model. |
|
301 * @param - model |
|
302 */ |
|
303 void setHdmiModel( QAbstractItemModel *model ); |
|
304 |
|
305 private: |
|
306 QAbstractItemModel *mModel; //no ownership |
|
307 HbMainWindow *mWindow; //no ownership |
|
308 GlxCoverFlow *mCoverFlow; |
|
309 HbGridView *mImageStrip; |
|
310 QTimer *mUiOffTimer; //use for ui off after 30 sec |
|
311 HbIconItem *mIconItems[ NBR_ANIM_ITEM ] ; //temporary item for play the image strip select animation |
|
312 HbIconItem *mBackGroundItem; |
|
313 GlxTvOutWrapper *mTvOutWrapper; |
|
314 HbToolBar *mFullScreenToolBar; //Fullscreen Toolbar |
|
315 //for Zoom |
|
316 GlxZoomWidget *mZoomWidget; |
|
317 HbDocumentLoader *mDocLoader; |
|
318 |
|
319 bool mUiOff; // to check the current status of ui on / off |
|
320 }; |
|
321 |
|
322 #endif /* GLXFULLSCREENVIEW_H_ */ |