Messagelib

inserttextfilejob.h
1/*
2 * SPDX-FileCopyrightText: 2010 Thomas McGuire <mcguire@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6#pragma once
7
8#include "messagecomposer_export.h"
9
10#include <KJob>
11#include <QUrl>
12
13class QTextEdit;
14
15namespace KIO
16{
17class Job;
18}
19
20namespace MessageComposer
21{
22class InsertTextFileJobPrivate;
23/**
24 * A job that downloads a given URL, interprets the result as a text file with the
25 * given encoding and then inserts the text into the editor.
26 */
27class MESSAGECOMPOSER_EXPORT InsertTextFileJob : public KJob
28{
29 Q_OBJECT
30
31public:
32 explicit InsertTextFileJob(QTextEdit *editor, const QUrl &url);
33 ~InsertTextFileJob() override;
34
35 void setEncoding(const QString &encoding);
36 void start() override;
37
38private:
39 void slotGetJobFinished(KJob *job);
40 void slotFileData(KIO::Job *job, const QByteArray &data);
41 std::unique_ptr<InsertTextFileJobPrivate> const d;
42};
43}
A job that downloads a given URL, interprets the result as a text file with the given encoding and th...
Q_SCRIPTABLE Q_NOREPLY void start()
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 11:54:54 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.