digiKam
twittermpform.h
Go to the documentation of this file.
1
/* ============================================================
2
*
3
* This file is a part of digiKam project
4
* https://www.digikam.org
5
*
6
* Date : 2018-06-29
7
* Description : a tool to export images to Twitter social network
8
*
9
* Copyright (C) 2018 by Tarek Talaat <tarektalaat93 at gmail dot com>
10
* Copyright (C) 2019 by Thanh Trung Dinh <dinhthanhtrung1996 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 DIGIKAM_TWITTER_MPFORM_H
25
#define DIGIKAM_TWITTER_MPFORM_H
26
27
// Qt includes
28
29
#include <QByteArray>
30
#include <QString>
31
#include <QList>
32
33
#define MAX_MEDIA_SIZE 1048576
34
35
namespace
DigikamGenericTwitterPlugin
36
{
37
38
class
TwMPForm
39
{
40
41
public
:
42
43
explicit
TwMPForm
();
44
~TwMPForm
();
45
46
void
reset
();
47
QByteArray
fileHeader
(
const
QString& imgPath);
48
bool
addFile
(
const
QString& imgPath,
bool
fragmented =
false
);
49
QByteArray
createPair
(
const
QByteArray& name,
const
QByteArray&
value
);
50
bool
addPair
(
const
QByteArray& pair);
51
void
finish
();
52
QByteArray
border
();
53
54
int
numberOfChunks
()
const
;
55
QString
contentType
()
const
;
56
QByteArray
formData
()
const
;
57
QByteArray
getChunk
(
int
index)
const
;
58
59
private
:
60
61
void
formChunks(
const
QByteArray& data);
62
63
private
:
64
65
QByteArray m_buffer;
66
QByteArray m_boundary;
67
QList<QByteArray>
m_chunks;
68
};
69
70
}
// namespace DigikamGenericTwitterPlugin
71
72
#endif
// DIGIKAM_TWITTER_MPFORM_H
DigikamGenericTwitterPlugin::TwMPForm
Definition:
twittermpform.h:39
DigikamGenericTwitterPlugin::TwMPForm::fileHeader
QByteArray fileHeader(const QString &imgPath)
Definition:
twittermpform.cpp:79
DigikamGenericTwitterPlugin::TwMPForm::~TwMPForm
~TwMPForm()
Definition:
twittermpform.cpp:47
DigikamGenericTwitterPlugin::TwMPForm::getChunk
QByteArray getChunk(int index) const
Definition:
twittermpform.cpp:117
DigikamGenericTwitterPlugin::TwMPForm::addFile
bool addFile(const QString &imgPath, bool fragmented=false)
Definition:
twittermpform.cpp:92
DigikamGenericTwitterPlugin::TwMPForm::formData
QByteArray formData() const
Definition:
twittermpform.cpp:145
DigikamGenericTwitterPlugin::TwMPForm::numberOfChunks
int numberOfChunks() const
Definition:
twittermpform.cpp:171
DigikamGenericTwitterPlugin::TwMPForm::addPair
bool addPair(const QByteArray &pair)
Definition:
twittermpform.cpp:72
DigikamGenericTwitterPlugin::TwMPForm::createPair
QByteArray createPair(const QByteArray &name, const QByteArray &value)
Definition:
twittermpform.cpp:57
DigikamGenericTwitterPlugin::TwMPForm::TwMPForm
TwMPForm()
Definition:
twittermpform.cpp:41
DigikamGenericTwitterPlugin::TwMPForm::border
QByteArray border()
Definition:
twittermpform.cpp:130
DigikamGenericTwitterPlugin::TwMPForm::reset
void reset()
Definition:
twittermpform.cpp:51
DigikamGenericTwitterPlugin::TwMPForm::finish
void finish()
Definition:
twittermpform.cpp:140
DigikamGenericTwitterPlugin::TwMPForm::contentType
QString contentType() const
Definition:
twittermpform.cpp:122
QList< QByteArray >
value
qulonglong value
Definition:
itemviewutilities.cpp:592
DigikamGenericTwitterPlugin
Definition:
twitteritem.h:31
core
dplugins
generic
webservices
twitter
twittermpform.h
Generated by
1.9.1