Messagelib

inserttextfilejob.h
1 /*
2  * SPDX-FileCopyrightText: 2010 Thomas McGuire <[email protected]>
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 
13 class QTextEdit;
14 
15 namespace KIO
16 {
17 class Job;
18 }
19 
20 namespace MessageComposer
21 {
22 class 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  */
27 class MESSAGECOMPOSER_EXPORT InsertTextFileJob : public KJob
28 {
29  Q_OBJECT
30 
31 public:
32  explicit InsertTextFileJob(QTextEdit *editor, const QUrl &url);
33  ~InsertTextFileJob() override;
34 
35  void setEncoding(const QString &encoding);
36 
37  void start() override;
38 
39 private Q_SLOTS:
40 
41  void slotGetJobFinished(KJob *job);
42  void slotFileData(KIO::Job *job, const QByteArray &data);
43 
44 private:
45  std::unique_ptr<InsertTextFileJobPrivate> const d;
46 };
47 }
48 
A job that downloads a given URL, interprets the result as a text file with the given encoding and th...
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-2021 The KDE developers.
Generated on Fri Nov 26 2021 23:16:42 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.