~ubuntu-branches/ubuntu/raring/recorditnow/raring

« back to all changes in this revision

Viewing changes to joschy-snapshot-23-02-10/QNetworkLayer/src/qnetworklayer.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-09 14:54:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110109145401-gyckb4airz4fio50
Tags: 0.8.1-0ubuntu1
* New upstream release. (LP: #681270)
  - Update debian/copyright.
* Build-depend on recordmydesktop.
* Add a watch file.
* Drop 01_fix_ftbfs_kwarning_call.diff, fixed upstream.
* Add 01_joschy_install_to_usr_lib.diff.
* Add 02_fix_ftbfs_no-add-needed.diff.
* Add 03_dont_install_header_files.diff.
* Replace dependency on libpolkit-qt-1-0 with policykit-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2010  Kai Dombrowe <just89@gmx.de>
 
3
 
 
4
    This library is free software; you can redistribute it and/or
 
5
    modify it under the terms of the GNU Lesser General Public
 
6
    License as published by the Free Software Foundation; either
 
7
    version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
    This library 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 GNU
 
12
    Lesser General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU Lesser General Public
 
15
    License along with this library; if not, write to the Free Software
 
16
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
17
*/
 
18
 
 
19
#ifndef QNETWORKLAYER_H
 
20
#define QNETWORKLAYER_H
 
21
 
 
22
 
 
23
// Joschy
 
24
#include <joschycore/abstractnetworklayer.h>
 
25
 
 
26
// Qt
 
27
#include <QtCore/QtPlugin>
 
28
 
 
29
 
 
30
class QNetworkAccessManager;
 
31
class QNetworkReply;
 
32
namespace Joschy {
 
33
 
 
34
 
 
35
class AbstractJob;
 
36
class TransferJob;
 
37
class JOSCHY_EXPORT QNetworkLayer : public Joschy::AbstractNetworkLayer
 
38
{
 
39
    Q_OBJECT
 
40
 
 
41
 
 
42
public:
 
43
    explicit QNetworkLayer(QObject *parent = 0);
 
44
    ~QNetworkLayer();
 
45
 
 
46
    QString post(const QUrl &url, const Header &header, const QByteArray &data);
 
47
    QString post(const QUrl &url, const Header &header, QIODevice *device);
 
48
    QString get(const QUrl &url, const Header &header = Header());
 
49
 
 
50
 
 
51
private:
 
52
    QNetworkAccessManager *m_networkManager;
 
53
    QHash<AbstractJob*, QString> m_jobs;
 
54
 
 
55
 
 
56
private slots:
 
57
    void jobFinished(Joschy::AbstractJob *job);
 
58
 
 
59
 
 
60
protected:
 
61
    void cancel(const QString &id);
 
62
 
 
63
 
 
64
};
 
65
 
 
66
 
 
67
} // namespace Joschy
 
68
 
 
69
 
 
70
Q_EXPORT_PLUGIN2(joschyqnetworklayer, Joschy::QNetworkLayer);
 
71
 
 
72
 
 
73
#endif // QNETWORKLAYER_H