|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <qdebug.h> |
|
19 #include <qset.h> |
|
20 #include <qstring.h> |
|
21 #include <hblistview.h> |
|
22 #include <hbmenu.h> |
|
23 |
|
24 #include "videocollectionuiloader.h" |
|
25 #include "videolistview.h" |
|
26 #include "videolistwidget.h" |
|
27 #include "videohintwidget.h" |
|
28 #include "videolistselectiondialog.h" |
|
29 |
|
30 #include "videocollectionuiloaderdata.h" |
|
31 |
|
32 bool VideoCollectionUiLoaderData::mFindFailure = false; |
|
33 bool VideoCollectionUiLoaderData::mFailDialogLoad = false; |
|
34 QStringList VideoCollectionUiLoaderData::mFindFailureNameList; |
|
35 |
|
36 VideoCollectionUiLoader::VideoCollectionUiLoader(): |
|
37 HbDocumentLoader(), |
|
38 mTimerId(0) |
|
39 { |
|
40 // not stubbed |
|
41 } |
|
42 |
|
43 VideoCollectionUiLoader::~VideoCollectionUiLoader() |
|
44 { |
|
45 VideoCollectionUiLoaderData::reset(); |
|
46 } |
|
47 |
|
48 void VideoCollectionUiLoader::startLoading(QSet<QString> uiSections, |
|
49 QObject *receiver, |
|
50 const char *widgetSlot, |
|
51 const char *objectSlot) |
|
52 { |
|
53 Q_UNUSED(uiSections); |
|
54 Q_UNUSED(receiver); |
|
55 Q_UNUSED(widgetSlot); |
|
56 Q_UNUSED(objectSlot); |
|
57 // not stubbed |
|
58 } |
|
59 |
|
60 void VideoCollectionUiLoader::setIsService(bool isService) |
|
61 { |
|
62 Q_UNUSED(isService); |
|
63 // not stubbed |
|
64 } |
|
65 |
|
66 QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name) |
|
67 { |
|
68 QGraphicsWidget *widget = 0; |
|
69 if(VideoCollectionUiLoaderData::mFindFailure) |
|
70 { |
|
71 return 0; |
|
72 } |
|
73 if(!VideoCollectionUiLoaderData::mFindFailureNameList.contains(name)) |
|
74 { |
|
75 widget = HbDocumentLoader::findWidget(name); |
|
76 } |
|
77 return widget; |
|
78 } |
|
79 |
|
80 QObject* VideoCollectionUiLoader::doFindObject(const QString &name) |
|
81 { |
|
82 QObject *object = 0; |
|
83 if(VideoCollectionUiLoaderData::mFindFailure) |
|
84 { |
|
85 return 0; |
|
86 } |
|
87 if(!VideoCollectionUiLoaderData::mFindFailureNameList.contains(name)) |
|
88 { |
|
89 object = HbDocumentLoader::findObject(name); |
|
90 } |
|
91 return object; |
|
92 } |
|
93 |
|
94 void VideoCollectionUiLoader::addToQueue(Params ¶ms) |
|
95 { |
|
96 Q_UNUSED(params); |
|
97 // not stubbed |
|
98 } |
|
99 |
|
100 void VideoCollectionUiLoader::initWidget(QGraphicsWidget *widget, |
|
101 const QString &name) |
|
102 { |
|
103 Q_UNUSED(widget); |
|
104 Q_UNUSED(name); |
|
105 // not stubbed |
|
106 } |
|
107 |
|
108 void VideoCollectionUiLoader::initObject(QObject *object, |
|
109 const QString &name) |
|
110 { |
|
111 Q_UNUSED(object); |
|
112 Q_UNUSED(name); |
|
113 // not stubbed |
|
114 } |
|
115 |
|
116 void VideoCollectionUiLoader::timerEvent(QTimerEvent *event) |
|
117 { |
|
118 Q_UNUSED(event); |
|
119 // not stubbed |
|
120 } |
|
121 |
|
122 QObject* VideoCollectionUiLoader::createObject(const QString& type, |
|
123 const QString &name) |
|
124 { |
|
125 QObject* object = doFindObject(name); |
|
126 if (!object) |
|
127 { |
|
128 if (name == DOCML_NAME_VIEW) |
|
129 { |
|
130 object = new VideoListView(this); |
|
131 } |
|
132 else if (name == DOCML_NAME_VC_COLLECTIONWIDGET || |
|
133 name == DOCML_NAME_VC_COLLECTIONCONTENTWIDGET || |
|
134 name == DOCML_NAME_VC_VIDEOLISTWIDGET) |
|
135 { |
|
136 object = new VideoListWidget(this); |
|
137 } |
|
138 else if (name == DOCML_NAME_DIALOG) |
|
139 { |
|
140 if(!VideoCollectionUiLoaderData::mFailDialogLoad) |
|
141 { |
|
142 object = new VideoListSelectionDialog(this); |
|
143 } |
|
144 else |
|
145 { |
|
146 return 0; |
|
147 } |
|
148 } |
|
149 else if (name == DOCML_NAME_VC_VIDEOHINTWIDGET) |
|
150 { |
|
151 object = new VideoHintWidget(this); |
|
152 } |
|
153 if (object) |
|
154 { |
|
155 object->setObjectName(name); |
|
156 |
|
157 |
|
158 return object; |
|
159 } |
|
160 object = HbDocumentLoader::createObject(type, name); |
|
161 } |
|
162 |
|
163 return object; |
|
164 } |
|
165 |
|
166 void VideoCollectionUiLoader::runNext() |
|
167 { |
|
168 // not stubbed |
|
169 } |
|
170 |
|
171 bool VideoCollectionUiLoader::isValid(const Params ¶ms) |
|
172 { |
|
173 Q_UNUSED(params); |
|
174 // not stubbed |
|
175 return true; |
|
176 } |