aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qt4projectmanager/wizards/targetsetuppage.h
blob: 0c32e5ebad14b5be9bbc780d6e2db89a83c323c1 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/

#ifndef TARGETSETUPPAGE_H
#define TARGETSETUPPAGE_H

#include "../qt4target.h"
#include "../qt4projectmanager_global.h"
#include <qtsupport/qtversionmanager.h>
#include <coreplugin/featureprovider.h>

#include <QString>
#include <QWizard>


QT_BEGIN_NAMESPACE
class QLabel;
class QMenu;
class QPushButton;
class QSpacerItem;
class QTreeWidget;
class QTreeWidgetItem;
class QVBoxLayout;
QT_END_NAMESPACE

namespace Qt4ProjectManager {
class Qt4Project;

namespace Internal {
namespace Ui {
class TargetSetupPage;
}
}

/// \internal
class QT4PROJECTMANAGER_EXPORT TargetSetupPage : public QWizardPage
{
    Q_OBJECT

public:
    explicit TargetSetupPage(QWidget* parent = 0);
    ~TargetSetupPage();

    /// Initializes the TargetSetupPage
    /// \note The import information is gathered in initializePage(), make sure that the right proFilePath is set before
    void initializePage();
    /// Changes the default set of checked targets.
    /// call this before \sa initializePage()
    void setPreferredFeatures(const QSet<QString> &featureIds);
    /// Sets the features a target must support
    /// call this before \sa initializePage()
    void setRequiredTargetFeatures(const QSet<QString> &featureIds);
    /// Sets the features a qt version must support
    /// call this before \sa initializePage()
    void setRequiredQtFeatures(const Core::FeatureSet &features);
    /// Sets the platform that was selected in the wizard
    void setSelectedPlatform(const QString &platform);
    /// Sets the minimum qt version
    /// calls this before \sa initializePage()
    void setMinimumQtVersion(const QtSupport::QtVersionNumber &number);
    /// Sets the maximum qt version
    /// calls this before \sa initializePage()
    void setMaximumQtVersion(const QtSupport::QtVersionNumber &number);
    /// Sets whether the TargetSetupPage looks on disk for builds of this project
    /// call this before \sa initializePage()
    void setImportSearch(bool b);

    /// Sets whether the targetsetupage uses a scrollarea
    /// to host the widgets from the factories
    /// call this before \sa initializePage()
    void setUseScrollArea(bool b);

    bool isComplete() const;
    bool setupProject(Qt4ProjectManager::Qt4Project *project);
    bool isTargetSelected(const QString &id) const;
    void setProFilePath(const QString &dir);

    /// Overrides the summary text of the targetsetuppage
    void setNoteText(const QString &text);
signals:
    void noteTextLinkActivated();

private slots:
    void newImportBuildConfiguration(const BuildConfigurationInfo &info);

private:
    void setupImportInfos();
    void cleanupImportInfos();
    void setupWidgets();
    void deleteWidgets();

    QSet<QString> m_preferredFeatures;
    QSet<QString> m_requiredTargetFeatures;
    Core::FeatureSet m_requiredQtFeatures;
    QString m_selectedPlatform;
    bool m_importSearch;
    bool m_useScrollArea;
    QtSupport::QtVersionNumber m_minimumQtVersionNumber;
    QtSupport::QtVersionNumber m_maximumQtVersionNumber;
    QString m_proFilePath;
    QString m_defaultShadowBuildLocation;
    QMap<QString, Qt4TargetSetupWidget *> m_widgets;
    QHash<Qt4TargetSetupWidget *, Qt4BaseTargetFactory *> m_factories;

    QSpacerItem *m_spacer;
    Internal::Ui::TargetSetupPage *m_ui;
    QList<BuildConfigurationInfo> m_importInfos;
};

} // namespace Qt4ProjectManager

#endif // TARGETSETUPPAGE_H