abstractmobileappwizard.h 3.81 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
2
**
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
7
**
hjk's avatar
hjk committed
8
9
10
11
12
13
14
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
15
16
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17
18
19
20
21
22
23
24
25
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
con's avatar
con committed
26
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
29
30
31
32

#ifndef ABSTRACTMOBILEAPPWIZARD_H
#define ABSTRACTMOBILEAPPWIZARD_H

33
#include <qmakeprojectmanager/qmakeprojectmanager_global.h>
34
#include <projectexplorer/baseprojectwizarddialog.h>
35
#include <qtsupport/baseqtversion.h>
36

37
38
namespace ProjectExplorer { class TargetSetupPage; }

39
namespace QtSupport { class QtVersionNumber; }
40

41
namespace QmakeProjectManager {
42
43

class AbstractMobileApp;
44
45

/// \internal
46
class QMAKEPROJECTMANAGER_EXPORT AbstractMobileAppWizardDialog : public ProjectExplorer::BaseProjectWizardDialog
47
48
{
    Q_OBJECT
49

50
protected:
51
52
53
    explicit AbstractMobileAppWizardDialog(QWidget *parent, const QtSupport::QtVersionNumber &minimumQtVersionNumber,
                                           const QtSupport::QtVersionNumber &maximumQtVersionNumber,
                                           const Core::WizardDialogParameters &parameters);
54
public:
55
    ProjectExplorer::TargetSetupPage *kitsPage() const;
56
57
58

protected:
    int addPageWithTitle(QWizardPage *page, const QString &title);
59
60
    void addKitsPage();
    void updateKitsPage();
Feetu Nyrhinen's avatar
Feetu Nyrhinen committed
61
62

private:
63
    ProjectExplorer::TargetSetupPage *m_kitsPage;
64
65
    const QtSupport::QtVersionNumber m_minimumQtVersionNumber;
    const QtSupport::QtVersionNumber m_maximumQtVersionNumber;
66
67
};

68
/// \internal
69
class QMAKEPROJECTMANAGER_EXPORT AbstractMobileAppWizard : public Core::BaseFileWizard
70
71
72
73
74
75
{
    Q_OBJECT

private slots:
    void useProjectPath(const QString &projectName, const QString &projectPath);

76
77
78
protected:
    virtual QString fileToOpenPostGeneration() const = 0;

79
private:
80
81
82
83
    QWizard *createWizardDialog(QWidget *parent,
                                const Core::WizardDialogParameters &wizardDialogParameters) const;
    Core::GeneratedFiles generateFiles(const QWizard *wizard, QString *errorMessage) const;
    bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
84

85
86
    virtual AbstractMobileApp *app() const = 0;
    virtual AbstractMobileAppWizardDialog *wizardDialog() const = 0;
87
88
    virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
                                                                      const Core::WizardDialogParameters &wizardDialogParameters) const = 0;
89
    virtual void projectPathChanged(const QString &path) const = 0;
90
    virtual void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const = 0;
91
92
};

93
} // namespace QmakeProjectManager
94
95

#endif // ABSTRACTMOBILEAPPWIZARD_H