35
|
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: hbdocumentloader stub
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef HBDOCUMENTLOADER_H
|
|
19 |
#define HBDOCUMENTLOADER_H
|
|
20 |
|
|
21 |
#include "hbwidget.h"
|
|
22 |
#include <qlist.h>
|
|
23 |
#include <qpointer.h>
|
|
24 |
|
|
25 |
class HbMainWindow;
|
|
26 |
class VideoCollectionUiLoader;
|
|
27 |
|
|
28 |
class ObjectData : public QObject
|
|
29 |
{
|
|
30 |
Q_OBJECT
|
|
31 |
public:
|
|
32 |
ObjectData(QObject *obj, QString name)
|
|
33 |
{
|
|
34 |
mObject = obj;
|
|
35 |
mName = name;
|
|
36 |
}
|
|
37 |
~ObjectData()
|
|
38 |
{
|
|
39 |
delete mObject;
|
|
40 |
}
|
|
41 |
public:
|
|
42 |
QPointer<QObject> mObject;
|
|
43 |
QString mName;
|
|
44 |
};
|
|
45 |
|
|
46 |
class HbDocumentLoader
|
|
47 |
{
|
|
48 |
|
|
49 |
public:
|
36
|
50 |
static void cleanup();
|
|
51 |
|
35
|
52 |
HbDocumentLoader();
|
|
53 |
HbDocumentLoader(const HbMainWindow *window);
|
|
54 |
virtual ~HbDocumentLoader();
|
|
55 |
|
|
56 |
QObjectList load( const QString &fileName, const QString §ion , bool *ok = 0 );
|
|
57 |
QObjectList load( const QString &fileName, bool *ok = 0 );
|
|
58 |
|
|
59 |
QGraphicsWidget *findWidget(const QString &name);
|
|
60 |
QObject *findObject(const QString &name);
|
|
61 |
|
|
62 |
void reset();
|
|
63 |
|
|
64 |
protected:
|
|
65 |
virtual QObject *createObject(const QString& type, const QString &name);
|
|
66 |
|
|
67 |
private:
|
|
68 |
|
|
69 |
QObject *doCreateObject(const QString &name);
|
|
70 |
|
|
71 |
QList<ObjectData *> mObjects;
|
|
72 |
|
|
73 |
bool mCreatingObject;
|
|
74 |
|
|
75 |
public:
|
|
76 |
static bool mFindWidgetFails;
|
|
77 |
static bool mFindObjectFails;
|
|
78 |
static bool mCreateObjectFails;
|
36
|
79 |
|
|
80 |
static bool mVideoListWidgetFailure;
|
|
81 |
static bool mCollectionWidgetFailure;
|
|
82 |
static bool mCollectionContentWidgetFailure;
|
|
83 |
static bool mLoadFails;
|
|
84 |
|
|
85 |
static QObjectList mLoadReturns;
|
35
|
86 |
};
|
|
87 |
|
|
88 |
#endif // HBDOCUMENTLOADER_H
|