Qt 4.8
qscriptengineagent_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtScript module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL-ONLY$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser
11 ** General Public License version 2.1 as published by the Free Software
12 ** Foundation and appearing in the file LICENSE.LGPL included in the
13 ** packaging of this file. Please review the following information to
14 ** ensure the GNU Lesser General Public License version 2.1 requirements
15 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** If you have questions regarding the use of this file, please contact
18 ** us via http://www.qt-project.org/.
19 **
20 ** $QT_END_LICENSE$
21 **
22 ****************************************************************************/
23 
24 #ifndef QSCRIPTENGINEAGENT_P_H
25 #define QSCRIPTENGINEAGENT_P_H
26 
27 //
28 // W A R N I N G
29 // -------------
30 //
31 // This file is not part of the Qt API. It exists purely as an
32 // implementation detail. This header file may change from version to
33 // version without notice, or even be removed.
34 //
35 // We mean it.
36 //
37 
38 #include <QtCore/qobjectdefs.h>
39 #include "Debugger.h"
40 #include "qscriptengineagent.h"
41 
42 #include "CallFrame.h"
43 #include "SourceCode.h"
44 #include "UString.h"
45 #include "DebuggerCallFrame.h"
46 
48 
50 
51 class QScriptEngineAgent;
52 class Q_SCRIPT_EXPORT QScriptEngineAgentPrivate : public JSC::Debugger
53 {
55 public:
56  static QScriptEngineAgent* get(QScriptEngineAgentPrivate* p) {return p->q_func();}
57  static QScriptEngineAgentPrivate* get(QScriptEngineAgent* p) {return p->d_func();}
58 
61 
62  void attach();
63  void detach();
64 
65  //scripts
66  virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int /*errorLine*/, const JSC::UString& /*errorMsg*/) {}
67  virtual void scriptUnload(qint64 id)
68  {
69  q_ptr->scriptUnload(id);
70  }
71  virtual void scriptLoad(qint64 id, const JSC::UString &program,
72  const JSC::UString &fileName, int baseLineNumber)
73  {
74  q_ptr->scriptLoad(id,program, fileName, baseLineNumber);
75  }
76 
77  //exceptions
78  virtual void exception(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno, bool hasHandler)
79  {
80  Q_UNUSED(frame);
81  Q_UNUSED(sourceID);
82  Q_UNUSED(lineno);
83  Q_UNUSED(hasHandler);
84  }
85  virtual void exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler);
86  virtual void exceptionCatch(const JSC::DebuggerCallFrame& frame, intptr_t sourceID);
87 
88  //statements
89  virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno/*, int column*/);
90  virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno)
91  {
92  Q_UNUSED(lineno);
93  q_ptr->contextPush();
94  q_ptr->functionEntry(sourceID);
95  }
96  virtual void returnEvent(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno);
97  virtual void willExecuteProgram(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno)
98  {
99  Q_UNUSED(frame);
100  Q_UNUSED(sourceID);
101  Q_UNUSED(lineno);
102  }
103  virtual void didExecuteProgram(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno)
104  {
105  Q_UNUSED(frame);
106  Q_UNUSED(sourceID);
107  Q_UNUSED(lineno);
108  }
109  virtual void functionExit(const JSC::JSValue& returnValue, intptr_t sourceID);
110  //others
111  virtual void didReachBreakpoint(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno/*, int column*/);
112 
113  virtual void evaluateStart(intptr_t sourceID)
114  {
115  q_ptr->functionEntry(sourceID);
116  }
117  virtual void evaluateStop(const JSC::JSValue& returnValue, intptr_t sourceID);
118 
121 };
122 
124 
125 #endif
virtual void callEvent(const JSC::DebuggerCallFrame &, intptr_t sourceID, int lineno)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
virtual void exception(const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno, bool hasHandler)
virtual void sourceParsed(JSC::ExecState *, const JSC::SourceCode &, int, const JSC::UString &)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual void scriptUnload(qint64 id)
__int64 qint64
Definition: qglobal.h:942
virtual void scriptLoad(qint64 id, const JSC::UString &program, const JSC::UString &fileName, int baseLineNumber)
#define Q_SCRIPT_EXPORT
Definition: qglobal.h:1460
virtual void didExecuteProgram(const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno)
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
QScriptEnginePrivate * engine
virtual void willExecuteProgram(const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno)
virtual void evaluateStart(intptr_t sourceID)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
static QString fileName(const QString &fileUrl)
The QScriptEngineAgent class provides an interface to report events pertaining to QScriptEngine execu...
INT_PTR intptr_t