OSDN Git Service

It's 2011 now.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / projectexplorer / buildstepspage.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 (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights.  These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef BUILDSTEPSPAGE_H
35 #define BUILDSTEPSPAGE_H
36
37 #include "buildstep.h"
38 #include "deployconfiguration.h"
39 #include "namedwidget.h"
40
41 QT_BEGIN_NAMESPACE
42 class QPushButton;
43 class QToolButton;
44 class QLabel;
45 class QVBoxLayout;
46 class QSignalMapper;
47 QT_END_NAMESPACE
48
49 namespace Utils {
50 class DetailsWidget;
51 }
52
53 namespace ProjectExplorer {
54
55 class Target;
56 class BuildConfiguration;
57
58 namespace Internal {
59
60 struct BuildStepsWidgetStruct
61 {
62     BuildStepConfigWidget *widget;
63     Utils::DetailsWidget *detailsWidget;
64     QToolButton *upButton;
65     QToolButton *downButton;
66     QToolButton *removeButton;
67 };
68
69 class BuildStepListWidget : public NamedWidget
70 {
71     Q_OBJECT
72
73 public:
74     BuildStepListWidget(QWidget *parent = 0);
75     virtual ~BuildStepListWidget();
76
77     void init(BuildStepList *bsl);
78
79 private slots:
80     void updateAddBuildStepMenu();
81     void addBuildStep();
82     void updateSummary();
83     void stepMoveUp(int pos);
84     void stepMoveDown(int pos);
85     void stepRemove(int pos);
86
87 private:
88     void setupUi();
89     void updateBuildStepButtonsState();
90     void addBuildStepWidget(int pos, BuildStep *step);
91
92     BuildStepList *m_buildStepList;
93     QHash<QAction *, QPair<QString, ProjectExplorer::IBuildStepFactory *> > m_addBuildStepHash;
94
95     QList<Internal::BuildStepsWidgetStruct> m_buildSteps;
96
97     QVBoxLayout *m_vbox;
98
99     QLabel *m_noStepsLabel;
100     QPushButton *m_addButton;
101
102     QSignalMapper *m_upMapper;
103     QSignalMapper *m_downMapper;
104     QSignalMapper *m_removeMapper;
105
106     int m_leftMargin;
107 };
108
109 namespace Ui {
110     class BuildStepsPage;
111 }
112
113 class BuildStepsPage : public BuildConfigWidget
114 {
115     Q_OBJECT
116
117 public:
118     BuildStepsPage(Target *target, const QString &id);
119     virtual ~BuildStepsPage();
120
121     QString displayName() const;
122     void init(BuildConfiguration *bc);
123
124 private:
125     QString m_id;
126     BuildStepListWidget *m_widget;
127 };
128
129 } // Internal
130 } // ProjectExplorer
131
132 #endif // BUILDSTEPSPAGE_H