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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2005-07-07
0007  * Description : a tool to export images to Smugmug web service
0008  *
0009  * SPDX-FileCopyrightText: 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
0010  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_SMUG_MPFORM_H
0017 #define DIGIKAM_SMUG_MPFORM_H
0018 
0019 // Qt includes
0020 
0021 #include <QByteArray>
0022 #include <QString>
0023 
0024 namespace DigikamGenericSmugPlugin
0025 {
0026 
0027 class SmugMPForm
0028 {
0029 
0030 public:
0031 
0032     explicit SmugMPForm();
0033     ~SmugMPForm();
0034 
0035 public:
0036 
0037     void finish();
0038     void reset();
0039 
0040     bool addPair(const QString& name,
0041                  const QString& value,
0042                  const QString& type = QLatin1String("text/plain"));
0043 
0044     bool addFile(const QString& name,
0045                  const QString& path);
0046 
0047     QString    contentType() const;
0048     QByteArray formData()    const;
0049     QString    boundary()    const;
0050 
0051 private:
0052 
0053     QByteArray m_buffer;
0054     QByteArray m_boundary;
0055 };
0056 
0057 } // namespace DigikamGenericSmugPlugin
0058 
0059 #endif // DIGIKAM_SMUG_MPFORM_H