1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef DEBUGGERCORE_H
34 #define DEBUGGERCORE_H
36 #include "debuggerconstants.h"
38 #include <projectexplorer/abi.h>
40 #include <QtCore/QObject>
41 #include <QtCore/QSharedPointer>
64 class SnapshotHandler;
66 class DebuggerToolTipManager;
67 class GlobalDebuggerOptions;
69 class DebuggerCore : public QObject
76 virtual QVariant sessionValue(const QString &name) = 0;
77 virtual void setSessionValue(const QString &name, const QVariant &value) = 0;
78 virtual QVariant configValue(const QString &name) const = 0;
79 virtual void setConfigValue(const QString &name, const QVariant &value) = 0;
80 virtual void updateState(DebuggerEngine *engine) = 0;
81 virtual void updateWatchersWindow() = 0;
82 virtual void showQtDumperLibraryWarning(const QString &details) = 0;
83 virtual QIcon locationMarkIcon() const = 0;
84 virtual const CPlusPlus::Snapshot &cppCodeModelSnapshot() const = 0;
85 virtual bool hasSnapshots() const = 0;
86 virtual void openTextEditor(const QString &titlePattern, const QString &contents) = 0;
87 virtual BreakHandler *breakHandler() const = 0;
88 virtual SnapshotHandler *snapshotHandler() const = 0;
89 virtual DebuggerEngine *currentEngine() const = 0;
90 virtual bool isActiveDebugLanguage(int language) const = 0;
92 virtual void clearCppCodeModelSnapshot() = 0;
94 // void runTest(const QString &fileName);
95 virtual void showMessage(const QString &msg, int channel, int timeout = -1) = 0;
97 virtual bool isReverseDebugging() const = 0;
98 virtual void runControlStarted(DebuggerEngine *engine) = 0;
99 virtual void runControlFinished(DebuggerEngine *engine) = 0;
100 virtual void displayDebugger(DebuggerEngine *engine, bool updateEngine) = 0;
101 virtual DebuggerLanguages activeLanguages() const = 0;
102 virtual unsigned enabledEngines() const = 0;
103 virtual void synchronizeBreakpoints() = 0;
105 virtual bool initialize(const QStringList &arguments, QString *errorMessage) = 0;
106 virtual QWidget *mainWindow() const = 0;
107 virtual bool isDockVisible(const QString &objectName) const = 0;
108 virtual QString debuggerForAbi(const ProjectExplorer::Abi &abi, DebuggerEngineType et = NoEngineType) const = 0;
109 virtual void showModuleSymbols(const QString &moduleName,
110 const QVector<Symbol> &symbols) = 0;
111 virtual void openMemoryEditor() = 0;
112 virtual void languagesChanged() = 0;
113 virtual void executeDebuggerCommand(const QString &command) = 0;
115 virtual Utils::SavedAction *action(int code) const = 0;
116 virtual bool boolSetting(int code) const = 0;
117 virtual QString stringSetting(int code) const = 0;
119 virtual DebuggerToolTipManager *toolTipManager() const = 0;
120 virtual QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const = 0;
123 // This is the only way to access the global object.
124 DebuggerCore *debuggerCore();
125 inline BreakHandler *breakHandler() { return debuggerCore()->breakHandler(); }
126 QMessageBox *showMessageBox(int icon, const QString &title,
127 const QString &text, int buttons = 0);
129 } // namespace Internal
130 } // namespace Debugger
132 #endif // DEBUGGERPLUGIN_H