File indexing completed on 2024-12-15 04:51:47
0001 /* 0002 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <TextCustomEditor/RichTextEditor> 0010 namespace TextAutoCorrectionCore 0011 { 0012 class AutoCorrection; 0013 } 0014 0015 namespace NoteShared 0016 { 0017 class RichTextEditWithAutoCorrectionPrivate; 0018 /** 0019 * @brief The RichTextEditWithAutoCorrection class 0020 * @author Laurent Montel <montel@kde.org> 0021 */ 0022 class RichTextEditWithAutoCorrection : public TextCustomEditor::RichTextEditor 0023 { 0024 Q_OBJECT 0025 public: 0026 explicit RichTextEditWithAutoCorrection(QWidget *parent = nullptr); 0027 ~RichTextEditWithAutoCorrection() override; 0028 0029 [[nodiscard]] TextAutoCorrectionCore::AutoCorrection *autocorrection() const; 0030 void setAutocorrection(TextAutoCorrectionCore::AutoCorrection *autocorrect); 0031 0032 void setAutocorrectionLanguage(const QString &language); 0033 0034 protected: 0035 void keyPressEvent(QKeyEvent *e) override; 0036 0037 private: 0038 std::unique_ptr<RichTextEditWithAutoCorrectionPrivate> const d; 0039 }; 0040 }