summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlengine.h
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-02 05:41:41 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-02 05:41:41 (GMT)
commitff4140013a993a90ae26cbd56e9d75760ec3e40d (patch)
tree32aab6ba822029267ed459f8ce9adde0a956d5c0 /src/declarative/qml/qmlengine.h
parentbaea2c29340b14c6ec1f560a09627f23dd358363 (diff)
downloadQt-ff4140013a993a90ae26cbd56e9d75760ec3e40d.zip
Qt-ff4140013a993a90ae26cbd56e9d75760ec3e40d.tar.gz
Qt-ff4140013a993a90ae26cbd56e9d75760ec3e40d.tar.bz2
First conversion to new module handling.
Works same as before for now, but now the variables and methods are all in the right place. In particular, type resolving is per-component, not per-engine, even though it is the engine that ultimately has the ability to find types, because each component will have a different set of available types. Designed to be optimizable - QmlEngine could share data between QmlEngine::Import objects, and the import objects could read types in bulk rather than always searching.
Diffstat (limited to 'src/declarative/qml/qmlengine.h')
-rw-r--r--src/declarative/qml/qmlengine.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h
index f114379..b74ad21 100644
--- a/src/declarative/qml/qmlengine.h
+++ b/src/declarative/qml/qmlengine.h
@@ -42,6 +42,7 @@
#ifndef QMLENGINE_H
#define QMLENGINE_H
+#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
#include <QtCore/qmap.h>
#include <QtScript/qscriptvalue.h>
@@ -54,6 +55,7 @@ QT_MODULE(Declarative)
class QmlComponent;
class QmlEnginePrivate;
+class QmlImportsPrivate;
class QmlExpression;
class QmlContext;
class QUrl;
@@ -74,13 +76,18 @@ public:
void clearComponentCache();
- void setNameSpacePaths(const QMap<QString,QString>& map);
- void addNameSpacePaths(const QMap<QString,QString>& map);
- void addNameSpacePath(const QString&,const QString&);
- QMap<QString,QString> nameSpacePaths() const;
- QUrl componentUrl(const QUrl& src, const QUrl& baseUrl) const;
-
- QList<QUrl> componentSearchPath(const QByteArray &qml, const QUrl &url) const;
+ struct Imports {
+ Imports();
+ ~Imports();
+ void setBaseUrl(const QUrl& url);
+ QUrl baseUrl() const { return base; }
+ private:
+ friend class QmlEngine;
+ QUrl base;
+ QmlImportsPrivate *d;
+ };
+ void addImport(Imports*, const QString& uri, const QString& prefix, int version_major, int version_minor) const;
+ QUrl resolveType(const Imports&, const QString& type) const;
void setNetworkAccessManager(QNetworkAccessManager *);
QNetworkAccessManager *networkAccessManager() const;