OSDN Git Service

It's 2011 now.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / projectexplorer / taskwindow.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
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
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
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.
24 **
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.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef TASKWINDOW_H
35 #define TASKWINDOW_H
36
37 #include <coreplugin/ioutputpane.h>
38
39 QT_BEGIN_NAMESPACE
40 class QAction;
41 class QModelIndex;
42 class QPoint;
43 QT_END_NAMESPACE
44
45 namespace ProjectExplorer {
46 class TaskHub;
47 class Task;
48
49 namespace Internal {
50 class TaskWindowPrivate;
51
52 // Show build issues (warnings or errors) and open the editor on click.
53 class TaskWindow : public Core::IOutputPane
54 {
55     Q_OBJECT
56
57 public:
58     TaskWindow(ProjectExplorer::TaskHub *taskHub);
59     virtual ~TaskWindow();
60
61     int taskCount() const;
62     int errorTaskCount() const;
63
64     // IOutputPane
65     QWidget *outputWidget(QWidget *);
66     QList<QWidget*> toolBarWidgets() const;
67
68     QString displayName() const { return tr("Build Issues"); }
69     int priorityInStatusBar() const;
70     void clearContents();
71     void visibilityChanged(bool visible);
72
73     bool canFocus();
74     bool hasFocus();
75     void setFocus();
76
77     bool canNavigate();
78     bool canNext();
79     bool canPrevious();
80     void goToNext();
81     void goToPrev();
82
83 signals:
84     void tasksChanged();
85     void tasksCleared();
86
87 private slots:
88     void addCategory(const QString &categoryId, const QString &displayName);
89     void addTask(const ProjectExplorer::Task &task);
90     void removeTask(const ProjectExplorer::Task &task);
91     void clearTasks(const QString &categoryId);
92
93     void triggerDefaultHandler(const QModelIndex &index);
94     void showContextMenu(const QPoint &position);
95     void contextMenuEntryTriggered(QAction *);
96     void setShowWarnings(bool);
97     void updateCategoriesMenu();
98     void filterCategoryTriggered(QAction *action);
99
100 private:
101     void cleanContextMenu();
102     int sizeHintForColumn(int column) const;
103
104     TaskWindowPrivate *d;
105 };
106
107 } // namespace Internal
108 } // namespace ProjectExplorer
109
110 #endif // TASKWINDOW_H