KTextAddons

languagetoolgetlistoflanguagejob.h
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textgrammarcheck_export.h"
10#include <QNetworkRequest>
11#include <QObject>
13class QNetworkReply;
14namespace TextGrammarCheck
15{
16class TEXTGRAMMARCHECK_EXPORT LanguageToolGetListOfLanguageJob : public QObject
17{
18 Q_OBJECT
19public:
20 explicit LanguageToolGetListOfLanguageJob(QObject *parent = nullptr);
21 ~LanguageToolGetListOfLanguageJob() override;
22
23 [[nodiscard]] bool canStart() const;
24 void start();
25
26 [[nodiscard]] QString listOfLanguagePath() const;
27 void setListOfLanguagePath(const QString &listOfLanguagePath);
28
29 QNetworkAccessManager *networkAccessManager() const;
30 void setNetworkAccessManager(QNetworkAccessManager *networkAccessManager);
31
32 [[nodiscard]] QString url() const;
33 void setUrl(const QString &url);
34
35Q_SIGNALS:
36 void finished(const QString &result);
37 void error(const QString &errorStr);
38
39private:
40 Q_DISABLE_COPY(LanguageToolGetListOfLanguageJob)
41 TEXTGRAMMARCHECK_NO_EXPORT void addRequestAttribute(QNetworkRequest &request) const;
42 TEXTGRAMMARCHECK_NO_EXPORT void slotCheckListOfLanguagesFinished();
43 TEXTGRAMMARCHECK_NO_EXPORT void slotFinish(QNetworkReply *reply);
44
45 QString mListOfLanguagePath;
46 QNetworkAccessManager *mNetworkAccessManager = nullptr;
47 QString mUrl;
48};
49}
Q_SCRIPTABLE Q_NOREPLY void start()
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.