1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
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.
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.
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.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
36 #include "ui_processstep.h"
37 #include "abstractprocessstep.h"
38 #include "environment.h"
40 namespace ProjectExplorer {
44 class ProcessStepFactory : public IBuildStepFactory
50 ~ProcessStepFactory();
52 virtual QStringList availableCreationIds(BuildStepList *parent) const;
53 virtual QString displayNameForId(const QString &id) const;
55 virtual bool canCreate(BuildStepList *parent, const QString &id) const;
56 virtual BuildStep *create(BuildStepList *parent, const QString &id);
57 virtual bool canRestore(BuildStepList *parent, const QVariantMap &map) const;
58 virtual BuildStep *restore(BuildStepList *parent, const QVariantMap &map);
59 virtual bool canClone(BuildStepList *parent, BuildStep *product) const;
60 virtual BuildStep *clone(BuildStepList *parent, BuildStep *product);
63 class ProcessStep : public ProjectExplorer::AbstractProcessStep
66 friend class ProcessStepFactory;
69 explicit ProcessStep(BuildStepList *bsl);
70 virtual ~ProcessStep();
73 virtual void run(QFutureInterface<bool> &);
75 virtual BuildStepConfigWidget *createConfigWidget();
76 virtual bool immutable() const;
78 QString command() const;
79 QString arguments() const;
81 QString workingDirectory() const;
83 void setCommand(const QString &command);
84 void setArguments(const QString &arguments);
85 void setEnabled(bool enabled);
86 void setWorkingDirectory(const QString &workingDirectory);
88 QVariantMap toMap() const;
91 ProcessStep(BuildStepList *bsl, ProcessStep *bs);
92 ProcessStep(BuildStepList *bsl, const QString &id);
94 bool fromMap(const QVariantMap &map);
101 QString m_workingDirectory;
102 Utils::Environment m_env;
106 class ProcessStepConfigWidget : public BuildStepConfigWidget
110 ProcessStepConfigWidget(ProcessStep *step);
111 virtual QString displayName() const;
113 virtual QString summaryText() const;
115 void commandLineEditTextEdited();
116 void workingDirectoryLineEditTextEdited();
117 void commandArgumentsLineEditTextEdited();
118 void enabledCheckBoxClicked(bool);
120 void updateDetails();
122 Ui::ProcessStepWidget m_ui;
123 QString m_summaryText;
126 } // namespace Internal
127 } // namespace ProjectExplorer
129 #endif // PROCESSSTEP_H