KTextAddons

autocorrectionwidget.h
1/*
2 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textautocorrectionwidgets_export.h"
10#include <QWidget>
11#include <TextAutoCorrectionCore/AutoCorrection>
12
13class QTreeWidgetItem;
14
15namespace Ui
16{
17class AutoCorrectionWidget;
18}
19
20namespace TextAutoCorrectionWidgets
21{
22class AutoCorrectionWidgetPrivate;
23/**
24 * @brief The AutoCorrectionWidget class
25 * @author Laurent Montel <montel@kde.org>
26 */
27class TEXTAUTOCORRECTIONWIDGETS_EXPORT AutoCorrectionWidget : public QWidget
28{
29 Q_OBJECT
30
31public:
32 enum ImportFileType {
33 LibreOffice,
34 KMail,
35 };
36
37 explicit AutoCorrectionWidget(QWidget *parent = nullptr);
38 ~AutoCorrectionWidget() override;
39 void setAutoCorrection(TextAutoCorrectionCore::AutoCorrection *autoCorrect);
40 void setHasHtmlSupport(bool b);
41 void loadConfig();
42 void writeConfig();
43 void resetToDefault();
44
45Q_SIGNALS:
46 void changed();
47
48private:
49 /* tab 2 */
50 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void enableSingleQuotes(bool state);
51 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void enableDoubleQuotes(bool state);
52 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void selectSingleQuoteCharOpen();
53 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void selectSingleQuoteCharClose();
54 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void setDefaultSingleQuotes();
55 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void selectDoubleQuoteCharOpen();
56 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void selectDoubleQuoteCharClose();
57 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void setDefaultDoubleQuotes();
58
59 /* tab 3 */
60 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void enableAdvAutocorrection(bool state);
61 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void addAutocorrectEntry();
62 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void removeAutocorrectEntry();
63 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void setFindReplaceText(QTreeWidgetItem *, int);
64 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void enableAddRemoveButton();
65
66 /* tab 4 */
67 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void abbreviationChanged(const QString &text);
68 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void twoUpperLetterChanged(const QString &text);
69 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void addAbbreviationEntry();
70 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void removeAbbreviationEntry();
71 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void addTwoUpperLetterEntry();
72 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void removeTwoUpperLetterEntry();
73
74 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void slotEnableDisableAbreviationList();
75 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void slotEnableDisableTwoUpperEntry();
76
77 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void slotImportAutoCorrection(QAction *act);
78
79 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void changeLanguage();
80 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void updateAddRemoveButton();
81
82 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void slotExportAutoCorrection();
83
84private:
85 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void slotChangeComboboxState(int index);
86 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void emitChanged();
87 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void addAutoCorrectEntries();
88 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void loadAutoCorrectionAndException();
89 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void loadGlobalAutoCorrectionAndException();
90 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void setLanguage(const QString &lang);
91 TEXTAUTOCORRECTIONWIDGETS_NO_EXPORT void updateHtmlSupport();
92
93 std::unique_ptr<AutoCorrectionWidgetPrivate> const d;
94};
95}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.