KTextAddons

plaintexteditorwidget.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#include <QWidget>
11
12namespace TextCustomEditor
13{
14class PlainTextEditor;
15class PlainTextEditorWidgetPrivate;
16/**
17 * @brief The PlainTextEditorWidget class
18 * @author Laurent Montel <montel@kde.org>
19 */
20class TEXTCUSTOMEDITOR_EXPORT PlainTextEditorWidget : public QWidget
21{
22 Q_OBJECT
23 Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
24public:
25 explicit PlainTextEditorWidget(QWidget *parent = nullptr);
26 explicit PlainTextEditorWidget(PlainTextEditor *customEditor, QWidget *parent = nullptr);
27 ~PlainTextEditorWidget() override;
28
29 [[nodiscard]] PlainTextEditor *editor() const;
30
31 void setReadOnly(bool readOnly);
32 [[nodiscard]] bool isReadOnly() const;
33
34 void setPlainText(const QString &text);
35 [[nodiscard]] QString toPlainText() const;
36
37 void clear();
38 void setSpellCheckingConfigFileName(const QString &_fileName);
39
40 [[nodiscard]] bool isEmpty() const;
41
42private:
43 TEXTCUSTOMEDITOR_NO_EXPORT void slotFind();
44 TEXTCUSTOMEDITOR_NO_EXPORT void slotReplace();
45
46 TEXTCUSTOMEDITOR_NO_EXPORT void slotHideFindBar();
47 TEXTCUSTOMEDITOR_NO_EXPORT void init(PlainTextEditor *customEditor = nullptr);
48 std::unique_ptr<PlainTextEditorWidgetPrivate> const d;
49};
50}
The PlainTextEditor 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.