OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / projectexplorer / buildsettingspropertiespage.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef BUILDSETTINGSPROPERTIESPAGE_H
34 #define BUILDSETTINGSPROPERTIESPAGE_H
35
36 #include "iprojectproperties.h"
37
38 #include <QtGui/QWidget>
39 #include <QtGui/QIcon>
40
41 QT_BEGIN_NAMESPACE
42 class QComboBox;
43 class QLabel;
44 class QMenu;
45 class QPushButton;
46 QT_END_NAMESPACE
47
48 namespace ProjectExplorer {
49
50 class BuildConfiguration;
51 class BuildConfigWidget;
52 class IBuildStepFactory;
53
54 namespace Internal {
55
56 const char * const BUILDSETTINGS_PANEL_ID("ProjectExplorer.BuildSettingsPanel");
57
58 class BuildSettingsPanelFactory : public ITargetPanelFactory
59 {
60 public:
61     QString id() const;
62     QString displayName() const;
63
64     bool supports(Target *target);
65     IPropertiesPanel *createPanel(Target *target);
66 };
67
68 class BuildSettingsWidget;
69
70 class BuildSettingsPanel : public IPropertiesPanel
71 {
72 public:
73     BuildSettingsPanel(Target *target);
74     ~BuildSettingsPanel();
75     QString displayName() const;
76     QWidget *widget() const;
77     QIcon icon() const;
78
79 private:
80     BuildSettingsWidget *m_widget;
81     const QIcon m_icon;
82 };
83
84 class BuildConfigurationsWidget;
85
86 class BuildSettingsWidget : public QWidget
87 {
88     Q_OBJECT
89 public:
90     BuildSettingsWidget(Target *target);
91     ~BuildSettingsWidget();
92
93     void clear();
94     void addSubWidget(BuildConfigWidget *widget);
95     QList<BuildConfigWidget *> subWidgets() const;
96
97     void setupUi();
98
99 private slots:
100     void updateBuildSettings();
101     void currentIndexChanged(int index);
102
103     void createConfiguration();
104     void cloneConfiguration();
105     void deleteConfiguration();
106     void renameConfiguration();
107     void updateAddButtonMenu();
108
109     void updateActiveConfiguration();
110
111 private:
112     void cloneConfiguration(BuildConfiguration *toClone);
113     void deleteConfiguration(BuildConfiguration *toDelete);
114     QString uniqueName(const QString & name);
115
116     Target *m_target;
117     BuildConfiguration *m_buildConfiguration;
118
119     QPushButton *m_addButton;
120     QPushButton *m_removeButton;
121     QPushButton *m_renameButton;
122     QPushButton *m_makeActiveButton;
123     QComboBox *m_buildConfigurationComboBox;
124     QMenu *m_addButtonMenu;
125
126     QList<BuildConfigWidget *> m_subWidgets;
127     QList<QLabel *> m_labels;
128 };
129
130 } // namespace Internal
131 } // namespace ProjectExplorer
132
133 #endif // BUILDSETTINGSPROPERTIESPAGE_H