1/*
2 krichtextedit
3 SPDX-FileCopyrightText: 2007 Laurent Montel <montel@kde.org>
4 SPDX-FileCopyrightText: 2008 Thomas McGuire <thomas.mcguire@gmx.net>
5 SPDX-FileCopyrightText: 2008 Stephen Kelly <steveire@gmail.com>
6
7 SPDX-License-Identifier: LGPL-2.1-or-later
8*/
9
10#ifndef KRICHTEXTEDIT_P_H
11#define KRICHTEXTEDIT_P_H
12
13#include "ktextedit_p.h"
14#include "nestedlisthelper_p.h"
15
16class KRichTextEditPrivate : public KTextEditPrivate
17{
18 Q_DECLARE_PUBLIC(KRichTextEdit)
19
20public:
21 explicit KRichTextEditPrivate(KRichTextEdit *qq)
22 : KTextEditPrivate(qq)
23 , nestedListHelper(new NestedListHelper(qq))
24 {
25 }
26
27 ~KRichTextEditPrivate() override
28 {
29 delete nestedListHelper;
30 }
31
32 //
33 // Normal functions
34 //
35
36 // If the text under the cursor is a link, the cursor's selection is set to
37 // the complete link text. Otherwise selects the current word if there is no
38 // selection.
39 void selectLinkText() const;
40
41 void init();
42
43 // Switches to rich text mode and emits the mode changed signal if the
44 // mode really changed.
45 void activateRichText();
46
47 // Applies formatting to the current word if there is no selection.
48 void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
49
50 void setTextCursor(QTextCursor &cursor);
51
52 // Data members
53 KRichTextEdit::Mode mMode = KRichTextEdit::Plain;
54
55 NestedListHelper *nestedListHelper;
56};
57
58#endif
59

source code of ktextwidgets/src/widgets/krichtextedit_p.h