OSDN Git Service

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