OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / makestep.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 MAKESTEP_H
34 #define MAKESTEP_H
35
36 #include <projectexplorer/abstractprocessstep.h>
37 #include <projectexplorer/buildstep.h>
38 #include <projectexplorer/task.h>
39
40 QT_BEGIN_NAMESPACE
41 namespace Ui {
42 class MakeStep;
43 }
44 QT_END_NAMESPACE
45
46 namespace ProjectExplorer {
47 class BuildStep;
48 class GnuMakeParser;
49 class IBuildStepFactory;
50 class Project;
51 }
52
53 namespace Qt4ProjectManager {
54 class Qt4BuildConfiguration;
55
56 namespace Internal {
57
58 class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
59 {
60     Q_OBJECT
61
62 public:
63     explicit MakeStepFactory(QObject *parent = 0);
64     virtual ~MakeStepFactory();
65
66     bool canCreate(ProjectExplorer::BuildStepList *parent, const QString &id) const;
67     ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const QString &id);
68     bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
69     ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
70     bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
71     ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
72
73     QStringList availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
74     QString displayNameForId(const QString &id) const;
75 };
76 } //namespace Internal
77
78 class Qt4Project;
79
80 class MakeStep : public ProjectExplorer::AbstractProcessStep
81 {
82     Q_OBJECT
83     friend class Internal::MakeStepFactory;
84     friend class MakeStepConfigWidget; // TODO remove this
85     // used to access internal stuff
86
87 public:
88     explicit MakeStep(ProjectExplorer::BuildStepList *bsl);
89     virtual ~MakeStep();
90
91     Qt4BuildConfiguration *qt4BuildConfiguration() const;
92
93     virtual bool init();
94     virtual void run(QFutureInterface<bool> &);
95     bool processSucceeded(int exitCode, QProcess::ExitStatus status);
96
97     virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
98     virtual bool immutable() const;
99     QString userArguments();
100     void setUserArguments(const QString &arguments);
101     void setClean(bool clean);
102     bool isClean() const;
103
104     QVariantMap toMap() const;
105
106 signals:
107     void userArgumentsChanged();
108
109 protected:
110     MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
111     MakeStep(ProjectExplorer::BuildStepList *bsl, const QString &id);
112     virtual bool fromMap(const QVariantMap &map);
113
114 private:
115     void ctor();
116     bool m_clean;
117     QString m_makeFileToCheck;
118     QString m_userArgs;
119     QString m_makeCmd;
120     QList<ProjectExplorer::Task> m_tasks;
121 };
122
123 class MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
124 {
125     Q_OBJECT
126 public:
127     explicit MakeStepConfigWidget(MakeStep *makeStep);
128     virtual ~MakeStepConfigWidget();
129
130     QString displayName() const;
131     void init();
132     QString summaryText() const;
133 private slots:
134     // User changes to our widgets
135     void makeEdited();
136     void makeArgumentsLineEdited();
137
138     void updateMakeOverrideLabel();
139     void updateDetails();
140     void userArgumentsChanged();
141     void qtVersionChanged();
142 private:
143     Ui::MakeStep *m_ui;
144     MakeStep *m_makeStep;
145     QString m_summaryText;
146     bool m_ignoreChange;
147 };
148
149 } // Qt4ProjectManager
150
151 #endif // MAKESTEP_H