Qt 4.8
qdeclarativeimport_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QDECLARATIVEIMPORT_P_H
43 #define QDECLARATIVEIMPORT_P_H
44 
45 #include <QtCore/qurl.h>
46 #include <QtCore/qcoreapplication.h>
47 #include <QtCore/qset.h>
48 #include <private/qdeclarativedirparser_p.h>
49 #include <private/qdeclarativescriptparser_p.h>
50 #include <private/qdeclarativemetatype_p.h>
51 
52 //
53 // W A R N I N G
54 // -------------
55 //
56 // This file is not part of the Qt API. It exists purely as an
57 // implementation detail. This header file may change from version to
58 // version without notice, or even be removed.
59 //
60 // We mean it.
61 //
62 
64 
66 class QDeclarativeEngine;
67 class QDir;
72 
74 {
75 public:
81 
82  void setBaseUrl(const QUrl &url);
83  QUrl baseUrl() const;
84 
85  bool resolveType(const QByteArray& type,
86  QDeclarativeType** type_return, QUrl* url_return,
87  int *version_major, int *version_minor,
89  QString *errorString = 0) const;
91  const QByteArray& type,
92  QDeclarativeType** type_return, QUrl* url_return,
93  int *version_major, int *version_minor) const;
94 
96  const QString& uri, const QString& prefix, int vmaj, int vmin,
98  const QDeclarativeDirComponents &qmldircomponentsnetwork,
100 
102 
103 private:
106 };
107 
109 {
111 public:
114 
115  bool importPlugin(const QString &filePath, const QString &uri, QString *errorString);
116 
117  QStringList importPathList() const;
118  void setImportPathList(const QStringList &paths);
119  void addImportPath(const QString& dir);
120 
121  QStringList pluginPathList() const;
122  void setPluginPathList(const QStringList &paths);
123  void addPluginPath(const QString& path);
124 
125 private:
127  QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
128  const QString &baseName, const QStringList &suffixes,
129  const QString &prefix = QString());
130  QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
131  const QString &baseName);
132 
133 
136 
139 };
140 
142 
143 #endif // QDECLARATIVEIMPORT_P_H
144 
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
QDeclarativeImports & operator=(const QDeclarativeImports &)
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
bool addImport(QDeclarativeImportDatabase *, const QString &uri, const QString &prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, const QDeclarativeDirComponents &qmldircomponentsnetwork, QString *errorString)
Adds information to imports such that subsequent calls to resolveType() will resolve types qualified ...
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
friend class QDeclarativeImportDatabase
bool resolveType(const QByteArray &type, QDeclarativeType **type_return, QUrl *url_return, int *version_major, int *version_minor, QDeclarativeImportedNamespace **ns_return, QString *errorString=0) const
The given (namespace qualified) type is resolved to either.
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QDeclarativeImports class encapsulates one QML document&#39;s import statements.
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
Definition: qegl.cpp:743
QUrl baseUrl() const
Returns the base URL to be used for all relative file imports added.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QDeclarativeImportsPrivate * d
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
void populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const
The QDeclarativeEngine class provides an environment for instantiating QML components.
void setBaseUrl(const QUrl &url)
Sets the base URL to be used for all relative file imports added.
#define Q_DECLARE_TR_FUNCTIONS(context)
The Q_DECLARE_TR_FUNCTIONS() macro declares and implements two translation functions, tr() and trUtf8(), with these signatures:
The QDeclarativeImportDatabase class manages the QML imports for a QDeclarativeEngine.