aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nim/project/nimtoolchainfactory.h
blob: 7ee9f780a7e346becb0df454cd16574b732e5978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <projectexplorer/toolchain.h>
#include <projectexplorer/toolchainconfigwidget.h>

namespace Utils { class PathChooser; }

namespace Nim {

class NimToolChain;

class NimToolChainFactory : public ProjectExplorer::ToolChainFactory
{
public:
    NimToolChainFactory();

    ProjectExplorer::Toolchains autoDetect(const ProjectExplorer::ToolchainDetector &detector) const final;
    ProjectExplorer::Toolchains detectForImport(const ProjectExplorer::ToolChainDescription &tcd) const final;
};

class NimToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget
{
    Q_OBJECT

public:
    explicit NimToolChainConfigWidget(NimToolChain *tc);

protected:
    void applyImpl() final;
    void discardImpl() final;
    bool isDirtyImpl() const final;
    void makeReadOnlyImpl() final;

private:
    void fillUI();
    void onCompilerCommandChanged(const QString &path);

    Utils::PathChooser *m_compilerCommand;
    QLineEdit *m_compilerVersion;
};

}