~ubuntu-branches/ubuntu/natty/recorditnow/natty

« back to all changes in this revision

Viewing changes to src/plugins/upload/lib/blipservice.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2009-11-26 16:50:53 UTC
  • Revision ID: james.westby@ubuntu.com-20091126165053-yifjycveb8j7yt8r
Tags: upstream-0.4
Import upstream version 0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2009 by Kai Dombrowe <just89@gmx.de>                    *
 
3
 *                                                                         *
 
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.                                   *
 
8
 *                                                                         *
 
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.                          *
 
13
 *                                                                         *
 
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
 ***************************************************************************/
 
19
 
 
20
 
 
21
#ifndef BLIPSERVICE_H
 
22
#define BLIPSERVICE_H
 
23
 
 
24
 
 
25
// own
 
26
#include "service.h"
 
27
 
 
28
// KDE
 
29
#include <kdemacros.h>
 
30
 
 
31
// Qt
 
32
#include <QtCore/QObject>
 
33
#include <QtCore/QString>
 
34
#include <QtCore/QPointer>
 
35
 
 
36
 
 
37
namespace KIO {
 
38
    class Job;
 
39
};
 
40
class KJob;
 
41
class BlipVideo;
 
42
class QXmlStreamReader;
 
43
class KDE_EXPORT BlipService : public KYouBlip::Service
 
44
{
 
45
    Q_OBJECT
 
46
 
 
47
 
 
48
public:
 
49
    BlipService(QObject *parent = 0);
 
50
    ~BlipService();
 
51
 
 
52
 
 
53
public slots:
 
54
    QString upload(const BlipVideo *video, const QString &account, const QString &password);
 
55
    QString search(const QString &term);
 
56
 
 
57
 
 
58
public slots:
 
59
    void cancelUpload();
 
60
    void cancelUpload(const QString &id);
 
61
 
 
62
 
 
63
private:
 
64
    enum JobType {
 
65
        AuthJob = 0,
 
66
        UploadJob = 1,
 
67
        SearchJob = 2
 
68
    };
 
69
    typedef QPair<JobType, QString> JobData;
 
70
 
 
71
    QHash<KJob*, JobData> m_jobs;
 
72
 
 
73
    BlipVideo *readEntry(QXmlStreamReader *reader);
 
74
 
 
75
 
 
76
protected slots:
 
77
    void jobFinished(KJob *job, const QByteArray &data);
 
78
 
 
79
 
 
80
signals:
 
81
    void error(const QString &reason, const QString &id);
 
82
    void uploadFinished(const KUrl &link, const QString &id);
 
83
    void canceled(const QString &id);
 
84
    void searchFinished(const QList<BlipVideo*> &videos, const QString &id);
 
85
 
 
86
 
 
87
};
 
88
 
 
89
 
 
90
#endif // BlipService_H