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 info@qt.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 ProjectExplorer::Project *project() const;
70 void setTarget(int index);
73 class MiniTargetWidget : public QWidget
77 explicit 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 explicit 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 QString fullName(ProjectExplorer::Project *project);
136 int indexFor(ProjectExplorer::Project *project) const;
138 QAction *m_projectAction;
139 QComboBox *m_projectsBox;
140 QStackedWidget *m_widgetStack;
141 bool m_ignoreIndexChange;
144 } // namespace Internal
145 } // namespace ProjectExplorer
147 #endif // MINIPROJECTTARGETSELECTOR_H