30
|
1 |
/*
|
|
2 |
* Copyright (c) 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: Videolist view class definition
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef VIDEOLISTVIEW_H
|
|
19 |
#define VIDEOLISTVIEW_H
|
|
20 |
|
|
21 |
#include <hbview.h>
|
|
22 |
#include <qnamespace.h>
|
34
|
23 |
#include <hbaction.h>
|
|
24 |
|
|
25 |
#include "videohintwidget.h"
|
30
|
26 |
|
|
27 |
class QGraphicsItem;
|
63
|
28 |
class QVariant;
|
|
29 |
class HbToolBarExtension;
|
|
30 |
class TMPXItemId;
|
30
|
31 |
class VideoListWidget;
|
|
32 |
class VideoCollectionViewUtils;
|
|
33 |
class VideoCollectionWrapper;
|
|
34 |
class VideoCollectionUiLoader;
|
|
35 |
class VideoServices;
|
63
|
36 |
class VideoListToolbar;
|
|
37 |
class VideoListMenu;
|
30
|
38 |
|
|
39 |
/**
|
|
40 |
* Class acts as an container for widgets that are used to display different
|
|
41 |
* data: all videos, video collections or video services.
|
|
42 |
*
|
|
43 |
* Class is also responsible to mainatain correct widget active selected by the user's
|
|
44 |
* tap from the toolbar and creating and maintaining main menu commonly used by all widgets.
|
|
45 |
*
|
|
46 |
*/
|
|
47 |
class VideoListView : public HbView
|
|
48 |
{
|
|
49 |
Q_OBJECT
|
|
50 |
|
|
51 |
public:
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Contructor.
|
|
55 |
* @param uiLoader VideoCollectionUiLoader instance for this view
|
|
56 |
* @param parent parent of this view
|
|
57 |
*/
|
|
58 |
VideoListView(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent = 0);
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Destructor.
|
|
62 |
*
|
|
63 |
*/
|
|
64 |
~VideoListView();
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Creates and initializes view objects, toolbar and menu and connects signals
|
|
68 |
*
|
|
69 |
* @return 0 if ok, < 0 if intialisation fails
|
|
70 |
*/
|
|
71 |
int initializeView();
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Activates current widget to be shown, enables menu and connects
|
|
75 |
* orientation change signals.
|
|
76 |
*
|
36
|
77 |
* @param itemId, Id of the widget which is to be activated
|
30
|
78 |
* @return 0 activation ok, < 0 if activation fails
|
|
79 |
*/
|
41
|
80 |
int activateView(TMPXItemId &itemId);
|
30
|
81 |
|
|
82 |
/**
|
|
83 |
* Deactivates current widget, disables menu and disconnects
|
|
84 |
* orientation change signals.
|
|
85 |
*
|
|
86 |
*/
|
|
87 |
void deactivateView();
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Back implementation.
|
|
91 |
* Not used at the moment
|
|
92 |
*
|
|
93 |
*/
|
|
94 |
void back();
|
63
|
95 |
|
|
96 |
/**
|
|
97 |
* Returns pointer to currently active VideoListWidget. Null if no
|
|
98 |
* active widget yet.
|
|
99 |
*
|
|
100 |
* @return Currently active VideoListWidget, or null if no widget active.
|
|
101 |
*/
|
|
102 |
VideoListWidget* getCurrentList();
|
30
|
103 |
|
|
104 |
signals:
|
|
105 |
|
|
106 |
/**
|
|
107 |
* Command signal. Should be connected to the
|
|
108 |
* plugin interface's command -signal in order to
|
|
109 |
* get the emitted commands transported uotside plugin.
|
|
110 |
*
|
|
111 |
* @param int command id
|
|
112 |
*/
|
|
113 |
void command(int);
|
35
|
114 |
|
|
115 |
/**
|
|
116 |
* Signaled to do delayed loading of components not loaded initially at start up phase
|
|
117 |
*
|
|
118 |
*/
|
|
119 |
void doDelayeds();
|
37
|
120 |
|
|
121 |
/**
|
|
122 |
* Signaled when view is ready.
|
|
123 |
*/
|
|
124 |
void viewReady();
|
30
|
125 |
|
|
126 |
private slots:
|
|
127 |
|
|
128 |
/**
|
|
129 |
* slot is connected to model's modelReady -signal
|
|
130 |
*/
|
|
131 |
void modelReadySlot();
|
50
|
132 |
|
|
133 |
/**
|
|
134 |
* slot is connected to model's albumListReady -signal
|
|
135 |
*/
|
|
136 |
void albumListReadySlot();
|
|
137 |
|
30
|
138 |
/**
|
35
|
139 |
* slot is connected to plugin's doDelayeds -signal
|
|
140 |
*
|
|
141 |
*/
|
|
142 |
void doDelayedsSlot();
|
|
143 |
|
|
144 |
/**
|
30
|
145 |
* slot is connected to service's titleReady -signal
|
|
146 |
*/
|
|
147 |
void titleReadySlot(const QString& title);
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Slot is connected to model slots informing changes in item count
|
|
151 |
* Method checks the current model state and updates accrodingly
|
|
152 |
*
|
|
153 |
*/
|
|
154 |
void layoutChangedSlot();
|
|
155 |
|
|
156 |
/**
|
|
157 |
* Slot is connected into toolbar's all videos tab's
|
|
158 |
* triggered signal.
|
|
159 |
*
|
|
160 |
* Activates all videos widget by calling changeWidget.
|
|
161 |
*
|
|
162 |
*/
|
35
|
163 |
void openAllVideosViewSlot();
|
30
|
164 |
|
|
165 |
/**
|
|
166 |
* Slot is connected into toolbar's video collection tab's
|
|
167 |
* triggered signal.
|
|
168 |
*
|
|
169 |
* Activates video collection widget by calling changeWidget.
|
|
170 |
*
|
|
171 |
*/
|
|
172 |
void openCollectionViewSlot();
|
34
|
173 |
|
|
174 |
/**
|
30
|
175 |
* Slot is connected into hbInstance's primary window's
|
|
176 |
* aboutToChangeOrientation -signal. This is called when
|
|
177 |
* orientation is to be change.
|
|
178 |
*/
|
|
179 |
void aboutToChangeOrientationSlot();
|
|
180 |
|
|
181 |
/**
|
|
182 |
* Slot is connected into hbInstance's primary window's
|
|
183 |
* aboutToChangeOrientation -signal. This is called when
|
|
184 |
* orientation is changed.
|
|
185 |
*
|
|
186 |
* @param orientation new orientation
|
|
187 |
*/
|
|
188 |
void orientationChangedSlot( Qt::Orientation orientation );
|
|
189 |
|
|
190 |
/**
|
|
191 |
* Slot is connected into viewdollectionwrapper's asyncStatus -signal
|
|
192 |
* If status is failed delete, refiltering is called to model before
|
|
193 |
* error message is shown.
|
|
194 |
*
|
|
195 |
* @param statusCode code of error
|
|
196 |
* @param additional additional data of status
|
|
197 |
*/
|
|
198 |
void handleAsyncStatusSlot(int statusCode, QVariant &additional);
|
|
199 |
|
|
200 |
/**
|
|
201 |
* Slot is connected to videolistwidgets collectionOpened -signal
|
|
202 |
*
|
41
|
203 |
* @param openingCollection
|
30
|
204 |
* @param collection contains the name of the collection opened
|
|
205 |
*/
|
41
|
206 |
void collectionOpenedSlot(bool openingCollection,
|
34
|
207 |
const QString& collection,
|
41
|
208 |
const TMPXItemId &collectionId);
|
37
|
209 |
|
34
|
210 |
/**
|
|
211 |
* Slot which is called when an object has been loaded.
|
|
212 |
*/
|
|
213 |
void objectReadySlot(QObject *object, const QString &name);
|
|
214 |
|
30
|
215 |
/**
|
63
|
216 |
* Slot which is called when actions in toolbar needs to be changed.
|
30
|
217 |
*/
|
63
|
218 |
void toolbarActionsChanged(QList<QAction*> newActions);
|
|
219 |
|
|
220 |
/**
|
|
221 |
* Slot which is called when toolbar extension needs to be changed.
|
|
222 |
*/
|
|
223 |
void toolbarExtensionChanged(HbToolBarExtension* newExtension);
|
|
224 |
|
30
|
225 |
private:
|
35
|
226 |
/**
|
50
|
227 |
* Convenience method that modelReadySlot and albumListReadySlot calls.
|
|
228 |
*/
|
|
229 |
void modelReady();
|
|
230 |
|
|
231 |
/**
|
30
|
232 |
* Cleans all possibly created objects from this. In some cases there are no quarantees
|
|
233 |
* that they were created correctly, and thus is better to start again from clean slate.
|
|
234 |
*/
|
|
235 |
void cleanup();
|
|
236 |
|
|
237 |
/**
|
|
238 |
* Method creates 3 tabs for the view's toolbar: all videos, collections and Services.
|
|
239 |
* Tabs' icons are loaded and theiur triggered signals are connected into corresponding slots.
|
|
240 |
*
|
|
241 |
* @return 0 creation ok, < 0 creation fails
|
|
242 |
*/
|
|
243 |
int createToolbar();
|
|
244 |
|
|
245 |
/**
|
|
246 |
* Shows or hides the hint. Only shows the hint if model does not have any
|
|
247 |
* items.
|
|
248 |
*
|
|
249 |
* @param show Set this to false if you want to force hide the hint.
|
|
250 |
*/
|
|
251 |
void showHint(bool show = true);
|
|
252 |
|
|
253 |
/**
|
34
|
254 |
*
|
|
255 |
*/
|
|
256 |
void setHintLevel(VideoHintWidget::HintLevel level);
|
|
257 |
|
|
258 |
/**
|
30
|
259 |
* Updates the sublabel text.
|
|
260 |
*/
|
|
261 |
void updateSubLabel();
|
34
|
262 |
|
|
263 |
/**
|
41
|
264 |
* Activates all videos or collections -list.
|
|
265 |
*
|
|
266 |
* @return int 0 ok
|
34
|
267 |
*/
|
41
|
268 |
int activateMainView();
|
34
|
269 |
|
|
270 |
/**
|
41
|
271 |
* Activate to collection content view when servicing.
|
|
272 |
* Only default collections are supported. If some other
|
|
273 |
* id is provided, all videos -list will be activated
|
|
274 |
*
|
|
275 |
* @param itemId. Id of collection to activate
|
|
276 |
* @return int
|
34
|
277 |
*/
|
36
|
278 |
int activateCollectionContentView(const TMPXItemId &itemId);
|
34
|
279 |
|
30
|
280 |
private:
|
|
281 |
|
|
282 |
/**
|
44
|
283 |
* Reference to video collection view utils
|
30
|
284 |
*/
|
|
285 |
VideoCollectionViewUtils &mUiUtils;
|
|
286 |
|
|
287 |
/**
|
44
|
288 |
* Reference to videocollectionwrapper
|
30
|
289 |
*/
|
34
|
290 |
VideoCollectionWrapper &mWrapper;
|
30
|
291 |
|
|
292 |
/**
|
|
293 |
* Pointer to the XML UI (DocML) loader, not owned
|
|
294 |
*/
|
|
295 |
VideoCollectionUiLoader* mUiLoader;
|
|
296 |
|
|
297 |
/**
|
63
|
298 |
* Toolbar handler.
|
|
299 |
*/
|
|
300 |
VideoListToolbar* mToolbar;
|
|
301 |
|
|
302 |
/**
|
|
303 |
* Menu handler.
|
|
304 |
*/
|
|
305 |
VideoListMenu* mMenu;
|
|
306 |
|
|
307 |
/**
|
30
|
308 |
* Boolean for knowing when the model is ready.
|
|
309 |
*/
|
|
310 |
bool mModelReady;
|
38
|
311 |
|
|
312 |
/**
|
|
313 |
* Boolean for knowing when the view is ready.
|
|
314 |
*/
|
|
315 |
bool mViewReady;
|
35
|
316 |
|
|
317 |
/**
|
|
318 |
* Hint level for the hint widget.
|
|
319 |
*/
|
|
320 |
VideoHintWidget::HintLevel mHintLevel;
|
30
|
321 |
|
|
322 |
/**
|
44
|
323 |
* Pointer to videoservices instance
|
41
|
324 |
* if exists, app has started as service
|
30
|
325 |
*/
|
|
326 |
VideoServices* mVideoServices;
|
|
327 |
|
|
328 |
/**
|
34
|
329 |
* Currently used list
|
30
|
330 |
*/
|
34
|
331 |
VideoListWidget* mCurrentList;
|
35
|
332 |
|
30
|
333 |
/**
|
|
334 |
* String containing the name of the currently open collection
|
|
335 |
*/
|
|
336 |
QString mCollectionName;
|
44
|
337 |
|
30
|
338 |
};
|
|
339 |
|
|
340 |
#endif // VIDEOLISTVIEW_H
|