summaryrefslogtreecommitdiff
path: root/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h
blob: 8a060f9b8023c03e147dfa5304991b2f7c9f8a06 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// 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 "filenamingparameters.h"

#include <QWizardPage>
#include <QSharedPointer>

QT_BEGIN_NAMESPACE
class QLineEdit;
class QLabel;
QT_END_NAMESPACE

namespace QmakeProjectManager {
namespace Internal {

struct PluginOptions;
class CustomWidgetWidgetsWizardPage;

class CustomWidgetPluginWizardPage : public QWizardPage
{
    Q_OBJECT

public:
    explicit CustomWidgetPluginWizardPage(QWidget *parent = nullptr);

    void init(const CustomWidgetWidgetsWizardPage *widgetsPage);

    bool isComplete() const override;

    FileNamingParameters fileNamingParameters() const { return m_fileNamingParameters; }
    void setFileNamingParameters(const FileNamingParameters &fnp) {m_fileNamingParameters = fnp; }

    // Fills the plugin fields, excluding widget list.
    QSharedPointer<PluginOptions> basicPluginOptions() const;

private:
    void slotCheckCompleteness();
    inline QString collectionClassName() const;
    inline QString pluginName() const;
    void setCollectionEnabled(bool enColl);

    FileNamingParameters m_fileNamingParameters;
    int m_classCount;
    bool m_complete;

    QLabel *m_collectionClassLabel;
    QLineEdit *m_collectionClassEdit;
    QLabel *m_collectionHeaderLabel;
    QLineEdit *m_collectionHeaderEdit;
    QLabel *m_collectionSourceLabel;
    QLineEdit *m_collectionSourceEdit;
    QLineEdit *m_pluginNameEdit;
    QLineEdit *m_resourceFileEdit;
};

} // namespace Internal
} // namespace QmakeProjectManager