File indexing completed on 2024-12-22 04:28:09
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 #include "textautocorrectioncore_export.h" 0009 #include <QChar> 0010 #include <QDebug> 0011 namespace TextAutoCorrectionCore 0012 { 0013 namespace AutoCorrectionUtils 0014 { 0015 struct TEXTAUTOCORRECTIONCORE_EXPORT TypographicQuotes { 0016 QChar begin; 0017 QChar end; 0018 [[nodiscard]] QString toString() const; 0019 [[nodiscard]] bool isEmpty() const; 0020 [[nodiscard]] static TypographicQuotes fromString(const QString &str); 0021 }; 0022 0023 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT TypographicQuotes typographicDefaultSingleQuotes(); 0024 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT TypographicQuotes typographicDefaultDoubleQuotes(); 0025 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT TypographicQuotes typographicDefaultFrenchQuotes(); 0026 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QString libreofficeFile(const QString &lang); 0027 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QStringList libreOfficeAutoCorrectionPath(); 0028 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QStringList searchAutoCorrectLibreOfficeFiles(); 0029 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QStringList autoCorrectLibreOfficeLanguageToString(const QStringList &langs); 0030 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QString libreOfficeWritableLocalAutoCorrectionPath(); 0031 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QString containsAutoCorrectionFile(const QString &lang, 0032 const QString &customSystemPath, 0033 const QString &customWritablePath); 0034 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QString libreOfficeSystemPath(); 0035 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QString libreOfficeLocalPath(); 0036 [[nodiscard]] TEXTAUTOCORRECTIONCORE_EXPORT QStringList wordsFromSentence(const QString &string); 0037 }; 0038 } 0039 TEXTAUTOCORRECTIONCORE_EXPORT QDebug operator<<(QDebug d, TextAutoCorrectionCore::AutoCorrectionUtils::TypographicQuotes t);