1 /****************************************************************************
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtSCriptTools module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** GNU General Public License Usage
29 ** Alternatively, this file may be used under the terms of the GNU
30 ** General Public License version 3.0 as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL included in the
32 ** packaging of this file. Please review the following information to
33 ** ensure the GNU General Public License version 3.0 requirements will be
34 ** met: http://www.gnu.org/copyleft/gpl.html.
36 ** If you have questions regarding the use of this file, please contact
37 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #ifndef QSCRIPTDEBUGGERCOMMAND_P_H
43 #define QSCRIPTDEBUGGERCOMMAND_P_H
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
56 #include <QtCore/qobjectdefs.h>
58 #include <QtCore/qhash.h>
59 #include <QtCore/qvariant.h>
64 class QScriptBreakpointData
;
65 class QScriptDebuggerValue
;
67 class QScriptDebuggerCommandPrivate
;
68 class Q_AUTOTEST_EXPORT QScriptDebuggerCommand
71 friend Q_AUTOTEST_EXPORT QDataStream
&operator<<(QDataStream
&, const QScriptDebuggerCommand
&);
72 friend Q_AUTOTEST_EXPORT QDataStream
&operator>>(QDataStream
&, QScriptDebuggerCommand
&);
110 NewScriptObjectSnapshot
,
111 ScriptObjectSnapshotCapture
,
112 DeleteScriptObjectSnapshot
,
114 NewScriptValueIterator
,
115 GetPropertiesByIterator
,
116 DeleteScriptValueIterator
,
120 SetScriptValueProperty
,
126 MaxUserCommand
= 32767
141 SubordinateScriptValue
,
143 UserAttribute
= 1000,
144 MaxUserAttribute
= 32767
147 QScriptDebuggerCommand();
148 QScriptDebuggerCommand(Type type
);
149 QScriptDebuggerCommand(const QScriptDebuggerCommand
&other
);
150 ~QScriptDebuggerCommand();
154 QVariant
attribute(Attribute attribute
, const QVariant
&defaultValue
= QVariant()) const;
155 void setAttribute(Attribute attribute
, const QVariant
&value
);
156 QHash
<Attribute
, QVariant
> attributes() const;
158 QString
fileName() const;
159 void setFileName(const QString
&fileName
);
161 int lineNumber() const;
162 void setLineNumber(int lineNumber
);
164 qint64
scriptId() const;
165 void setScriptId(qint64 id
);
167 QString
program() const;
168 void setProgram(const QString
&program
);
170 int breakpointId() const;
171 void setBreakpointId(int id
);
173 QScriptBreakpointData
breakpointData() const;
174 void setBreakpointData(const QScriptBreakpointData
&data
);
176 QScriptDebuggerValue
scriptValue() const;
177 void setScriptValue(const QScriptDebuggerValue
&value
);
179 int contextIndex() const;
180 void setContextIndex(int index
);
182 int iteratorId() const;
183 void setIteratorId(int id
);
185 QString
name() const;
186 void setName(const QString
&name
);
188 QScriptDebuggerValue
subordinateScriptValue() const;
189 void setSubordinateScriptValue(const QScriptDebuggerValue
&value
);
191 int snapshotId() const;
192 void setSnapshotId(int id
);
194 QScriptDebuggerCommand
&operator=(const QScriptDebuggerCommand
&other
);
196 bool operator==(const QScriptDebuggerCommand
&other
) const;
197 bool operator!=(const QScriptDebuggerCommand
&other
) const;
199 static QScriptDebuggerCommand
interruptCommand();
200 static QScriptDebuggerCommand
continueCommand();
201 static QScriptDebuggerCommand
stepIntoCommand(int count
= 1);
202 static QScriptDebuggerCommand
stepOverCommand(int count
= 1);
203 static QScriptDebuggerCommand
stepOutCommand();
204 static QScriptDebuggerCommand
runToLocationCommand(const QString
&fileName
, int lineNumber
);
205 static QScriptDebuggerCommand
runToLocationCommand(qint64 scriptId
, int lineNumber
);
206 static QScriptDebuggerCommand
forceReturnCommand(int contextIndex
, const QScriptDebuggerValue
&value
);
207 static QScriptDebuggerCommand
resumeCommand();
209 static QScriptDebuggerCommand
setBreakpointCommand(const QString
&fileName
, int lineNumber
);
210 static QScriptDebuggerCommand
setBreakpointCommand(const QScriptBreakpointData
&data
);
211 static QScriptDebuggerCommand
deleteBreakpointCommand(int id
);
212 static QScriptDebuggerCommand
deleteAllBreakpointsCommand();
213 static QScriptDebuggerCommand
getBreakpointsCommand();
214 static QScriptDebuggerCommand
getBreakpointDataCommand(int id
);
215 static QScriptDebuggerCommand
setBreakpointDataCommand(int id
, const QScriptBreakpointData
&data
);
217 static QScriptDebuggerCommand
getScriptsCommand();
218 static QScriptDebuggerCommand
getScriptDataCommand(qint64 id
);
219 static QScriptDebuggerCommand
scriptsCheckpointCommand();
220 static QScriptDebuggerCommand
getScriptsDeltaCommand();
221 static QScriptDebuggerCommand
resolveScriptCommand(const QString
&fileName
);
223 static QScriptDebuggerCommand
getBacktraceCommand();
224 static QScriptDebuggerCommand
getContextCountCommand();
225 static QScriptDebuggerCommand
getContextStateCommand(int contextIndex
);
226 static QScriptDebuggerCommand
getContextInfoCommand(int contextIndex
);
227 static QScriptDebuggerCommand
getContextIdCommand(int contextIndex
);
228 static QScriptDebuggerCommand
getThisObjectCommand(int contextIndex
);
229 static QScriptDebuggerCommand
getActivationObjectCommand(int contextIndex
);
230 static QScriptDebuggerCommand
getScopeChainCommand(int contextIndex
);
231 static QScriptDebuggerCommand
contextsCheckpoint();
233 static QScriptDebuggerCommand
newScriptObjectSnapshotCommand();
234 static QScriptDebuggerCommand
scriptObjectSnapshotCaptureCommand(int id
, const QScriptDebuggerValue
&object
);
235 static QScriptDebuggerCommand
deleteScriptObjectSnapshotCommand(int id
);
237 static QScriptDebuggerCommand
newScriptValueIteratorCommand(const QScriptDebuggerValue
&object
);
238 static QScriptDebuggerCommand
getPropertiesByIteratorCommand(int id
, int count
);
239 static QScriptDebuggerCommand
deleteScriptValueIteratorCommand(int id
);
241 static QScriptDebuggerCommand
evaluateCommand(int contextIndex
, const QString
&program
,
242 const QString
&fileName
= QString(),
245 static QScriptDebuggerCommand
setScriptValuePropertyCommand(const QScriptDebuggerValue
&object
,
247 const QScriptDebuggerValue
&value
);
248 static QScriptDebuggerCommand
scriptValueToStringCommand(const QScriptDebuggerValue
&value
);
250 static QScriptDebuggerCommand
clearExceptionsCommand();
253 QScriptDebuggerCommandPrivate
*d_ptr
;
255 Q_DECLARE_PRIVATE(QScriptDebuggerCommand
)
258 Q_AUTOTEST_EXPORT QDataStream
&operator<<(QDataStream
&, const QScriptDebuggerCommand
&);
259 Q_AUTOTEST_EXPORT QDataStream
&operator>>(QDataStream
&, QScriptDebuggerCommand
&);