KTextAddons

importlibreofficeautocorrection.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 "importabstractautocorrection.h"
10#include "textautocorrectioncore_export.h"
11class QTemporaryDir;
12class KZip;
13class QDomDocument;
14class QFile;
16
17namespace TextAutoCorrectionCore
18{
19class TEXTAUTOCORRECTIONCORE_EXPORT ImportLibreOfficeAutocorrection : public ImportAbstractAutocorrection
20{
21public:
22 ImportLibreOfficeAutocorrection();
23 ~ImportLibreOfficeAutocorrection() override;
24
25 [[nodiscard]] bool import(const QString &fileName, QString &errorMessage, ImportAbstractAutocorrection::LoadAttribute loadAttribute = All) override;
26
27private:
28 enum Type {
29 DOCUMENT,
30 SENTENCE,
31 WORD,
32 };
33
34 TEXTAUTOCORRECTIONCORE_NO_EXPORT void importAutoCorrectionFile();
35 TEXTAUTOCORRECTIONCORE_NO_EXPORT void closeArchive();
36 [[nodiscard]] TEXTAUTOCORRECTIONCORE_NO_EXPORT bool loadDomElement(QDomDocument &doc, QFile *file);
37 [[nodiscard]] TEXTAUTOCORRECTIONCORE_NO_EXPORT bool importFile(Type type, const KArchiveDirectory *archiveDirectory);
38 KZip *mArchive = nullptr;
39 QTemporaryDir *mTempDir = nullptr;
40};
41}
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 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.