compileoutputwindow.h 3.04 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
23
24
25
** 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.
**
** 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 COMPILEOUTPUTWINDOW_H
#define COMPILEOUTPUTWINDOW_H

33
#include "buildstep.h"
con's avatar
con committed
34
#include <coreplugin/ioutputpane.h>
Tobias Hunger's avatar
Tobias Hunger committed
35

36
#include <QHash>
Tobias Hunger's avatar
Tobias Hunger committed
37

38
39
QT_BEGIN_NAMESPACE
class QPlainTextEdit;
40
class QTextCharFormat;
41
class QToolButton;
42
QT_END_NAMESPACE
con's avatar
con committed
43

44
45
namespace Utils { class AnsiEscapeCodeHandler; }

con's avatar
con committed
46
47
48
namespace ProjectExplorer {

class BuildManager;
Tobias Hunger's avatar
Tobias Hunger committed
49
class Task;
con's avatar
con committed
50
51
52

namespace Internal {

Tobias Hunger's avatar
Tobias Hunger committed
53
class ShowOutputTaskHandler;
54
class CompileOutputTextEdit;
Tobias Hunger's avatar
Tobias Hunger committed
55

con's avatar
con committed
56
57
58
59
60
class CompileOutputWindow : public Core::IOutputPane
{
    Q_OBJECT

public:
61
    CompileOutputWindow(QAction *cancelBuildAction);
Tobias Hunger's avatar
Tobias Hunger committed
62
63
    ~CompileOutputWindow();

con's avatar
con committed
64
    QWidget *outputWidget(QWidget *);
65
    QList<QWidget *> toolBarWidgets() const;
66
    QString displayName() const { return tr("Compile Output"); }
con's avatar
con committed
67
68
69
    int priorityInStatusBar() const;
    void clearContents();
    void visibilityChanged(bool visible);
70
    void appendText(const QString &text, ProjectExplorer::BuildStep::OutputFormat format);
71
72
    bool canFocus() const;
    bool hasFocus() const;
con's avatar
con committed
73
74
    void setFocus();

75
76
    bool canNext() const;
    bool canPrevious() const;
77
78
    void goToNext();
    void goToPrev();
79
    bool canNavigate() const;
80

Tobias Hunger's avatar
Tobias Hunger committed
81
82
83
84
    void registerPositionOf(const Task &task);
    bool knowsPositionOf(const Task &task);
    void showPositionOf(const Task &task);

85
86
    void flush();

87
88
89
private slots:
    void updateWordWrapMode();

con's avatar
con committed
90
private:
91
    CompileOutputTextEdit *m_outputWindow;
Tobias Hunger's avatar
Tobias Hunger committed
92
93
    QHash<unsigned int, int> m_taskPositions;
    ShowOutputTaskHandler * m_handler;
94
    QToolButton *m_cancelBuildButton;
95
    Utils::AnsiEscapeCodeHandler *m_escapeCodeHandler;
con's avatar
con committed
96
97
98
99
100
101
};

} // namespace Internal
} // namespace ProjectExplorer

#endif // COMPILEOUTPUTWINDOW_H