Attica

postfiledata.h
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2009 Frederik Gladhorn <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #ifndef POSTFILEDATA_H
10 #define POSTFILEDATA_H
11 
12 #include <QByteArray>
13 #include <QIODevice>
14 #include <QNetworkRequest>
15 
16 namespace Attica
17 {
18 class PostFileDataPrivate;
19 
20 class PostFileData
21 {
22 public:
28  PostFileData(const QUrl &url);
29  ~PostFileData();
30 
31  void addArgument(const QString &key, const QString &value);
32  void addFile(const QString &fileName, QIODevice *file, const QString &mimeType);
33  void addFile(const QString &fileName, const QByteArray &file, const QString &mimeType, const QString &fieldName = QStringLiteral("localfile"));
34 
35  QNetworkRequest request();
36  QByteArray data();
37 
38 private:
39  void finish();
40  QString randomString(int length);
41  PostFileDataPrivate *d;
42  Q_DISABLE_COPY(PostFileData)
43 };
44 
45 }
46 
47 #endif // POSTFILEDATA_H
KCOREADDONS_EXPORT QString randomString(int length)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:06:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.