Qt 4.8
Functions
qdeclarativexmlhttprequest_p.h File Reference
#include <QtScript/qscriptengine.h>
#include <QtCore/qglobal.h>

Go to the source code of this file.

Functions

void qt_add_qmlxmlhttprequest (QScriptEngine *engine)
 

Function Documentation

◆ qt_add_qmlxmlhttprequest()

void qt_add_qmlxmlhttprequest ( QScriptEngine engine)

Definition at line 1687 of file qdeclarativexmlhttprequest.cpp.

Referenced by QDeclarativeScriptEngine::QDeclarativeScriptEngine().

1688 {
1689  QScriptValue prototype = engine->newObject();
1690 
1691  // Methods
1692  prototype.setProperty(QLatin1String("open"), engine->newFunction(qmlxmlhttprequest_open, 2));
1693  prototype.setProperty(QLatin1String("setRequestHeader"), engine->newFunction(qmlxmlhttprequest_setRequestHeader, 2));
1694  prototype.setProperty(QLatin1String("send"), engine->newFunction(qmlxmlhttprequest_send));
1695  prototype.setProperty(QLatin1String("abort"), engine->newFunction(qmlxmlhttprequest_abort));
1696  prototype.setProperty(QLatin1String("getResponseHeader"), engine->newFunction(qmlxmlhttprequest_getResponseHeader, 1));
1697  prototype.setProperty(QLatin1String("getAllResponseHeaders"), engine->newFunction(qmlxmlhttprequest_getAllResponseHeaders));
1698 
1699  // Read-only properties
1706 
1707  // State values
1713 
1714  // Constructor
1715  QScriptValue constructor = engine->newFunction(qmlxmlhttprequest_new, prototype);
1721  engine->globalObject().setProperty(QLatin1String("XMLHttpRequest"), constructor);
1722 
1723  // DOM Exception
1724  QScriptValue domExceptionPrototype = engine->newObject();
1742 
1743  engine->globalObject().setProperty(QLatin1String("DOMException"), domExceptionPrototype);
1744 }
QScriptValue newFunction(FunctionSignature signature, int length=0)
Creates a QScriptValue that wraps a native (C++) function.
#define INVALID_ACCESS_ERR
static QScriptValue qmlxmlhttprequest_getAllResponseHeaders(QScriptContext *context, QScriptEngine *engine)
#define NAMESPACE_ERR
static QScriptValue qmlxmlhttprequest_new(QScriptContext *context, QScriptEngine *engine)
static QScriptValue qmlxmlhttprequest_statusText(QScriptContext *context, QScriptEngine *engine)
static QScriptValue qmlxmlhttprequest_getResponseHeader(QScriptContext *context, QScriptEngine *engine)
static QScriptValue qmlxmlhttprequest_onreadystatechange(QScriptContext *context, QScriptEngine *engine)
QScriptValue globalObject() const
Returns this engine&#39;s Global Object.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define INDEX_SIZE_ERR
static QScriptValue qmlxmlhttprequest_status(QScriptContext *context, QScriptEngine *engine)
#define VALIDATION_ERR
#define NOT_FOUND_ERR
static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context, QScriptEngine *engine)
#define INUSE_ATTRIBUTE_ERR
#define SYNTAX_ERR
QScriptValue newObject()
Creates a QtScript object of class Object.
#define NO_MODIFICATION_ALLOWED_ERR
static QScriptValue qmlxmlhttprequest_responseText(QScriptContext *context, QScriptEngine *engine)
#define NO_DATA_ALLOWED_ERR
static QScriptValue qmlxmlhttprequest_abort(QScriptContext *context, QScriptEngine *)
static QByteArray prototype(const QList< QByteArray > &parameterTypes, const QList< QByteArray > &parameterNames, bool *ok)
Definition: qaxserver.cpp:685
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue&#39;s property with the given name to the given value.
#define NOT_SUPPORTED_ERR
#define INVALID_STATE_ERR
#define TYPE_MISMATCH_ERR
static QScriptValue qmlxmlhttprequest_readyState(QScriptContext *context, QScriptEngine *engine)
static QScriptValue qmlxmlhttprequest_send(QScriptContext *context, QScriptEngine *)
static QScriptValue qmlxmlhttprequest_responseXML(QScriptContext *context, QScriptEngine *engine)
static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngine *engine)
#define INVALID_CHARACTER_ERR
#define HIERARCHY_REQUEST_ERR
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57
#define WRONG_DOCUMENT_ERR
#define DOMSTRING_SIZE_ERR
#define INVALID_MODIFICATION_ERR