projectwindow.h 3.15 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
con's avatar
con committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
con's avatar
con committed
7
**
hjk's avatar
hjk committed
8
9
10
11
12
13
14
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
15
**
16
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17
18
19
20
21
22
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23
**
hjk's avatar
hjk committed
24
25
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
con's avatar
con committed
26
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
hjk's avatar
hjk committed
29

con's avatar
con committed
30
31
32
#ifndef PROJECTWINDOW_H
#define PROJECTWINDOW_H

33
34
#include "projectexplorer_export.h"

35
36
#include <QMap>
#include <QScrollArea>
con's avatar
con committed
37
38

QT_BEGIN_NAMESPACE
dt's avatar
dt committed
39
class QLabel;
Tobias Hunger's avatar
Tobias Hunger committed
40
class QGridLayout;
41
class QMenu;
42
class QStackedWidget;
con's avatar
con committed
43
44
45
46
QT_END_NAMESPACE

namespace ProjectExplorer {

47
class PropertiesPanel;
con's avatar
con committed
48
class Project;
Tobias Hunger's avatar
Tobias Hunger committed
49
class Target;
dt's avatar
dt committed
50
class BuildConfiguration;
51
class RunConfiguration;
con's avatar
con committed
52

53
class PROJECTEXPLORER_EXPORT PanelsWidget : public QScrollArea
dt's avatar
dt committed
54
55
56
{
    Q_OBJECT
public:
Tobias Hunger's avatar
Tobias Hunger committed
57
    explicit PanelsWidget(QWidget *parent);
dt's avatar
dt committed
58
59
    ~PanelsWidget();
    // Adds a widget
60
    void addPropertiesPanel(PropertiesPanel *panel);
dt's avatar
dt committed
61

62
private:
63
    void addPanelWidget(PropertiesPanel *panel, int row);
Tobias Hunger's avatar
Tobias Hunger committed
64

65
    QList<PropertiesPanel *> m_panels;
Tobias Hunger's avatar
Tobias Hunger committed
66
67
    QGridLayout *m_layout;
    QWidget *m_root;
dt's avatar
dt committed
68
69
};

70
71
72
73
namespace Internal {

class DoubleTabWidget;

con's avatar
con committed
74
75
76
77
78
class ProjectWindow : public QWidget
{
    Q_OBJECT

public:
79
    explicit ProjectWindow(QWidget *parent = 0);
con's avatar
con committed
80
81
    ~ProjectWindow();

82
    void aboutToShutdown();
83
    void extensionsInitialized();
84
85

public slots:
86
    void projectUpdated(ProjectExplorer::Project *p);
87

con's avatar
con committed
88
private slots:
Tobias Hunger's avatar
Tobias Hunger committed
89
    void handleKitChanges();
con's avatar
con committed
90
    void showProperties(int index, int subIndex);
91
    void registerProject(ProjectExplorer::Project*);
jkobus's avatar
jkobus committed
92
    bool deregisterProject(ProjectExplorer::Project*);
93
    void startupProjectChanged(ProjectExplorer::Project *);
94
    void removedTarget(ProjectExplorer::Target*);
95

con's avatar
con committed
96
private:
97
    bool hasTarget(ProjectExplorer::Project *project);
Tobias Hunger's avatar
Tobias Hunger committed
98
99
    void removeCurrentWidget();

con's avatar
con committed
100
101
    DoubleTabWidget *m_tabWidget;
    QStackedWidget *m_centralWidget;
Tobias Hunger's avatar
Tobias Hunger committed
102
    QWidget *m_currentWidget;
con's avatar
con committed
103
    QList<ProjectExplorer::Project *> m_tabIndexToProject;
104
    QMap<ProjectExplorer::Project *, bool> m_hasTarget;
con's avatar
con committed
105
106
107
108
109
110
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // PROJECTWINDOW_H