aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projectfilewizardextension.h
blob: 2fe9886e1095c225555eba97094da346e0e5124c (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "projectexplorer_export.h"

#include <coreplugin/ifilewizardextension.h>

namespace ProjectExplorer {
class FolderNode;
class Node;
class Project;

namespace Internal {

class ProjectWizardContext;

class PROJECTEXPLORER_EXPORT ProjectFileWizardExtension : public Core::IFileWizardExtension
{
    Q_OBJECT

public:
    ~ProjectFileWizardExtension() override;

    QList<QWizardPage *> extensionPages(const Core::IWizardFactory *wizard) override;
    bool processFiles(const QList<Core::GeneratedFile> &files,
                      bool *removeOpenProjectAttribute, QString *errorMessage) override;
    void applyCodeStyle(Core::GeneratedFile *file) const override;

public slots:
    void firstExtensionPageShown(const QList<Core::GeneratedFile> &files, const QVariantMap &extraValues) override;

private:
    Node *findWizardContextNode(Node *contextNode, Project *project, const Utils::FilePath &path);
    bool processProject(const QList<Core::GeneratedFile> &files,
                        bool *removeOpenProjectAttribute, QString *errorMessage);

    ProjectWizardContext *m_context = nullptr;
};

} // namespace Internal
} // namespace ProjectExplorer