File indexing completed on 2025-01-05 03:53:31

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-02-02
0007  * Description : a tool to export items to ImageShack web service
0008  *
0009  * SPDX-FileCopyrightText: 2012      by Dodon Victor <dodonvictor at gmail dot com>
0010  * SPDX-FileCopyrightText: 2013-2018 by Caulier Gilles <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_IMAGE_SHACK_MPFORM_H
0017 #define DIGIKAM_IMAGE_SHACK_MPFORM_H
0018 
0019 // Qt includes
0020 
0021 #include <QByteArray>
0022 #include <QString>
0023 
0024 namespace DigikamGenericImageShackPlugin
0025 {
0026 
0027 class ImageShackMPForm
0028 {
0029 
0030 public:
0031 
0032     explicit ImageShackMPForm();
0033     ~ImageShackMPForm();
0034 
0035     void finish();
0036     void reset();
0037 
0038     void addPair(const QString& name, const QString& value);
0039     bool addFile(const QString& name, const QString& path);
0040 
0041     QString    contentType() const;
0042     QByteArray formData()    const;
0043     QString    boundary()    const;
0044 
0045 private:
0046 
0047     QByteArray m_buffer;
0048     QByteArray m_boundary;
0049 };
0050 
0051 } // namespace DigikamGenericImageShackPlugin
0052 
0053 #endif // DIGIKAM_IMAGE_SHACK_MPFORM_H