2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 #ifndef IMAGEFETCHERSTUB_H
22 #define IMAGEFETCHERSTUB_H
24 #include "../../src/situareservice/imagefetcher.h"
27 class ImageFetcherStub : public StubBase
30 virtual void ImageFetcherConstructor(NetworkAccessManager *manager, QObject *parent = 0);
31 virtual void fetchImage(const QString &id, const QUrl &url);
32 virtual void downloadFinished(QNetworkReply *reply);
33 virtual void startNextDownload();
36 void ImageFetcherStub::ImageFetcherConstructor(NetworkAccessManager *manager, QObject *parent)
42 void ImageFetcherStub::fetchImage(const QString &id, const QUrl &url)
44 QList<ParameterBase *> params;
45 params.append(new Parameter<const QString &>(id));
46 params.append(new Parameter<const QUrl &>(url));
47 stubMethodEntered("fetchImage");
50 void ImageFetcherStub::downloadFinished(QNetworkReply *reply)
52 QList<ParameterBase *> params;
53 params.append(new Parameter<const QNetworkReply *>(reply));
54 stubMethodEntered("downloadFinished", params);
57 void ImageFetcherStub::startNextDownload()
59 stubMethodEntered("startNextDownload");
62 //Create a stub instance
63 ImageFetcherStub defaultImageFetcherStub;
64 ImageFetcherStub *imageFetcherStub = &defaultImageFetcherStub;
66 ImageFetcher::ImageFetcher(NetworkAccessManager *manager, QObject *parent)
68 imageFetcherStub->ImageFetcherConstructor(manager, parent);
71 void ImageFetcher::fetchImage(const QString &id, const QUrl &url)
73 imageFetcherStub->fetchImage(id, url);
76 void ImageFetcher::downloadFinished(QNetworkReply *reply)
78 imageFetcherStub->downloadFinished(reply);
81 void ImageFetcher::startNextDownload()
83 imageFetcherStub->startNextDownload();
86 #endif // IMAGEFETCHERSTUB_H