File indexing completed on 2023-09-24 08:19:52

0001 /* ============================================================
0002  *
0003  * This file is a part of KDE project
0004  *
0005  *
0006  * Date        : 2005-07-07
0007  * Description : a kipi plugin to export images to Flickr web service
0008  *
0009  * Copyright (C) 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
0010  * Copyright (C) 2008-2018 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * This program is free software; you can redistribute it
0013  * and/or modify it under the terms of the GNU General
0014  * Public License as published by the Free Software Foundation;
0015  * either version 2, or (at your option) any later version.
0016  *
0017  * This program is distributed in the hope that it will be useful,
0018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020  * GNU General Public License for more details.
0021  *
0022  * ============================================================ */
0023 
0024 #ifndef MPFORM_H
0025 #define MPFORM_H
0026 
0027 // Qt includes
0028 
0029 #include <QByteArray>
0030 #include <QString>
0031 
0032 namespace KIPIFlickrPlugin
0033 {
0034 
0035 class MPForm
0036 {
0037 
0038 public:
0039 
0040     MPForm();
0041     ~MPForm();
0042 
0043     void finish();
0044     void reset();
0045 
0046     bool addPair(const QString& name, const QString& value, const QString& type);
0047     bool addFile(const QString& name, const QString& path);
0048 
0049     QString    contentType() const;
0050     QByteArray formData()    const;
0051     QString    boundary()    const;
0052 
0053 private:
0054 
0055     QByteArray m_buffer;
0056     QByteArray m_boundary;
0057 };
0058 
0059 } // namespace KIPIFlickrPlugin
0060 
0061 #endif /* MPFORM_H */