OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / projectexplorer / runsettingspropertiespage.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 RUNSETTINGSPROPERTIESPAGE_H
34 #define RUNSETTINGSPROPERTIESPAGE_H
35
36 #include "iprojectproperties.h"
37
38 #include <QtGui/QWidget>
39 #include <QtGui/QIcon>
40
41 QT_BEGIN_NAMESPACE
42 class QMenu;
43 class QLabel;
44 class QVBoxLayout;
45 QT_END_NAMESPACE
46
47 namespace ProjectExplorer {
48
49 class DeployConfiguration;
50 class DeployConfigurationWidget;
51 class DeployConfigurationModel;
52 class RunConfiguration;
53 class RunConfigurationModel;
54 class RunConfigWidget;
55
56 namespace Internal {
57
58 const char * const RUNSETTINGS_PANEL_ID = "ProjectExplorer.RunSettingsPanel";
59
60 namespace Ui {
61 class RunSettingsPropertiesPage;
62 }
63
64 class RunSettingsWidget;
65 class BuildStepListWidget;
66
67 class RunSettingsPanelFactory : public ITargetPanelFactory
68 {
69 public:
70     QString id() const;
71     QString displayName() const;
72     bool supports(Target *target);
73     IPropertiesPanel *createPanel(Target *target);
74 };
75
76 class RunSettingsPanel : public IPropertiesPanel
77 {
78 public:
79     RunSettingsPanel(Target *target);
80     ~RunSettingsPanel();
81
82     QString displayName() const;
83     QWidget *widget() const;
84     QIcon icon() const;
85
86 private:
87     RunSettingsWidget *m_widget;
88     QIcon m_icon;
89 };
90
91 class RunSettingsWidget : public QWidget
92 {
93     Q_OBJECT
94 public:
95     explicit RunSettingsWidget(Target *target);
96     ~RunSettingsWidget();
97
98 private slots:
99     void currentRunConfigurationChanged(int index);
100     void aboutToShowAddMenu();
101     void addRunConfiguration();
102     void removeRunConfiguration();
103     void activeRunConfigurationChanged();
104     void renameRunConfiguration();
105     void currentDeployConfigurationChanged(int index);
106     void aboutToShowDeployMenu();
107     void addDeployConfiguration();
108     void removeDeployConfiguration();
109     void activeDeployConfigurationChanged();
110     void renameDeployConfiguration();
111
112 private:
113     QString uniqueDCName(const QString &name);
114     QString uniqueRCName(const QString &name);
115     void updateDeployConfiguration(DeployConfiguration *);
116     void setConfigurationWidget(RunConfiguration *rc);
117
118     void addRunControlWidgets();
119     void addSubWidget(RunConfigWidget *subWidget);
120     void removeSubWidgets();
121
122     Target *m_target;
123     RunConfigurationModel *m_runConfigurationsModel;
124     DeployConfigurationModel *m_deployConfigurationModel;
125     Ui::RunSettingsPropertiesPage *m_ui;
126     QWidget *m_runConfigurationWidget;
127     QVBoxLayout *m_runLayout;
128     DeployConfigurationWidget *m_deployConfigurationWidget;
129     QVBoxLayout *m_deployLayout;
130     BuildStepListWidget *m_deploySteps;
131     QMenu *m_addRunMenu;
132     QMenu *m_addDeployMenu;
133     bool m_ignoreChange;
134     typedef QPair<RunConfigWidget *, QLabel *> RunConfigItem;
135     QList<RunConfigItem> m_subWidgets;
136 };
137
138 } // namespace Internal
139 } // namespace ProjectExplorer
140
141 #endif // RUNSETTINGSPROPERTIESPAGE_H