KTextAddons

richtexteditorwidget.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.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 RichTextEditor;
16class RichTextEditorWidgetPrivate;
17/**
18 * @brief The RichTextEditorWidget class
19 * @author Laurent Montel <montel@kde.org>
20 */
21class TEXTCUSTOMEDITOR_EXPORT RichTextEditorWidget : public QWidget
22{
23 Q_OBJECT
24 Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
25public:
26 explicit RichTextEditorWidget(QWidget *parent = nullptr);
27 explicit RichTextEditorWidget(RichTextEditor *customEditor, QWidget *parent = nullptr);
28 ~RichTextEditorWidget() override;
29
30 void clear();
31
32 [[nodiscard]] RichTextEditor *editor() const;
33
34 void setReadOnly(bool readOnly);
35 bool isReadOnly() const;
36
37 void setHtml(const QString &html);
38 [[nodiscard]] QString toHtml() const;
39
40 void setPlainText(const QString &text);
41 [[nodiscard]] QString toPlainText() const;
42
43 void setAcceptRichText(bool b);
44 [[nodiscard]] bool acceptRichText() const;
45
46 void setSpellCheckingConfigFileName(const QString &_fileName);
47
48 [[nodiscard]] bool isEmpty() const;
49public Q_SLOTS:
50 void slotFindNext();
51 void slotFind();
52 void slotReplace();
53
54private:
55 TEXTCUSTOMEDITOR_NO_EXPORT void slotHideFindBar();
56 TEXTCUSTOMEDITOR_NO_EXPORT void init(RichTextEditor *customEditor = nullptr);
57 std::unique_ptr<RichTextEditorWidgetPrivate> const d;
58};
59}
The RichTextEditorWidget class.
The RichTextEditor class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.