1/*
2 Copyright (C) 2009 George Kiagiadakis <gkiagia@users.sourceforge.net>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#ifndef DEBUGGERLAUNCHERS_H
18#define DEBUGGERLAUNCHERS_H
19
20#include <QtDBus/QDBusAbstractAdaptor>
21
22#include "debugger.h"
23#include "debuggermanager.h"
24
25class DetachedProcessMonitor;
26
27class AbstractDebuggerLauncher : public QObject
28{
29 Q_OBJECT
30 Q_PROPERTY(QString name READ name)
31public:
32 explicit AbstractDebuggerLauncher(DebuggerManager *parent = 0) : QObject(parent) {}
33 virtual QString name() const = 0;
34
35public slots:
36 virtual void start() = 0;
37
38signals:
39 void starting();
40 void finished();
41 void invalidated();
42};
43
44class DefaultDebuggerLauncher : public AbstractDebuggerLauncher
45{
46 Q_OBJECT
47public:
48 explicit DefaultDebuggerLauncher(const Debugger & debugger, DebuggerManager *parent = 0);
49 virtual QString name() const;
50
51public slots:
52 virtual void start();
53
54private slots:
55 void onProcessFinished();
56
57private:
58 const Debugger m_debugger;
59 DetachedProcessMonitor *m_monitor;
60};
61
62#if 0
63class TerminalDebuggerLauncher : public DefaultDebuggerLauncher
64{
65 Q_OBJECT
66public:
67 explicit TerminalDebuggerLauncher(const Debugger & debugger, DebuggerManager *parent = 0);
68
69public slots:
70 virtual void start();
71};
72#endif
73
74class DBusOldInterfaceAdaptor;
75
76/** This class handles the old drkonqi dbus interface used by kdevelop */
77class DBusOldInterfaceLauncher : public AbstractDebuggerLauncher
78{
79 Q_OBJECT
80 friend class DBusOldInterfaceAdaptor;
81public:
82 explicit DBusOldInterfaceLauncher(DebuggerManager *parent = 0);
83 virtual QString name() const;
84
85public slots:
86 virtual void start();
87
88signals:
89 void available();
90
91private:
92 QString m_name;
93 DBusOldInterfaceAdaptor *m_adaptor;
94};
95
96class DBusOldInterfaceAdaptor : public QDBusAbstractAdaptor
97{
98 Q_OBJECT
99 Q_CLASSINFO("D-Bus Interface", "org.kde.Krash")
100 friend class DBusOldInterfaceLauncher;
101public:
102 explicit DBusOldInterfaceAdaptor(DBusOldInterfaceLauncher *parent);
103
104public slots:
105 int pid();
106 Q_NOREPLY void registerDebuggingApplication(const QString & name);
107
108signals:
109 void acceptDebuggingApplication();
110};
111
112#endif // DEBUGGERLAUNCHERS_H
113