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 **************************************************************************/
33 #ifndef MINIPROJECTTARGETSELECTOR_H
34 #define MINIPROJECTTARGETSELECTOR_H
36 #include <QtGui/QListWidget>
45 namespace ProjectExplorer {
48 class RunConfiguration;
50 class BuildConfiguration;
56 class ProjectListWidget : public QListWidget
60 ProjectExplorer::Project* m_project;
63 explicit ProjectListWidget(ProjectExplorer::Project *project, QWidget *parent = 0);
65 QSize sizeHint() const;
67 void setBuildComboPopup();
68 void setRunComboPopup();
70 ProjectExplorer::Project *project() const;
73 void setTarget(int index);
76 class MiniTargetWidget : public QWidget
80 explicit MiniTargetWidget(ProjectExplorer::Target *target, QWidget *parent = 0);
81 ProjectExplorer::Target *target() const;
83 bool hasBuildConfiguration() const;
86 void addRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
87 void removeRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
88 void addBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig);
89 void removeBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig);
91 void setActiveBuildConfiguration(int index);
92 void setActiveRunConfiguration(int index);
93 void setActiveBuildConfiguration();
94 void setActiveRunConfiguration();
102 QLabel *m_targetName;
103 QLabel *m_targetIcon;
104 QComboBox *m_runComboBox;
105 QComboBox *m_buildComboBox;
106 ProjectExplorer::Target *m_target;
109 QComboBox *runSettingsComboBox() const { return m_runComboBox; }
110 QComboBox *buildSettingsComboBox() const { return m_buildComboBox; }
115 class MiniProjectTargetSelector : public QWidget
119 explicit MiniProjectTargetSelector(QAction *projectAction, QWidget *parent = 0);
120 void setVisible(bool visible);
123 void startupProjectChanged(ProjectExplorer::Project *project);
126 void addProject(ProjectExplorer::Project *project);
127 void removeProject(ProjectExplorer::Project *project);
128 void addTarget(ProjectExplorer::Target *target, bool isActiveTarget = false);
129 void removeTarget(ProjectExplorer::Target *target);
130 void changeActiveTarget(ProjectExplorer::Target *target);
131 void emitStartupProjectChanged(int index);
132 void changeStartupProject(ProjectExplorer::Project *project);
134 void paintEvent(QPaintEvent *);
135 void mousePressEvent(QMouseEvent *);
138 int indexFor(ProjectExplorer::Project *project) const;
140 QAction *m_projectAction;
141 QComboBox *m_projectsBox;
142 QStackedWidget *m_widgetStack;
143 bool m_ignoreIndexChange;
146 } // namespace Internal
147 } // namespace ProjectExplorer
149 #endif // MINIPROJECTTARGETSELECTOR_H