1 /* ============================================================
2  *
3  * This file is a part of KDE project
4  *
5  *
6  * Date        : 2005-07-07
7  * Description : a kipi plugin to export images to Flickr web service
8  *
9  * Copyright (C) 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
10  * Copyright (C) 2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef MPFORM_H
25 #define MPFORM_H
26 
27 // Qt includes
28 
29 #include <QByteArray>
30 #include <QString>
31 
32 namespace KIPISmugPlugin
33 {
34 
35 class MPForm
36 {
37 
38 public:
39 
40     MPForm();
41     ~MPForm();
42 
43     void finish();
44     void reset();
45 
46     bool addPair(const QString& name, const QString& value,
47             const QString& type = QStringLiteral("text/plain"));
48     bool addFile(const QString& name, const QString& path);
49 
50     QString    contentType() const;
51     QByteArray formData()    const;
52     QString    boundary()    const;
53 
54 private:
55 
56     QByteArray m_buffer;
57     QByteArray m_boundary;
58 };
59 
60 } // namespace KIPISmugPlugin
61 
62 #endif /* MPFORM_H */
63