KTextAddons

importabstractautocorrection.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 <QHash>
10#include <QSet>
11#include <QString>
12
13#include "autocorrectionutils.h"
14
15#include "textautocorrectioncore_export.h"
16namespace TextAutoCorrectionCore
17{
18class TEXTAUTOCORRECTIONCORE_EXPORT ImportAbstractAutocorrection
19{
20 Q_GADGET
21public:
22 enum LoadAttribute {
23 All = 0,
24 SuperScript,
25 };
26 Q_ENUM(LoadAttribute)
27
28 ImportAbstractAutocorrection();
29 virtual ~ImportAbstractAutocorrection();
30
31 virtual bool import(const QString &fileName, QString &errorMessage, ImportAbstractAutocorrection::LoadAttribute loadAttribute = All) = 0;
32
33 [[nodiscard]] QSet<QString> upperCaseExceptions() const;
34 [[nodiscard]] QSet<QString> twoUpperLetterExceptions() const;
35 [[nodiscard]] QHash<QString, QString> autocorrectEntries() const;
36 [[nodiscard]] QHash<QString, QString> superScriptEntries() const;
37
38 [[nodiscard]] AutoCorrectionUtils::TypographicQuotes typographicSingleQuotes() const;
39 [[nodiscard]] AutoCorrectionUtils::TypographicQuotes typographicDoubleQuotes() const;
40
41 [[nodiscard]] int maxFindStringLenght() const;
42
43 [[nodiscard]] int minFindStringLenght() const;
44
45protected:
46 int mMaxFindStringLength = 0;
47 int mMinFindStringLength = 0;
48 QSet<QString> mUpperCaseExceptions;
49 QSet<QString> mTwoUpperLetterExceptions;
50 QHash<QString, QString> mAutocorrectEntries;
51 QHash<QString, QString> mSuperScriptEntries;
52 AutoCorrectionUtils::TypographicQuotes mTypographicSingleQuotes;
53 AutoCorrectionUtils::TypographicQuotes mTypographicDoubleQuotes;
54};
55}
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:49:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.