source: trunk/src/scripttools/debugging/qscriptdebuggercommand_p.h@ 5

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 9.2 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the QtSCriptTools module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
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.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QSCRIPTDEBUGGERCOMMAND_P_H
43#define QSCRIPTDEBUGGERCOMMAND_P_H
44
45//
46// W A R N I N G
47// -------------
48//
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.
52//
53// We mean it.
54//
55
56#include <QtCore/qobjectdefs.h>
57
58#include <QtCore/qhash.h>
59#include <QtCore/qvariant.h>
60
61QT_BEGIN_NAMESPACE
62
63class QDataStream;
64class QScriptBreakpointData;
65class QScriptDebuggerValue;
66
67class QScriptDebuggerCommandPrivate;
68class Q_AUTOTEST_EXPORT QScriptDebuggerCommand
69{
70public:
71 friend Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptDebuggerCommand &);
72 friend Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptDebuggerCommand &);
73
74 enum Type {
75 None,
76
77 Interrupt,
78 Continue,
79 StepInto,
80 StepOver,
81 StepOut,
82 RunToLocation,
83 RunToLocationByID,
84 ForceReturn,
85 Resume,
86
87 SetBreakpoint,
88 DeleteBreakpoint,
89 DeleteAllBreakpoints,
90 GetBreakpoints,
91 GetBreakpointData,
92 SetBreakpointData,
93
94 GetScripts,
95 GetScriptData,
96 ScriptsCheckpoint,
97 GetScriptsDelta,
98 ResolveScript,
99
100 GetBacktrace,
101 GetContextCount,
102 GetContextInfo,
103 GetContextState,
104 GetContextID,
105 GetThisObject,
106 GetActivationObject,
107 GetScopeChain,
108 ContextsCheckpoint,
109
110 NewScriptObjectSnapshot,
111 ScriptObjectSnapshotCapture,
112 DeleteScriptObjectSnapshot,
113
114 NewScriptValueIterator,
115 GetPropertiesByIterator,
116 DeleteScriptValueIterator,
117
118 Evaluate,
119
120 SetScriptValueProperty,
121 ScriptValueToString,
122
123 ClearExceptions,
124
125 UserCommand = 1000,
126 MaxUserCommand = 32767
127 };
128
129 enum Attribute {
130 ScriptID,
131 FileName,
132 LineNumber,
133 Program,
134 BreakpointID,
135 BreakpointData,
136 ContextIndex,
137 ScriptValue,
138 StepCount,
139 IteratorID,
140 Name,
141 SubordinateScriptValue,
142 SnapshotID,
143 UserAttribute = 1000,
144 MaxUserAttribute = 32767
145 };
146
147 QScriptDebuggerCommand();
148 QScriptDebuggerCommand(Type type);
149 QScriptDebuggerCommand(const QScriptDebuggerCommand &other);
150 ~QScriptDebuggerCommand();
151
152 Type type() const;
153
154 QVariant attribute(Attribute attribute, const QVariant &defaultValue = QVariant()) const;
155 void setAttribute(Attribute attribute, const QVariant &value);
156 QHash<Attribute, QVariant> attributes() const;
157
158 QString fileName() const;
159 void setFileName(const QString &fileName);
160
161 int lineNumber() const;
162 void setLineNumber(int lineNumber);
163
164 qint64 scriptId() const;
165 void setScriptId(qint64 id);
166
167 QString program() const;
168 void setProgram(const QString &program);
169
170 int breakpointId() const;
171 void setBreakpointId(int id);
172
173 QScriptBreakpointData breakpointData() const;
174 void setBreakpointData(const QScriptBreakpointData &data);
175
176 QScriptDebuggerValue scriptValue() const;
177 void setScriptValue(const QScriptDebuggerValue &value);
178
179 int contextIndex() const;
180 void setContextIndex(int index);
181
182 int iteratorId() const;
183 void setIteratorId(int id);
184
185 QString name() const;
186 void setName(const QString &name);
187
188 QScriptDebuggerValue subordinateScriptValue() const;
189 void setSubordinateScriptValue(const QScriptDebuggerValue &value);
190
191 int snapshotId() const;
192 void setSnapshotId(int id);
193
194 QScriptDebuggerCommand &operator=(const QScriptDebuggerCommand &other);
195
196 bool operator==(const QScriptDebuggerCommand &other) const;
197 bool operator!=(const QScriptDebuggerCommand &other) const;
198
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();
208
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);
216
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);
222
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();
232
233 static QScriptDebuggerCommand newScriptObjectSnapshotCommand();
234 static QScriptDebuggerCommand scriptObjectSnapshotCaptureCommand(int id, const QScriptDebuggerValue &object);
235 static QScriptDebuggerCommand deleteScriptObjectSnapshotCommand(int id);
236
237 static QScriptDebuggerCommand newScriptValueIteratorCommand(const QScriptDebuggerValue &object);
238 static QScriptDebuggerCommand getPropertiesByIteratorCommand(int id, int count);
239 static QScriptDebuggerCommand deleteScriptValueIteratorCommand(int id);
240
241 static QScriptDebuggerCommand evaluateCommand(int contextIndex, const QString &program,
242 const QString &fileName = QString(),
243 int lineNumber = 1);
244
245 static QScriptDebuggerCommand setScriptValuePropertyCommand(const QScriptDebuggerValue &object,
246 const QString &name,
247 const QScriptDebuggerValue &value);
248 static QScriptDebuggerCommand scriptValueToStringCommand(const QScriptDebuggerValue &value);
249
250 static QScriptDebuggerCommand clearExceptionsCommand();
251
252private:
253 QScriptDebuggerCommandPrivate *d_ptr;
254
255 Q_DECLARE_PRIVATE(QScriptDebuggerCommand)
256};
257
258Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptDebuggerCommand &);
259Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptDebuggerCommand &);
260
261QT_END_NAMESPACE
262
263#endif
Note: See TracBrowser for help on using the repository browser.