digiKam
Loading...
Searching...
No Matches
dtextedit_p.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2022-08-01
7 * Description : Text edit widgets with spellcheck support and edition limitations.
8 *
9 * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17#include "dtextedit.h"
18#include "digikam_config.h"
19
20// Qt includes
21
22#include <QMargins>
23#include <QColor>
24#include <QTextDocument>
25#include <QFontMetrics>
26#include <QFontDatabase>
27#include <QMimeData>
28#include <QLabel>
29#include <QIcon>
30#include <QStyle>
31#include <QPainter>
32#include <QApplication>
33#include <QScrollBar>
34#include <QUrl>
35#include <QToolTip>
36#include <QEvent>
37
38// KDE includes
39
40#ifdef HAVE_SONNET
41
42# if defined(Q_CC_CLANG)
43# pragma clang diagnostic push
44# pragma clang diagnostic ignored "-Wnonportable-include-path"
45# endif
46
47
48# include <sonnet/spellcheckdecorator.h>
49# include <sonnet/highlighter.h>
50
51using namespace Sonnet;
52
53# if defined(Q_CC_CLANG)
54# pragma clang diagnostic pop
55# endif
56
57#endif
58
59#include <klocalizedstring.h>
60
61// Local includes
62
63#include "digikam_debug.h"
64#include "localizesettings.h"
65#include "localizecontainer.h"
66
67namespace Digikam
68{
69
70class Q_DECL_HIDDEN DTextEditClearButton : public QLabel
71{
72 Q_OBJECT
73
74public:
75
76 explicit DTextEditClearButton(QWidget* const parent);
77
78Q_SIGNALS:
79
80 void clicked();
81
82protected:
83
84 void mousePressEvent(QMouseEvent* e) override;
85};
86
87// -------------------------------------------------------------------------------
88
89class Q_DECL_HIDDEN DTextEdit::Private
90{
91public:
92
93 Private() = default;
94
98 void init(DTextEdit* const parent);
99
100public:
101
102#ifdef HAVE_SONNET
103
104 Sonnet::SpellCheckDecorator* spellChecker = nullptr;
105
106#endif
107
108 QString ignoredMask;
109 QString acceptedMask;
110
111 unsigned int lines = 3;
112
113 DTextEditClearButton* clrBtn = nullptr;
114
116
117 int maxLength = 0;
118
119 bool clearBtnEnable = true;
120};
121
122// ------------------------------------------------------------------------------------------------
123
124class Q_DECL_HIDDEN DPlainTextEdit::Private
125{
126public:
127
128 Private() = default;
129
133 void init(DPlainTextEdit* const parent);
134
135public:
136
137#ifdef HAVE_SONNET
138
139 Sonnet::SpellCheckDecorator* spellChecker = nullptr;
140
141#endif
142
143 QString ignoredMask;
144 QString acceptedMask;
145
146 unsigned int lines = 3;
147
148 DTextEditClearButton* clrBtn = nullptr;
149
151
152 int maxLength = 0;
153
154 bool clearBtnEnable = true;
155};
156
157} // namespace Digikam
Definition dtextedit_p.h:125
QString ignoredMask
Mask of ignored characters in text editor.
Definition dtextedit_p.h:143
LocalizeContainer container
Spell checking settings container.
Definition dtextedit_p.h:150
QString acceptedMask
Mask of accepted characters in text editor.
Definition dtextedit_p.h:144
Definition dtextedit.h:178
Definition dtextedit_p.h:71
Definition dtextedit_p.h:90
QString acceptedMask
Mask of accepted characters in text editor.
Definition dtextedit_p.h:109
LocalizeContainer container
Spell checking settings container.
Definition dtextedit_p.h:115
QString ignoredMask
Mask of ignored characters in text editor.
Definition dtextedit_p.h:108
Definition dtextedit.h:41
Definition localizecontainer.h:36
Definition datefolderview.cpp:34