Changeset View
Changeset View
Standalone View
Standalone View
shell/runtimecontroller.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright 2017 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Library General Public | ||||
6 | License version 2 as published by the Free Software Foundation. | ||||
7 | | ||||
8 | This library is distributed in the hope that it will be useful, | ||||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
11 | Library General Public License for more details. | ||||
12 | | ||||
13 | You should have received a copy of the GNU Library General Public License | ||||
14 | along with this library; see the file COPYING.LIB. If not, write to | ||||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
16 | Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | #ifndef KDEVPLATFORM_RUNTIMECONTROLLER_H | ||||
20 | #define KDEVPLATFORM_RUNTIMECONTROLLER_H | ||||
21 | | ||||
22 | #include <interfaces/iruntimecontroller.h> | ||||
23 | #include <interfaces/iruntime.h> | ||||
24 | #include <QAbstractListModel> | ||||
25 | | ||||
26 | class RuntimeViewFactory; | ||||
27 | class QAction; | ||||
28 | class QMenu; | ||||
29 | | ||||
30 | namespace KDevelop | ||||
31 | { | ||||
32 | | ||||
33 | class Core; | ||||
34 | class Context; | ||||
35 | class ContextMenuExtension; | ||||
36 | | ||||
37 | class RuntimeController : public IRuntimeController | ||||
38 | { | ||||
39 | Q_OBJECT | ||||
40 | public: | ||||
41 | explicit RuntimeController(Core* core); | ||||
42 | ~RuntimeController() override; | ||||
43 | | ||||
44 | void initialize(); | ||||
45 | | ||||
46 | void addRuntimes(KDevelop::IRuntime * runtimes) override; | ||||
47 | QVector<KDevelop::IRuntime *> availableRuntimes() const override; | ||||
48 | | ||||
49 | KDevelop::IRuntime * currentRuntime() const override; | ||||
50 | void setCurrentRuntime(KDevelop::IRuntime * runtime) override; | ||||
51 | | ||||
52 | private: | ||||
53 | QScopedPointer<QMenu> const m_runtimesMenu; | ||||
54 | QVector<IRuntime*> m_runtimes; | ||||
55 | IRuntime* m_currentRuntime = nullptr; | ||||
56 | }; | ||||
57 | | ||||
58 | } | ||||
59 | | ||||
60 | #endif |