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