Changed Doxyfile to ignore moc_* files
[situare] / tests / situareservice / testlocationupdate / networkreplymock.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5       Henri Lampela - henri.lampela@ixonos.com
6       Jussi Laitinen - jussi.laitinen@ixonos.com
7
8    Situare is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License
10    version 2 as published by the Free Software Foundation.
11
12    Situare is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with Situare; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
20    USA.
21 */
22
23 #ifndef NETWORKREPLYMOCK_H
24 #define NETWORKREPLYMOCK_H
25
26 #include <QNetworkReply>
27 #include <QUrl>
28
29
30 class NetworkReplyMock : public QNetworkReply
31 {
32     Q_OBJECT
33 public:
34     NetworkReplyMock(QObject *parent = 0);
35     void abort();
36     qint64 bytesAvailable() const;
37
38     bool isSequential() const
39     {
40         return true;
41     }
42     void setError(NetworkError errorCode, const QString &errorString);
43     void setData(const QByteArray &content);
44     void setUrl(const QUrl &url);
45     void test();
46     QByteArray readAll();
47
48 protected:
49     qint64 readData(char *data, qint64 maxlen);
50
51 private:
52     QByteArray m_content;
53     qint64 m_offset;
54 };
55
56 #endif // NETWORKREPLYMOCK_H