|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the QtSCriptTools module of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
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. |
|
23 ** |
|
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. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
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 #include <QtCore/qscopedpointer.h> |
|
58 #include <QtCore/qhash.h> |
|
59 #include <QtCore/qvariant.h> |
|
60 |
|
61 QT_BEGIN_NAMESPACE |
|
62 |
|
63 class QDataStream; |
|
64 class QScriptBreakpointData; |
|
65 class QScriptDebuggerValue; |
|
66 |
|
67 class QScriptDebuggerCommandPrivate; |
|
68 class Q_AUTOTEST_EXPORT QScriptDebuggerCommand |
|
69 { |
|
70 public: |
|
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 GetPropertyExpressionValue, |
|
110 GetCompletions, |
|
111 |
|
112 NewScriptObjectSnapshot, |
|
113 ScriptObjectSnapshotCapture, |
|
114 DeleteScriptObjectSnapshot, |
|
115 |
|
116 NewScriptValueIterator, |
|
117 GetPropertiesByIterator, |
|
118 DeleteScriptValueIterator, |
|
119 |
|
120 Evaluate, |
|
121 |
|
122 SetScriptValueProperty, |
|
123 ScriptValueToString, |
|
124 |
|
125 ClearExceptions, |
|
126 |
|
127 UserCommand = 1000, |
|
128 MaxUserCommand = 32767 |
|
129 }; |
|
130 |
|
131 enum Attribute { |
|
132 ScriptID, |
|
133 FileName, |
|
134 LineNumber, |
|
135 Program, |
|
136 BreakpointID, |
|
137 BreakpointData, |
|
138 ContextIndex, |
|
139 ScriptValue, |
|
140 StepCount, |
|
141 IteratorID, |
|
142 Name, |
|
143 SubordinateScriptValue, |
|
144 SnapshotID, |
|
145 UserAttribute = 1000, |
|
146 MaxUserAttribute = 32767 |
|
147 }; |
|
148 |
|
149 QScriptDebuggerCommand(); |
|
150 QScriptDebuggerCommand(Type type); |
|
151 QScriptDebuggerCommand(const QScriptDebuggerCommand &other); |
|
152 ~QScriptDebuggerCommand(); |
|
153 |
|
154 Type type() const; |
|
155 |
|
156 QVariant attribute(Attribute attribute, const QVariant &defaultValue = QVariant()) const; |
|
157 void setAttribute(Attribute attribute, const QVariant &value); |
|
158 QHash<Attribute, QVariant> attributes() const; |
|
159 |
|
160 QString fileName() const; |
|
161 void setFileName(const QString &fileName); |
|
162 |
|
163 int lineNumber() const; |
|
164 void setLineNumber(int lineNumber); |
|
165 |
|
166 qint64 scriptId() const; |
|
167 void setScriptId(qint64 id); |
|
168 |
|
169 QString program() const; |
|
170 void setProgram(const QString &program); |
|
171 |
|
172 int breakpointId() const; |
|
173 void setBreakpointId(int id); |
|
174 |
|
175 QScriptBreakpointData breakpointData() const; |
|
176 void setBreakpointData(const QScriptBreakpointData &data); |
|
177 |
|
178 QScriptDebuggerValue scriptValue() const; |
|
179 void setScriptValue(const QScriptDebuggerValue &value); |
|
180 |
|
181 int contextIndex() const; |
|
182 void setContextIndex(int index); |
|
183 |
|
184 int iteratorId() const; |
|
185 void setIteratorId(int id); |
|
186 |
|
187 QString name() const; |
|
188 void setName(const QString &name); |
|
189 |
|
190 QScriptDebuggerValue subordinateScriptValue() const; |
|
191 void setSubordinateScriptValue(const QScriptDebuggerValue &value); |
|
192 |
|
193 int snapshotId() const; |
|
194 void setSnapshotId(int id); |
|
195 |
|
196 QScriptDebuggerCommand &operator=(const QScriptDebuggerCommand &other); |
|
197 |
|
198 bool operator==(const QScriptDebuggerCommand &other) const; |
|
199 bool operator!=(const QScriptDebuggerCommand &other) const; |
|
200 |
|
201 static QScriptDebuggerCommand interruptCommand(); |
|
202 static QScriptDebuggerCommand continueCommand(); |
|
203 static QScriptDebuggerCommand stepIntoCommand(int count = 1); |
|
204 static QScriptDebuggerCommand stepOverCommand(int count = 1); |
|
205 static QScriptDebuggerCommand stepOutCommand(); |
|
206 static QScriptDebuggerCommand runToLocationCommand(const QString &fileName, int lineNumber); |
|
207 static QScriptDebuggerCommand runToLocationCommand(qint64 scriptId, int lineNumber); |
|
208 static QScriptDebuggerCommand forceReturnCommand(int contextIndex, const QScriptDebuggerValue &value); |
|
209 static QScriptDebuggerCommand resumeCommand(); |
|
210 |
|
211 static QScriptDebuggerCommand setBreakpointCommand(const QString &fileName, int lineNumber); |
|
212 static QScriptDebuggerCommand setBreakpointCommand(const QScriptBreakpointData &data); |
|
213 static QScriptDebuggerCommand deleteBreakpointCommand(int id); |
|
214 static QScriptDebuggerCommand deleteAllBreakpointsCommand(); |
|
215 static QScriptDebuggerCommand getBreakpointsCommand(); |
|
216 static QScriptDebuggerCommand getBreakpointDataCommand(int id); |
|
217 static QScriptDebuggerCommand setBreakpointDataCommand(int id, const QScriptBreakpointData &data); |
|
218 |
|
219 static QScriptDebuggerCommand getScriptsCommand(); |
|
220 static QScriptDebuggerCommand getScriptDataCommand(qint64 id); |
|
221 static QScriptDebuggerCommand scriptsCheckpointCommand(); |
|
222 static QScriptDebuggerCommand getScriptsDeltaCommand(); |
|
223 static QScriptDebuggerCommand resolveScriptCommand(const QString &fileName); |
|
224 |
|
225 static QScriptDebuggerCommand getBacktraceCommand(); |
|
226 static QScriptDebuggerCommand getContextCountCommand(); |
|
227 static QScriptDebuggerCommand getContextStateCommand(int contextIndex); |
|
228 static QScriptDebuggerCommand getContextInfoCommand(int contextIndex); |
|
229 static QScriptDebuggerCommand getContextIdCommand(int contextIndex); |
|
230 static QScriptDebuggerCommand getThisObjectCommand(int contextIndex); |
|
231 static QScriptDebuggerCommand getActivationObjectCommand(int contextIndex); |
|
232 static QScriptDebuggerCommand getScopeChainCommand(int contextIndex); |
|
233 static QScriptDebuggerCommand contextsCheckpoint(); |
|
234 static QScriptDebuggerCommand getPropertyExpressionValue(int contextIndex, int lineNumber, |
|
235 const QStringList &path); |
|
236 static QScriptDebuggerCommand getCompletions(int contextIndex, const QStringList &path); |
|
237 |
|
238 static QScriptDebuggerCommand newScriptObjectSnapshotCommand(); |
|
239 static QScriptDebuggerCommand scriptObjectSnapshotCaptureCommand(int id, const QScriptDebuggerValue &object); |
|
240 static QScriptDebuggerCommand deleteScriptObjectSnapshotCommand(int id); |
|
241 |
|
242 static QScriptDebuggerCommand newScriptValueIteratorCommand(const QScriptDebuggerValue &object); |
|
243 static QScriptDebuggerCommand getPropertiesByIteratorCommand(int id, int count); |
|
244 static QScriptDebuggerCommand deleteScriptValueIteratorCommand(int id); |
|
245 |
|
246 static QScriptDebuggerCommand evaluateCommand(int contextIndex, const QString &program, |
|
247 const QString &fileName = QString(), |
|
248 int lineNumber = 1); |
|
249 |
|
250 static QScriptDebuggerCommand setScriptValuePropertyCommand(const QScriptDebuggerValue &object, |
|
251 const QString &name, |
|
252 const QScriptDebuggerValue &value); |
|
253 static QScriptDebuggerCommand scriptValueToStringCommand(const QScriptDebuggerValue &value); |
|
254 |
|
255 static QScriptDebuggerCommand clearExceptionsCommand(); |
|
256 |
|
257 private: |
|
258 QScopedPointer<QScriptDebuggerCommandPrivate> d_ptr; |
|
259 |
|
260 Q_DECLARE_PRIVATE(QScriptDebuggerCommand) |
|
261 }; |
|
262 |
|
263 Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptDebuggerCommand &); |
|
264 Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptDebuggerCommand &); |
|
265 |
|
266 QT_END_NAMESPACE |
|
267 |
|
268 #endif |