1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
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
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 ** 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.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef MINIPROJECTTARGETSELECTOR_H
35 #define MINIPROJECTTARGETSELECTOR_H
37 #include <QtGui/QListWidget>
46 namespace ProjectExplorer {
49 class RunConfiguration;
51 class BuildConfiguration;
57 class ProjectListWidget : public QListWidget
61 ProjectExplorer::Project* m_project;
64 explicit ProjectListWidget(ProjectExplorer::Project *project, QWidget *parent = 0);
66 QSize sizeHint() const;
68 void setBuildComboPopup();
69 void setRunComboPopup();
71 ProjectExplorer::Project *project() const;
74 void setTarget(int index);
77 class MiniTargetWidget : public QWidget
81 explicit MiniTargetWidget(ProjectExplorer::Target *target, QWidget *parent = 0);
82 ProjectExplorer::Target *target() const;
84 bool hasBuildConfiguration() const;
87 void addRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
88 void removeRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
89 void addBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig);
90 void removeBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig);
92 void setActiveBuildConfiguration(int index);
93 void setActiveRunConfiguration(int index);
94 void setActiveBuildConfiguration();
95 void setActiveRunConfiguration();
103 QLabel *m_targetName;
104 QLabel *m_targetIcon;
105 QComboBox *m_runComboBox;
106 QComboBox *m_buildComboBox;
107 ProjectExplorer::Target *m_target;
110 QComboBox *runSettingsComboBox() const { return m_runComboBox; }
111 QComboBox *buildSettingsComboBox() const { return m_buildComboBox; }
116 class MiniProjectTargetSelector : public QWidget
120 explicit MiniProjectTargetSelector(QAction *projectAction, QWidget *parent = 0);
121 void setVisible(bool visible);
124 void startupProjectChanged(ProjectExplorer::Project *project);
127 void addProject(ProjectExplorer::Project *project);
128 void removeProject(ProjectExplorer::Project *project);
129 void addTarget(ProjectExplorer::Target *target, bool isActiveTarget = false);
130 void removeTarget(ProjectExplorer::Target *target);
131 void changeActiveTarget(ProjectExplorer::Target *target);
132 void emitStartupProjectChanged(int index);
133 void changeStartupProject(ProjectExplorer::Project *project);
135 void paintEvent(QPaintEvent *);
136 void mousePressEvent(QMouseEvent *);
139 int indexFor(ProjectExplorer::Project *project) const;
141 QAction *m_projectAction;
142 QComboBox *m_projectsBox;
143 QStackedWidget *m_widgetStack;
144 bool m_ignoreIndexChange;
147 } // namespace Internal
148 } // namespace ProjectExplorer
150 #endif // MINIPROJECTTARGETSELECTOR_H