KTextAddons

richtextbrowserwidget.h
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textcustomeditor_export.h"
10
11#include <QWidget>
12
13namespace TextCustomEditor
14{
15class RichTextBrowser;
16class RichTextBrowserWidgetPrivate;
17/**
18 * @brief The RichTextBrowserWidget class
19 * @author Laurent Montel <montel@kde.org>
20 */
21class TEXTCUSTOMEDITOR_EXPORT RichTextBrowserWidget : public QWidget
22{
23 Q_OBJECT
24public:
25 explicit RichTextBrowserWidget(QWidget *parent = nullptr);
26 explicit RichTextBrowserWidget(RichTextBrowser *customEditor, QWidget *parent = nullptr);
27 ~RichTextBrowserWidget() override;
28
29 void clear();
30
31 [[nodiscard]] RichTextBrowser *editor() const;
32
33 void setHtml(const QString &html);
34 [[nodiscard]] QString toHtml() const;
35
36 void setPlainText(const QString &text);
37 [[nodiscard]] QString toPlainText() const;
38
39 void setAcceptRichText(bool b);
40 bool acceptRichText() const;
41
42 [[nodiscard]] bool isEmpty() const;
43public Q_SLOTS:
44 void slotFindNext();
45 void slotFind();
46
47private:
48 TEXTCUSTOMEDITOR_NO_EXPORT void slotHideFindBar();
49 TEXTCUSTOMEDITOR_NO_EXPORT void init(RichTextBrowser *customEditor = nullptr);
50 std::unique_ptr<RichTextBrowserWidgetPrivate> const d;
51};
52}
The RichTextBrowser class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:51:28 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.