File indexing completed on 2024-04-28 04:37:24

0001 /*
0002     SPDX-FileCopyrightText: 2017 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef KDEVPLATFORM_RUNTIMECONTROLLER_H
0008 #define KDEVPLATFORM_RUNTIMECONTROLLER_H
0009 
0010 #include <interfaces/iruntimecontroller.h>
0011 #include <interfaces/iruntime.h>
0012 
0013 class RuntimeViewFactory;
0014 class QMenu;
0015 
0016 namespace KDevelop
0017 {
0018 
0019 class Core;
0020 
0021 class RuntimeController : public IRuntimeController
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit RuntimeController(Core* core);
0026     ~RuntimeController() override;
0027 
0028     void initialize();
0029 
0030     void addRuntimes(KDevelop::IRuntime * runtimes) override;
0031     QVector<KDevelop::IRuntime *> availableRuntimes() const override;
0032 
0033     KDevelop::IRuntime * currentRuntime() const override;
0034     void setCurrentRuntime(KDevelop::IRuntime * runtime) override;
0035 
0036 private:
0037     void setupActions();
0038 
0039 private:
0040     QScopedPointer<QMenu> m_runtimesMenu;
0041     QVector<IRuntime*> m_runtimes;
0042     IRuntime* m_currentRuntime = nullptr;
0043     Core* const m_core;
0044 };
0045 
0046 }
0047 
0048 #endif