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  void start() override;
37 
38 private:
39  void slotGetJobFinished(KJob *job);
40  void slotFileData(KIO::Job *job, const QByteArray &data);
41  std::unique_ptr<InsertTextFileJobPrivate> const d;
42 };
43 }
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
Q_SCRIPTABLE Q_NOREPLY void start()
A job that downloads a given URL, interprets the result as a text file with the given encoding and th...
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:55:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.