2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2020 Alexis Jeandet.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2020-10-29 10:20:14 +01:00
|
|
|
|
2020-05-01 18:20:56 +02:00
|
|
|
#pragma once
|
2020-10-29 10:20:14 +01:00
|
|
|
|
2020-05-01 18:20:56 +02:00
|
|
|
#include "toolwrapper.h"
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2024-07-22 18:10:51 +02:00
|
|
|
namespace MesonProjectManager::Internal {
|
2020-05-01 18:20:56 +02:00
|
|
|
|
|
|
|
|
class MesonTools : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
MesonTools() {}
|
|
|
|
|
~MesonTools() {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
using Tool_t = std::shared_ptr<ToolWrapper>;
|
|
|
|
|
|
|
|
|
|
static bool isMesonWrapper(const Tool_t &tool);
|
|
|
|
|
static bool isNinjaWrapper(const Tool_t &tool);
|
|
|
|
|
|
2024-07-22 17:49:58 +02:00
|
|
|
static void addTool(const Utils::Id &itemId,
|
|
|
|
|
const QString &name,
|
|
|
|
|
const Utils::FilePath &exe);
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2024-07-22 17:49:58 +02:00
|
|
|
static void addTool(Tool_t meson);
|
2020-05-01 18:20:56 +02:00
|
|
|
|
|
|
|
|
static void setTools(std::vector<Tool_t> &&tools);
|
|
|
|
|
|
2024-07-22 18:10:51 +02:00
|
|
|
static const std::vector<Tool_t> &tools();
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2024-07-22 17:49:58 +02:00
|
|
|
static void updateTool(const Utils::Id &itemId,
|
|
|
|
|
const QString &name,
|
|
|
|
|
const Utils::FilePath &exe);
|
|
|
|
|
static void removeTool(const Utils::Id &id);
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2024-07-22 18:10:51 +02:00
|
|
|
static std::shared_ptr<ToolWrapper> toolById(const Utils::Id &id, ToolType toolType);
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2024-07-22 18:10:51 +02:00
|
|
|
static std::shared_ptr<ToolWrapper> autoDetectedTool(ToolType toolType);
|
2020-05-01 18:20:56 +02:00
|
|
|
|
|
|
|
|
Q_SIGNAL void toolAdded(const Tool_t &tool);
|
|
|
|
|
Q_SIGNAL void toolRemoved(const Tool_t &tool);
|
|
|
|
|
|
2024-07-22 18:10:51 +02:00
|
|
|
static MesonTools *instance();
|
2020-05-01 18:20:56 +02:00
|
|
|
};
|
|
|
|
|
|
2024-07-22 18:10:51 +02:00
|
|
|
} // MesonProjectManager::Internal
|