| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** All rights reserved.
|
|---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
|---|
| 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.
|
|---|
| 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 | ** 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 have questions regarding the use of this file, please contact
|
|---|
| 37 | ** Nokia at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #ifndef QSCRIPTDEBUGGER_P_H
|
|---|
| 43 | #define QSCRIPTDEBUGGER_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/qobject.h>
|
|---|
| 57 |
|
|---|
| 58 | QT_BEGIN_NAMESPACE
|
|---|
| 59 |
|
|---|
| 60 | class QScriptDebuggerFrontend;
|
|---|
| 61 | class QScriptDebuggerConsoleWidgetInterface;
|
|---|
| 62 | class QScriptDebuggerScriptsWidgetInterface;
|
|---|
| 63 | class QScriptDebuggerCodeWidgetInterface;
|
|---|
| 64 | class QScriptDebuggerCodeFinderWidgetInterface;
|
|---|
| 65 | class QScriptBreakpointsWidgetInterface;
|
|---|
| 66 | class QScriptDebuggerStackWidgetInterface;
|
|---|
| 67 | class QScriptDebuggerLocalsWidgetInterface;
|
|---|
| 68 | class QScriptDebugOutputWidgetInterface;
|
|---|
| 69 | class QScriptErrorLogWidgetInterface;
|
|---|
| 70 | class QScriptDebuggerWidgetFactoryInterface;
|
|---|
| 71 | class QAction;
|
|---|
| 72 | class QEvent;
|
|---|
| 73 | class QMenu;
|
|---|
| 74 | #ifndef QT_NO_TOOLBAR
|
|---|
| 75 | class QToolBar;
|
|---|
| 76 | #endif
|
|---|
| 77 |
|
|---|
| 78 | class QScriptDebuggerPrivate;
|
|---|
| 79 | class Q_AUTOTEST_EXPORT QScriptDebugger : public QObject
|
|---|
| 80 | {
|
|---|
| 81 | Q_OBJECT
|
|---|
| 82 | public:
|
|---|
| 83 | // mirrors QScriptEngineDebugger::DebuggerWidget
|
|---|
| 84 | enum DebuggerWidget {
|
|---|
| 85 | ConsoleWidget,
|
|---|
| 86 | StackWidget,
|
|---|
| 87 | ScriptsWidget,
|
|---|
| 88 | LocalsWidget,
|
|---|
| 89 | CodeWidget,
|
|---|
| 90 | CodeFinderWidget,
|
|---|
| 91 | BreakpointsWidget,
|
|---|
| 92 | DebugOutputWidget,
|
|---|
| 93 | ErrorLogWidget
|
|---|
| 94 | };
|
|---|
| 95 | // mirrors QScriptEngineDebugger::DebuggerAction
|
|---|
| 96 | enum DebuggerAction {
|
|---|
| 97 | InterruptAction,
|
|---|
| 98 | ContinueAction,
|
|---|
| 99 | StepIntoAction,
|
|---|
| 100 | StepOverAction,
|
|---|
| 101 | StepOutAction,
|
|---|
| 102 | RunToCursorAction,
|
|---|
| 103 | RunToNewScriptAction,
|
|---|
| 104 | ToggleBreakpointAction,
|
|---|
| 105 | ClearDebugOutputAction,
|
|---|
| 106 | ClearErrorLogAction,
|
|---|
| 107 | ClearConsoleAction,
|
|---|
| 108 | FindInScriptAction,
|
|---|
| 109 | FindNextInScriptAction,
|
|---|
| 110 | FindPreviousInScriptAction,
|
|---|
| 111 | GoToLineAction
|
|---|
| 112 | };
|
|---|
| 113 |
|
|---|
| 114 | QScriptDebugger(QObject *parent = 0);
|
|---|
| 115 | ~QScriptDebugger();
|
|---|
| 116 |
|
|---|
| 117 | QScriptDebuggerFrontend *frontend() const;
|
|---|
| 118 | void setFrontend(QScriptDebuggerFrontend *frontend);
|
|---|
| 119 |
|
|---|
| 120 | QWidget *widget(DebuggerWidget widget);
|
|---|
| 121 | QAction *action(DebuggerAction action, QObject *parent);
|
|---|
| 122 |
|
|---|
| 123 | QScriptDebuggerConsoleWidgetInterface *consoleWidget() const;
|
|---|
| 124 | void setConsoleWidget(QScriptDebuggerConsoleWidgetInterface *consoleWidget);
|
|---|
| 125 |
|
|---|
| 126 | QScriptDebuggerScriptsWidgetInterface *scriptsWidget() const;
|
|---|
| 127 | void setScriptsWidget(QScriptDebuggerScriptsWidgetInterface *scriptsWidget);
|
|---|
| 128 |
|
|---|
| 129 | QScriptDebuggerCodeWidgetInterface *codeWidget() const;
|
|---|
| 130 | void setCodeWidget(QScriptDebuggerCodeWidgetInterface *codeWidget);
|
|---|
| 131 |
|
|---|
| 132 | QScriptDebuggerCodeFinderWidgetInterface *codeFinderWidget() const;
|
|---|
| 133 | void setCodeFinderWidget(QScriptDebuggerCodeFinderWidgetInterface *codeFinderWidget);
|
|---|
| 134 |
|
|---|
| 135 | QScriptDebuggerStackWidgetInterface *stackWidget() const;
|
|---|
| 136 | void setStackWidget(QScriptDebuggerStackWidgetInterface *stackWidget);
|
|---|
| 137 |
|
|---|
| 138 | QScriptDebuggerLocalsWidgetInterface *localsWidget() const;
|
|---|
| 139 | void setLocalsWidget(QScriptDebuggerLocalsWidgetInterface *localsWidget);
|
|---|
| 140 |
|
|---|
| 141 | QScriptBreakpointsWidgetInterface *breakpointsWidget() const;
|
|---|
| 142 | void setBreakpointsWidget(QScriptBreakpointsWidgetInterface *breakpointsWidget);
|
|---|
| 143 |
|
|---|
| 144 | QScriptDebugOutputWidgetInterface *debugOutputWidget() const;
|
|---|
| 145 | void setDebugOutputWidget(QScriptDebugOutputWidgetInterface *debugOutputWidget);
|
|---|
| 146 |
|
|---|
| 147 | QScriptErrorLogWidgetInterface *errorLogWidget() const;
|
|---|
| 148 | void setErrorLogWidget(QScriptErrorLogWidgetInterface *errorLogWidget);
|
|---|
| 149 |
|
|---|
| 150 | QScriptDebuggerWidgetFactoryInterface *widgetFactory() const;
|
|---|
| 151 | void setWidgetFactory(QScriptDebuggerWidgetFactoryInterface *factory);
|
|---|
| 152 |
|
|---|
| 153 | QAction *interruptAction(QObject *parent) const;
|
|---|
| 154 | QAction *continueAction(QObject *parent) const;
|
|---|
| 155 | QAction *stepIntoAction(QObject *parent) const;
|
|---|
| 156 | QAction *stepOverAction(QObject *parent) const;
|
|---|
| 157 | QAction *stepOutAction(QObject *parent) const;
|
|---|
| 158 | QAction *runToCursorAction(QObject *parent) const;
|
|---|
| 159 | QAction *runToNewScriptAction(QObject *parent) const;
|
|---|
| 160 |
|
|---|
| 161 | QAction *toggleBreakpointAction(QObject *parent) const;
|
|---|
| 162 |
|
|---|
| 163 | QAction *findInScriptAction(QObject *parent) const;
|
|---|
| 164 | QAction *findNextInScriptAction(QObject *parent) const;
|
|---|
| 165 | QAction *findPreviousInScriptAction(QObject *parent) const;
|
|---|
| 166 | QAction *goToLineAction(QObject *parent) const;
|
|---|
| 167 |
|
|---|
| 168 | QAction *clearDebugOutputAction(QObject *parent) const;
|
|---|
| 169 | QAction *clearConsoleAction(QObject *parent) const;
|
|---|
| 170 | QAction *clearErrorLogAction(QObject *parent) const;
|
|---|
| 171 |
|
|---|
| 172 | QMenu *createStandardMenu(QWidget *widgetParent, QObject *actionParent);
|
|---|
| 173 | #ifndef QT_NO_TOOLBAR
|
|---|
| 174 | QToolBar *createStandardToolBar(QWidget *widgetParent, QObject *actionParent);
|
|---|
| 175 | #endif
|
|---|
| 176 | bool eventFilter(QObject *, QEvent *e);
|
|---|
| 177 |
|
|---|
| 178 | bool isInteractive() const;
|
|---|
| 179 |
|
|---|
| 180 | Q_SIGNALS:
|
|---|
| 181 | void stopped() const;
|
|---|
| 182 | void started() const;
|
|---|
| 183 |
|
|---|
| 184 | protected:
|
|---|
| 185 | void timerEvent(QTimerEvent *e);
|
|---|
| 186 |
|
|---|
| 187 | protected:
|
|---|
| 188 | QScriptDebugger(QScriptDebuggerPrivate &dd, QObject *parent);
|
|---|
| 189 |
|
|---|
| 190 | private:
|
|---|
| 191 | Q_DECLARE_PRIVATE(QScriptDebugger)
|
|---|
| 192 | Q_DISABLE_COPY(QScriptDebugger)
|
|---|
| 193 |
|
|---|
| 194 | Q_PRIVATE_SLOT(d_func(), void _q_onLineEntered(const QString &))
|
|---|
| 195 | Q_PRIVATE_SLOT(d_func(), void _q_onCurrentFrameChanged(int))
|
|---|
| 196 | Q_PRIVATE_SLOT(d_func(), void _q_onCurrentScriptChanged(qint64))
|
|---|
| 197 | Q_PRIVATE_SLOT(d_func(), void _q_onScriptLocationSelected(int))
|
|---|
| 198 |
|
|---|
| 199 | Q_PRIVATE_SLOT(d_func(), void _q_interrupt())
|
|---|
| 200 | Q_PRIVATE_SLOT(d_func(), void _q_continue())
|
|---|
| 201 | Q_PRIVATE_SLOT(d_func(), void _q_stepInto())
|
|---|
| 202 | Q_PRIVATE_SLOT(d_func(), void _q_stepOver())
|
|---|
| 203 | Q_PRIVATE_SLOT(d_func(), void _q_stepOut())
|
|---|
| 204 | Q_PRIVATE_SLOT(d_func(), void _q_runToCursor())
|
|---|
| 205 | Q_PRIVATE_SLOT(d_func(), void _q_runToNewScript())
|
|---|
| 206 |
|
|---|
| 207 | Q_PRIVATE_SLOT(d_func(), void _q_toggleBreakpoint())
|
|---|
| 208 |
|
|---|
| 209 | Q_PRIVATE_SLOT(d_func(), void _q_clearDebugOutput())
|
|---|
| 210 | Q_PRIVATE_SLOT(d_func(), void _q_clearErrorLog())
|
|---|
| 211 | Q_PRIVATE_SLOT(d_func(), void _q_clearConsole())
|
|---|
| 212 |
|
|---|
| 213 | Q_PRIVATE_SLOT(d_func(), void _q_findInScript())
|
|---|
| 214 | Q_PRIVATE_SLOT(d_func(), void _q_findNextInScript())
|
|---|
| 215 | Q_PRIVATE_SLOT(d_func(), void _q_findPreviousInScript())
|
|---|
| 216 | Q_PRIVATE_SLOT(d_func(), void _q_onFindCodeRequest(const QString &, int))
|
|---|
| 217 | Q_PRIVATE_SLOT(d_func(), void _q_goToLine())
|
|---|
| 218 | };
|
|---|
| 219 |
|
|---|
| 220 | QT_END_NAMESPACE
|
|---|
| 221 |
|
|---|
| 222 | #endif
|
|---|