// Copyright (C) 2020 Alexis Jeandet. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once #include "toolwrapper.h" #include #include namespace MesonProjectManager { namespace Internal { class MesonTools : public QObject { Q_OBJECT MesonTools() {} ~MesonTools() {} public: using Tool_t = std::shared_ptr; static bool isMesonWrapper(const Tool_t &tool); static bool isNinjaWrapper(const Tool_t &tool); static void addTool(const Utils::Id &itemId, const QString &name, const Utils::FilePath &exe); static void addTool(Tool_t meson); static void setTools(std::vector &&tools); static inline const std::vector &tools() { return instance()->m_tools; } static void updateTool(const Utils::Id &itemId, const QString &name, const Utils::FilePath &exe); static void removeTool(const Utils::Id &id); static std::shared_ptr ninjaWrapper(const Utils::Id &id); static std::shared_ptr mesonWrapper(const Utils::Id &id); static std::shared_ptr autoDetectedNinja(); static std::shared_ptr autoDetectedMeson(); Q_SIGNAL void toolAdded(const Tool_t &tool); Q_SIGNAL void toolRemoved(const Tool_t &tool); static MesonTools *instance() { static MesonTools inst; return &inst; } private: std::vector m_tools; }; } // namespace Internal } // namespace MesonProjectManager