1
/***************************************************************************
2
* Copyright 2010 Artur Duque de Souza <asouza@kde.org> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18
***************************************************************************/
20
#ifndef SHAREPROVIDER_H
21
#define SHAREPROVIDER_H
24
#include <kio/global.h>
25
#include <KDE/KIO/Job>
27
#include <Plasma/PackageStructure>
30
class ShareProvider : public QObject
35
ShareProvider(QObject *parent =0);
36
static Plasma::PackageStructure::Ptr packageStructure();
38
QString method() const;
39
void setMethod(const QString &method);
42
void setUrl(const QString &url);
44
void addPostFile(const QString &contentKey, const QString &content);
47
void handleResultData(QString data);
48
void handleRedirection(const QString &url);
49
void readyToPublish();
50
void finished(const QString &url);
51
void finishedError(const QString &msg);
54
// ###: Function to return the content so the plugin can
55
// play with it before publishing?
59
QString parseXML(const QString &key, const QString &data);
60
void addQueryItem(const QString &key, const QString &value);
61
void addPostItem(const QString &key, const QString &value,
62
const QString &contentType);
65
void success(const QString &url);
66
void error(const QString &msg);
67
void redirected(KIO::Job *job, const KUrl &from);
71
void openFile(KIO::Job *job);
72
void finishedContentData(KIO::Job *job, const QByteArray &data);
73
void finishedPublish(KJob *job);
74
void readPublishData(KIO::Job *job, const QByteArray &data);
92
QByteArray m_boundary;
94
static Plasma::PackageStructure::Ptr m_packageStructure;
97
#endif // SHAREPROVIDER