Fixes a crash in QDoubleSpinBox
[qt-netbsd.git] / src / scripttools / debugging / qscriptdebuggercommand_p.h
blobc0841d6dfaef45869688a23cd1eafe5acbd26966
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 ** Commercial Usage
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.
38 ** $QT_END_LICENSE$
40 ****************************************************************************/
42 #ifndef QSCRIPTDEBUGGERCOMMAND_P_H
43 #define QSCRIPTDEBUGGERCOMMAND_P_H
46 // W A R N I N G
47 // -------------
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.
53 // We mean it.
56 #include <QtCore/qobjectdefs.h>
58 #include <QtCore/qhash.h>
59 #include <QtCore/qvariant.h>
61 QT_BEGIN_NAMESPACE
63 class QDataStream;
64 class QScriptBreakpointData;
65 class QScriptDebuggerValue;
67 class QScriptDebuggerCommandPrivate;
68 class Q_AUTOTEST_EXPORT QScriptDebuggerCommand
70 public:
71 friend Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptDebuggerCommand &);
72 friend Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptDebuggerCommand &);
74 enum Type {
75 None,
77 Interrupt,
78 Continue,
79 StepInto,
80 StepOver,
81 StepOut,
82 RunToLocation,
83 RunToLocationByID,
84 ForceReturn,
85 Resume,
87 SetBreakpoint,
88 DeleteBreakpoint,
89 DeleteAllBreakpoints,
90 GetBreakpoints,
91 GetBreakpointData,
92 SetBreakpointData,
94 GetScripts,
95 GetScriptData,
96 ScriptsCheckpoint,
97 GetScriptsDelta,
98 ResolveScript,
100 GetBacktrace,
101 GetContextCount,
102 GetContextInfo,
103 GetContextState,
104 GetContextID,
105 GetThisObject,
106 GetActivationObject,
107 GetScopeChain,
108 ContextsCheckpoint,
110 NewScriptObjectSnapshot,
111 ScriptObjectSnapshotCapture,
112 DeleteScriptObjectSnapshot,
114 NewScriptValueIterator,
115 GetPropertiesByIterator,
116 DeleteScriptValueIterator,
118 Evaluate,
120 SetScriptValueProperty,
121 ScriptValueToString,
123 ClearExceptions,
125 UserCommand = 1000,
126 MaxUserCommand = 32767
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
147 QScriptDebuggerCommand();
148 QScriptDebuggerCommand(Type type);
149 QScriptDebuggerCommand(const QScriptDebuggerCommand &other);
150 ~QScriptDebuggerCommand();
152 Type type() const;
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(),
243 int lineNumber = 1);
245 static QScriptDebuggerCommand setScriptValuePropertyCommand(const QScriptDebuggerValue &object,
246 const QString &name,
247 const QScriptDebuggerValue &value);
248 static QScriptDebuggerCommand scriptValueToStringCommand(const QScriptDebuggerValue &value);
250 static QScriptDebuggerCommand clearExceptionsCommand();
252 private:
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 &);
261 QT_END_NAMESPACE
263 #endif