OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / debuggercore.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
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.
18 **
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.
22 **
23 ** Other Usage
24 **
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.
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 #ifndef DEBUGGERCORE_H
34 #define DEBUGGERCORE_H
35
36 #include "debuggerconstants.h"
37
38 #include <projectexplorer/abi.h>
39
40 #include <QtCore/QObject>
41 #include <QtCore/QSharedPointer>
42
43 QT_BEGIN_NAMESPACE
44 class QIcon;
45 class QMessageBox;
46 class QWidget;
47 QT_END_NAMESPACE
48
49 namespace CPlusPlus {
50 class Snapshot;
51 }
52
53 namespace Utils {
54 class SavedAction;
55 }
56
57 namespace Debugger {
58
59 class DebuggerEngine;
60
61 namespace Internal {
62
63 class BreakHandler;
64 class SnapshotHandler;
65 class Symbol;
66 class DebuggerToolTipManager;
67 class GlobalDebuggerOptions;
68
69 class DebuggerCore : public QObject
70 {
71     Q_OBJECT
72
73 public:
74     DebuggerCore() {}
75
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;
91
92     virtual void clearCppCodeModelSnapshot() = 0;
93
94     // void runTest(const QString &fileName);
95     virtual void showMessage(const QString &msg, int channel, int timeout = -1) = 0;
96
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;
104
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;
114
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;
118
119     virtual DebuggerToolTipManager *toolTipManager() const = 0;
120     virtual QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const = 0;
121 };
122
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);
128
129 } // namespace Internal
130 } // namespace Debugger
131
132 #endif // DEBUGGERPLUGIN_H