2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2008-12-02 14:09:21 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include "core_global.h"
|
2023-05-23 06:56:21 +02:00
|
|
|
#include "icontext.h"
|
2019-05-14 13:55:14 +02:00
|
|
|
|
|
|
|
|
#include <utils/fancylineedit.h>
|
2020-06-26 13:59:38 +02:00
|
|
|
#include <utils/id.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace Core {
|
2019-06-20 17:27:10 +02:00
|
|
|
class IContext;
|
2021-11-25 12:31:14 +01:00
|
|
|
class OutputWindow;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
class CORE_EXPORT IOutputPane : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-09-27 13:47:06 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2017-12-08 17:20:48 +01:00
|
|
|
IOutputPane(QObject *parent = nullptr);
|
2018-05-07 15:00:03 +02:00
|
|
|
~IOutputPane() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
virtual QWidget *outputWidget(QWidget *parent) = 0;
|
2019-03-31 08:04:43 +02:00
|
|
|
virtual QList<QWidget *> toolBarWidgets() const;
|
2023-09-13 15:36:07 +02:00
|
|
|
Utils::Id id() const;
|
2023-09-13 11:46:00 +02:00
|
|
|
QString displayName() const;
|
2021-11-25 12:31:14 +01:00
|
|
|
virtual const QList<OutputWindow *> outputWindows() const { return {}; }
|
2021-11-25 13:57:38 +01:00
|
|
|
virtual void ensureWindowVisible(OutputWindow *) { }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2023-09-14 09:40:56 +02:00
|
|
|
int priorityInStatusBar() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
virtual void clearContents() = 0;
|
2020-10-08 17:55:43 +03:00
|
|
|
virtual void visibilityChanged(bool visible);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
virtual void setFocus() = 0;
|
2011-09-27 13:47:06 +02:00
|
|
|
virtual bool hasFocus() const = 0;
|
|
|
|
|
virtual bool canFocus() const = 0;
|
2009-04-30 12:50:52 +02:00
|
|
|
|
2011-09-27 13:47:06 +02:00
|
|
|
virtual bool canNavigate() const = 0;
|
|
|
|
|
virtual bool canNext() const = 0;
|
|
|
|
|
virtual bool canPrevious() const = 0;
|
2009-04-30 12:50:52 +02:00
|
|
|
virtual void goToNext() = 0;
|
|
|
|
|
virtual void goToPrev() = 0;
|
2011-09-27 13:47:06 +02:00
|
|
|
|
2019-03-31 08:04:43 +02:00
|
|
|
void setFont(const QFont &font);
|
|
|
|
|
void setWheelZoomEnabled(bool enabled);
|
|
|
|
|
|
2012-09-13 15:50:06 +02:00
|
|
|
enum Flag { NoModeSwitch = 0, ModeSwitch = 1, WithFocus = 2, EnsureSizeHint = 4};
|
|
|
|
|
Q_DECLARE_FLAGS(Flags, Flag)
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public slots:
|
2012-09-13 15:50:06 +02:00
|
|
|
void popup(int flags) { emit showPage(flags); }
|
|
|
|
|
|
2011-09-27 13:47:06 +02:00
|
|
|
void hide() { emit hidePage(); }
|
2012-09-13 15:50:06 +02:00
|
|
|
void toggle(int flags) { emit togglePage(flags); }
|
2011-09-27 13:47:06 +02:00
|
|
|
void navigateStateChanged() { emit navigateStateUpdate(); }
|
2012-06-11 10:32:16 +02:00
|
|
|
void flash() { emit flashButton(); }
|
2012-06-14 16:33:10 +02:00
|
|
|
void setIconBadgeNumber(int number) { emit setBadgeNumber(number); }
|
2009-04-30 12:50:52 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
signals:
|
2012-09-13 15:50:06 +02:00
|
|
|
void showPage(int flags);
|
2008-12-02 12:01:29 +01:00
|
|
|
void hidePage();
|
2012-09-13 15:50:06 +02:00
|
|
|
void togglePage(int flags);
|
2009-04-30 12:50:52 +02:00
|
|
|
void navigateStateUpdate();
|
2012-06-11 10:32:16 +02:00
|
|
|
void flashButton();
|
2012-06-14 16:33:10 +02:00
|
|
|
void setBadgeNumber(int number);
|
2020-11-17 15:50:11 +01:00
|
|
|
void zoomInRequested(int range);
|
|
|
|
|
void zoomOutRequested(int range);
|
|
|
|
|
void resetZoomRequested();
|
2019-03-31 08:04:43 +02:00
|
|
|
void wheelZoomEnabledChanged(bool enabled);
|
|
|
|
|
void fontChanged(const QFont &font);
|
|
|
|
|
|
|
|
|
|
protected:
|
2023-09-13 15:36:07 +02:00
|
|
|
void setId(const Utils::Id &id);
|
2023-09-13 11:46:00 +02:00
|
|
|
void setDisplayName(const QString &name);
|
2023-09-14 09:40:56 +02:00
|
|
|
void setPriorityInStatusBar(int priority);
|
2023-09-13 11:46:00 +02:00
|
|
|
|
2023-08-23 17:51:05 +02:00
|
|
|
void setupFilterUi(const Utils::Key &historyKey);
|
2019-05-14 13:55:14 +02:00
|
|
|
QString filterText() const;
|
2019-05-15 13:56:03 +02:00
|
|
|
bool filterUsesRegexp() const { return m_filterRegexp; }
|
2019-11-18 13:56:59 +01:00
|
|
|
bool filterIsInverted() const { return m_invertFilter; }
|
2019-05-15 13:56:03 +02:00
|
|
|
Qt::CaseSensitivity filterCaseSensitivity() const { return m_filterCaseSensitivity; }
|
2019-05-14 13:55:14 +02:00
|
|
|
void setFilteringEnabled(bool enable);
|
2019-04-09 15:03:54 +02:00
|
|
|
QWidget *filterWidget() const { return m_filterOutputLineEdit; }
|
2019-06-20 17:27:10 +02:00
|
|
|
void setupContext(const char *context, QWidget *widget);
|
2023-05-23 06:56:21 +02:00
|
|
|
void setupContext(const Context &context, QWidget *widget);
|
2019-03-31 08:04:43 +02:00
|
|
|
void setZoomButtonsEnabled(bool enabled);
|
|
|
|
|
|
2023-06-06 09:37:13 +02:00
|
|
|
IContext *m_context = nullptr;
|
|
|
|
|
|
2019-03-31 08:04:43 +02:00
|
|
|
private:
|
2019-05-14 13:55:14 +02:00
|
|
|
virtual void updateFilter();
|
|
|
|
|
|
|
|
|
|
void filterOutputButtonClicked();
|
|
|
|
|
void setCaseSensitive(bool caseSensitive);
|
|
|
|
|
void setRegularExpressions(bool regularExpressions);
|
2020-06-26 13:59:38 +02:00
|
|
|
Utils::Id filterRegexpActionId() const;
|
|
|
|
|
Utils::Id filterCaseSensitivityActionId() const;
|
|
|
|
|
Utils::Id filterInvertedActionId() const;
|
2019-05-14 13:55:14 +02:00
|
|
|
|
2023-09-13 15:36:07 +02:00
|
|
|
Utils::Id m_id;
|
2023-09-13 11:46:00 +02:00
|
|
|
QString m_displayName;
|
2023-09-14 09:40:56 +02:00
|
|
|
int m_priority = -1;
|
2024-01-25 08:59:18 +01:00
|
|
|
QToolButton *m_zoomInButton;
|
|
|
|
|
QToolButton *m_zoomOutButton;
|
2019-05-14 13:55:14 +02:00
|
|
|
Utils::FancyLineEdit *m_filterOutputLineEdit = nullptr;
|
|
|
|
|
bool m_filterRegexp = false;
|
2019-11-18 13:56:59 +01:00
|
|
|
bool m_invertFilter = false;
|
2019-05-15 13:56:03 +02:00
|
|
|
Qt::CaseSensitivity m_filterCaseSensitivity = Qt::CaseInsensitive;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Core
|
|
|
|
|
|
2012-09-13 15:50:06 +02:00
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IOutputPane::Flags)
|