File indexing completed on 2024-04-28 04:36:30
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_IRUNTIMECONTROLLER_H 0008 #define KDEVPLATFORM_IRUNTIMECONTROLLER_H 0009 0010 #include <interfaces/idocumentation.h> 0011 #include <QObject> 0012 #include <QVector> 0013 0014 namespace KDevelop { 0015 class IRuntime; 0016 0017 /** 0018 * @brief Exposes runtimes 0019 * 0020 * Makes it possible to have the IDE develop for different platforms other 0021 * than the local host by having available different runtimes that will give 0022 * access to the target systems. 0023 * 0024 * Allows to add runtimes, list them and offer a currentRuntime. 0025 * The currentRuntime will be the runtime towards which all the runtime and build 0026 * information * gathered by the IDE will be fetched from. 0027 * 0028 * @see IRuntime 0029 */ 0030 class KDEVPLATFORMINTERFACES_EXPORT IRuntimeController: public QObject 0031 { 0032 Q_OBJECT 0033 public: 0034 IRuntimeController(); 0035 ~IRuntimeController() override; 0036 0037 /** 0038 * Makes @p runtimes available to be used. 0039 * If @p runtimes has no parent, the controller will become its parent 0040 * and will remove it when needed. 0041 */ 0042 virtual void addRuntimes(KDevelop::IRuntime* runtimes) = 0; 0043 0044 /** 0045 * Lists available runtimes 0046 */ 0047 virtual QVector<IRuntime*> availableRuntimes() const = 0; 0048 0049 /** 0050 * Sets @p runtime as the currently used runtime and emits currentRuntimeChanged 0051 * so the IDE can adapt, if necessary. 0052 */ 0053 virtual void setCurrentRuntime(IRuntime* runtime) = 0; 0054 0055 /** 0056 * @returns the current runtime 0057 */ 0058 virtual IRuntime* currentRuntime() const = 0; 0059 0060 Q_SIGNALS: 0061 void currentRuntimeChanged(IRuntime* currentRuntime); 0062 }; 0063 0064 } 0065 0066 #endif