1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
16 ** GNU Lesser General Public License Usage
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.
25 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
28 **************************************************************************/
30 #ifndef MINIPROJECTTARGETSELECTOR_H
31 #define MINIPROJECTTARGETSELECTOR_H
33 #include <QtGui/QListWidget>
42 namespace ProjectExplorer {
45 class RunConfiguration;
47 class BuildConfiguration;
53 class ProjectListWidget : public QListWidget
57 ProjectExplorer::Project* m_project;
60 ProjectListWidget(ProjectExplorer::Project *project, QWidget *parent = 0);
62 QSize sizeHint() const;
64 void setBuildComboPopup();
65 void setRunComboPopup();
67 ProjectExplorer::Project *project() const;
70 void setTarget(int index);
73 class MiniTargetWidget : public QWidget
77 MiniTargetWidget(ProjectExplorer::Target *target, QWidget *parent = 0);
78 ProjectExplorer::Target *target() const;
80 bool hasBuildConfiguration() const;
83 void addRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
84 void removeRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
85 void addBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig);
86 void removeBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig);
88 void setActiveBuildConfiguration(int index);
89 void setActiveRunConfiguration(int index);
90 void setActiveBuildConfiguration();
91 void setActiveRunConfiguration();
100 QLabel *m_targetIcon;
101 QComboBox *m_runComboBox;
102 QComboBox *m_buildComboBox;
103 ProjectExplorer::Target *m_target;
106 QComboBox *runSettingsComboBox() const { return m_runComboBox; }
107 QComboBox *buildSettingsComboBox() const { return m_buildComboBox; }
112 class MiniProjectTargetSelector : public QWidget
116 MiniProjectTargetSelector(QAction *projectAction, QWidget *parent = 0);
117 void setVisible(bool visible);
120 void startupProjectChanged(ProjectExplorer::Project *project);
123 void addProject(ProjectExplorer::Project *project);
124 void removeProject(ProjectExplorer::Project *project);
125 void addTarget(ProjectExplorer::Target *target, bool isActiveTarget = false);
126 void removeTarget(ProjectExplorer::Target *target);
127 void changeActiveTarget(ProjectExplorer::Target *target);
128 void emitStartupProjectChanged(int index);
129 void changeStartupProject(ProjectExplorer::Project *project);
131 void paintEvent(QPaintEvent *);
132 void mousePressEvent(QMouseEvent *);
135 int indexFor(ProjectExplorer::Project *project) const;
137 QAction *m_projectAction;
138 QComboBox *m_projectsBox;
139 QStackedWidget *m_widgetStack;
142 } // namespace Internal
143 } // namespace ProjectExplorer
145 #endif // MINIPROJECTTARGETSELECTOR_H