Qt 4.8
qdeclarativeengine.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 QDECLARATIVEENGINE_H
43 #define QDECLARATIVEENGINE_H
44 
45 #include <QtCore/qurl.h>
46 #include <QtCore/qobject.h>
47 #include <QtCore/qmap.h>
48 #include <QtScript/qscriptvalue.h>
49 #include <QtDeclarative/qdeclarativeerror.h>
50 #include <QtDeclarative/qdeclarativedebug.h>
51 
53 
55 
56 QT_MODULE(Declarative)
57 
63 class QDeclarativeType;
64 class QUrl;
65 class QScriptEngine;
66 class QScriptContext;
71 {
73  Q_OBJECT
74 public:
76  virtual ~QDeclarativeEngine();
77 
78  QDeclarativeContext *rootContext() const;
79 
80  void clearComponentCache();
81 
82  QStringList importPathList() const;
83  void setImportPathList(const QStringList &paths);
84  void addImportPath(const QString& dir);
85 
86  QStringList pluginPathList() const;
87  void setPluginPathList(const QStringList &paths);
88  void addPluginPath(const QString& dir);
89 
90  bool importPlugin(const QString &filePath, const QString &uri, QString *errorString);
91 
92  void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *);
93  QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory() const;
94 
95  QNetworkAccessManager *networkAccessManager() const;
96 
97  void addImageProvider(const QString &id, QDeclarativeImageProvider *);
98  QDeclarativeImageProvider *imageProvider(const QString &id) const;
99  void removeImageProvider(const QString &id);
100 
101  void setOfflineStoragePath(const QString& dir);
102  QString offlineStoragePath() const;
103 
104  QUrl baseUrl() const;
105  void setBaseUrl(const QUrl &);
106 
107  bool outputWarningsToStandardError() const;
108  void setOutputWarningsToStandardError(bool);
109 
110  static QDeclarativeContext *contextForObject(const QObject *);
111  static void setContextForObject(QObject *, QDeclarativeContext *);
112 
113  enum ObjectOwnership { CppOwnership, JavaScriptOwnership };
114  static void setObjectOwnership(QObject *, ObjectOwnership);
115  static ObjectOwnership objectOwnership(QObject *);
116 
117 Q_SIGNALS:
118  void quit();
119  void warnings(const QList<QDeclarativeError> &warnings);
120 
121 private:
124 };
125 
127 
129 
130 #endif // QDECLARATIVEENGINE_H
The QScriptContext class represents a Qt Script function invocation.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
QString offlineStoragePath
the directory for storing offline user data
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
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 QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
Definition: qegl.cpp:743
The QScriptEngine class provides an environment for evaluating Qt Script code.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QDeclarativeComponent class encapsulates a QML component definition.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
ObjectOwnership
Ownership controls whether or not QML automatically destroys the QObject when the object is garbage c...
The QNetworkAccessManager class allows the application to send network requests and receive replies...
#define Q_OBJECT
Definition: qobjectdefs.h:157
#define Q_DECLARATIVE_EXPORT
Definition: qglobal.h:1454
The QDeclarativeImageProvider class provides an interface for supporting pixmaps and threaded image r...
The QDeclarativeNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML e...
The QDeclarativeEngine class provides an environment for instantiating QML components.
The QDeclarativeContext class defines a context within a QML engine.
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
The QDeclarativeExpression class evaluates JavaScript in a QML context.
#define QT_END_HEADER
Definition: qglobal.h:137