aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljseditor/qmljscomponentnamedialog.h
blob: 63c0a76d87de8b193acff66b9b74037ace03f8d9 (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+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QDialog>

namespace QmlJSEditor {
namespace Internal {

namespace Ui { class ComponentNameDialog; }

class ComponentNameDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ComponentNameDialog(QWidget *parent = nullptr);
    ~ComponentNameDialog() override;

    static bool go(QString *proposedName, QString *proposedPath, QString *proposedSuffix,
                   const QStringList &properties, const QStringList &sourcePreview, const QString &oldFileName,
                   QStringList *result,
                   QWidget *parent = nullptr);

    void setProperties(const QStringList &properties);

    QStringList propertiesToKeep() const;

    void generateCodePreview();

    void validate();

protected:
    QString isValid() const;

private:
    Ui::ComponentNameDialog *ui;
    QStringList m_sourcePreview;
};

} // namespace Internal
} // namespace QmlJSEditor