File indexing completed on 2024-12-22 05:05:31

0001 /*
0002    SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QWidget>
0010 namespace PimCommon
0011 {
0012 class CustomLogWidget;
0013 }
0014 
0015 class LogWidget : public QWidget
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit LogWidget(QWidget *parent);
0020     ~LogWidget() override;
0021 
0022     void addInfoLogEntry(const QString &log);
0023     void addErrorLogEntry(const QString &log);
0024     void addTitleLogEntry(const QString &log);
0025     void addEndLineLogEntry();
0026     void clear();
0027     [[nodiscard]] QString toHtml() const;
0028     [[nodiscard]] QString toPlainText() const;
0029     [[nodiscard]] bool isEmpty() const;
0030 
0031 private:
0032     PimCommon::CustomLogWidget *const mCustomLogWidget;
0033 };