1 | /* |
2 | This file is a part of kipi-plugins project |
3 | http://www.kipi-plugins.org |
4 | |
5 | Date : 2005-07-07 |
6 | Description : a tool to export images to imgur.com |
7 | |
8 | SPDX-FileCopyrightText: 2005-2008 Vardhman Jain <vardhman at gmail dot com> |
9 | SPDX-FileCopyrightText: 2008-2013 Gilles Caulier <caulier dot gilles at gmail dot com> |
10 | SPDX-FileCopyrightText: 2010-2012 Marius Orcsik <marius at habarnam dot ro> |
11 | |
12 | SPDX-License-Identifier: GPL-2.0-or-later |
13 | */ |
14 | |
15 | #ifndef MPFORM_H |
16 | #define MPFORM_H |
17 | |
18 | // Qt includes |
19 | |
20 | #include <QByteArray> |
21 | #include <QUrl> |
22 | |
23 | class MPForm |
24 | { |
25 | public: |
26 | MPForm(); |
27 | ~MPForm(); |
28 | |
29 | void finish(); |
30 | void reset(); |
31 | |
32 | bool addPair(const QString &name, const QString &value, const QString &type); |
33 | bool addFile(const QString &name, const QString &path); |
34 | bool addFile(const QString &name, const QUrl &filePath, const QByteArray &fileData); |
35 | |
36 | QByteArray contentType() const; |
37 | QByteArray formData() const; |
38 | QByteArray boundary() const; |
39 | |
40 | private: |
41 | QByteArray m_buffer; |
42 | QByteArray m_boundary; |
43 | }; |
44 | |
45 | #endif /* MPFORM_H */ |
46 | |