51 #include <QtCore/qstring.h> 52 #include <QtCore/qstringlist.h> 53 #include <QtScript/qscriptengine.h> 54 #include <QtScript/qscriptvalue.h> 55 #include <QtScript/qscriptvalueiterator.h> 56 #include <QtScript/qscriptcontextinfo.h> 57 #include <QtCore/qdebug.h> 121 d->globalObject = globalObject;
122 d->execFunction = execFunction;
123 d->responseFunction = responseFunction;
176 console, messageHandler, commandScheduler)
179 d->command = command;
180 d->arguments = arguments;
202 for (
int i = 0; i <
d->arguments.size(); ++i)
220 if (
d->commandCount == 0)
251 if (
d->commandCount == 0)
279 return d->shortDescription;
288 return d->longDescription;
315 return d->argumentTypes;
324 return d->subCommands;
338 d, arguments, console, messageHandler, commandScheduler);
356 while (
it.hasNext()) {
382 .arg(nameStr), fileName);
390 .arg(nameStr), fileName);
398 .arg(nameStr), fileName);
416 if (!execFunction.isFunction()) {
418 .arg(nameStr), fileName);
426 shortDescStr, longDescStr,
428 argTypes, subCommands,
429 global, execFunction, responseFunction);
T qobject_cast(QObject *object)
QScriptValue evaluate(const QString &program, const QString &fileName=QString(), int lineNumber=1)
Evaluates program, using lineNumber as the base line number, and returns the result of the evaluation...
QScriptValue property(const QString &name, const ResolveFlags &mode=ResolvePrototype) const
Returns the value of this QScriptValue's property with the given name, using the given mode to resolv...
#define QT_END_NAMESPACE
This macro expands to.
QScriptValue execFunction
~QScriptDebuggerScriptedConsoleCommandJobPrivate()
QScriptValue responseFunction
#define it(className, varName)
The QScriptDebuggerResponse class represents a front-end's response to a QScriptDebuggerCommand.
bool isError() const
Returns true if this QScriptValue is an object of the Error class; otherwise returns false...
static QScriptDebuggerScriptedConsoleCommand * parse(const QString &program, const QString &fileName, QScriptEngine *engine, QScriptMessageHandlerInterface *messageHandler)
Parses a command defined by the given program.
QScriptValue toScriptValue(const T &value)
Creates a QScriptValue with the given value.
QStringList subCommands() const
QString shortDescription() const
QString toString() const
Returns the string value of this QScriptValue, as defined in ECMA-262 section 9.8, "ToString".
QScriptValue globalObject() const
Returns this engine's Global Object.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
QScriptDebuggerScriptedConsoleCommandJob(QScriptDebuggerScriptedConsoleCommandPrivate *command, const QStringList &arguments, QScriptDebuggerConsole *console, QScriptMessageHandlerInterface *messageHandler, QScriptDebuggerCommandSchedulerInterface *commandScheduler)
QObject * toQObject() const
If this QScriptValue is a QObject, returns the QObject pointer that the QScriptValue represents; othe...
The QString class provides a Unicode character string.
QScriptDebuggerConsoleCommandJob * createJob(const QStringList &arguments, QScriptDebuggerConsole *console, QScriptMessageHandlerInterface *messageHandler, QScriptDebuggerCommandSchedulerInterface *commandScheduler)
QString longDescription() const
void setConsole(QScriptDebuggerConsole *console)
QScriptDebuggerScriptedConsoleCommandJobPrivate()
The QScriptDebuggerConsole class provides the core functionality of a debugger console.
void append(const T &t)
Inserts value at the end of the list.
The QScriptEngine class provides an environment for evaluating Qt Script code.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setScheduler(QScriptDebuggerCommandSchedulerInterface *scheduler)
QScriptDebuggerScriptedConsoleCommandPrivate * command
bool isString() const
Returns true if this QScriptValue is of the primitive type String; otherwise returns false...
The QStringList class provides a list of strings.
QStringList argumentTypes() const
QStringList seeAlso() const
Q_CORE_EXPORT void qWarning(const char *,...)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
int scheduleCommand(const QScriptDebuggerCommand &command, QScriptDebuggerResponseHandlerInterface *responseHandler)
void setGlobalObject(const QScriptValue &object)
Sets this engine's Global Object to be the given object.
~QScriptDebuggerScriptedConsoleCommandPrivate()
void setResponseHandler(QScriptDebuggerResponseHandlerInterface *responseHandler)
int uncaughtExceptionLineNumber() const
Returns the line number where the last uncaught exception occurred.
QScriptDebuggerScriptedConsoleCommand(const QString &name, const QString &group, const QString &shortDescription, const QString &longDescription, const QStringList &aliases, const QStringList &seeAlso, const QStringList &argumentTypes, const QStringList &subCommands, const QScriptValue &globalObject, const QScriptValue &execFunction, const QScriptValue &responseFunction)
QScriptValue newQObject(QObject *object, ValueOwnership ownership=QtOwnership, const QObjectWrapOptions &options=0)
Creates a QtScript object that wraps the given QObject object, using the given ownership.
The QScriptDebuggerCommand class represents a command issued to a QScriptDebuggerFrontend.
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue's property with the given name to the given value.
The QScriptDebuggerScriptedConsoleCommand class encapsulates a command defined in a script...
QStringList aliases() const
#define Q_DECLARE_PUBLIC(Class)
The QScriptValueIterator class provides a Java-style iterator for QScriptValue.
The QScriptDebuggerConsoleCommand class is the base class of console commands.
void setMessageHandler(QScriptMessageHandlerInterface *messageHandler)
void handleResponse(const QScriptDebuggerResponse &response, int commandId)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static void messageHandler(QtMsgType type, const char *msg)
QStringList argumentTypes
void qScriptValueToSequence(const QScriptValue &value, Container &cont)
virtual int scheduleCommand(const QScriptDebuggerCommand &command, QScriptDebuggerResponseHandlerInterface *responseHandler)=0
QScriptValue globalObject
#define Q_DECLARE_PRIVATE(Class)
~QScriptDebuggerScriptedConsoleCommandJob()
QScriptDebuggerCommandSchedulerInterface * commandScheduler() const
QScriptDebuggerScriptedConsoleCommandPrivate()
bool hasUncaughtException() const
Returns true if the last script evaluation resulted in an uncaught exception; otherwise returns false...
virtual void message(QtMsgType type, const QString &text, const QString &fileName=QString(), int lineNumber=-1, int columnNumber=-1, const QVariant &data=QVariant())=0
#define qPrintable(string)
The QScriptValue class acts as a container for the Qt Script data types.
static QString fileName(const QString &fileUrl)
~QScriptDebuggerScriptedConsoleCommand()