File indexing completed on 2024-05-19 04:03:03

0001 /*
0002     This file is a part of kipi-plugins project
0003     http://www.kipi-plugins.org
0004 
0005     Date        : 2005-07-07
0006     Description : a tool to export images to imgur.com
0007 
0008     SPDX-FileCopyrightText: 2005-2008 Vardhman Jain <vardhman at gmail dot com>
0009     SPDX-FileCopyrightText: 2008-2013 Gilles Caulier <caulier dot gilles at gmail dot com>
0010     SPDX-FileCopyrightText: 2010-2012 Marius Orcsik <marius at habarnam dot ro>
0011 
0012     SPDX-License-Identifier: GPL-2.0-or-later
0013 */
0014 
0015 #ifndef MPFORM_H
0016 #define MPFORM_H
0017 
0018 // Qt includes
0019 
0020 #include <QByteArray>
0021 #include <QUrl>
0022 
0023 class MPForm
0024 {
0025 public:
0026     MPForm();
0027     ~MPForm();
0028 
0029     void finish();
0030     void reset();
0031 
0032     bool addPair(const QString &name, const QString &value, const QString &type);
0033     bool addFile(const QString &name, const QString &path);
0034     bool addFile(const QString &name, const QUrl &filePath, const QByteArray &fileData);
0035 
0036     QByteArray contentType() const;
0037     QByteArray formData() const;
0038     QByteArray boundary() const;
0039 
0040 private:
0041     QByteArray m_buffer;
0042     QByteArray m_boundary;
0043 };
0044 
0045 #endif /* MPFORM_H */