flickrdemo.h Example File
flickrdemo/flickrdemo.h
#ifndef FLICKRDEMO_H
#define FLICKRDEMO_H
#include <QDialog>
#include <QMainWindow>
#include <QNetworkReply>
#include <QSize>
class QAction;
class QDialogButtonBox;
class QLabel;
class QNetworkAccessManager;
class QNetworkRequest;
class QProgressDialog;
class QPushButton;
class QWidget;
#include <qmobilityglobal.h>
#include "xqlistwidget.h"
QTM_BEGIN_NAMESPACE
#ifndef BEARER_IN_QTNETWORK
class QNetworkSession;
#endif
class QGeoPositionInfoSource;
class QGeoPositionInfo;
class QGeoSatelliteInfoSource;
class QGeoSatelliteInfo;
QTM_END_NAMESPACE
#include "connectivityhelper.h"
QTM_USE_NAMESPACE
class FlickrDemo: public QMainWindow
{
Q_OBJECT
public:
FlickrDemo(QWidget* parent = 0);
~FlickrDemo();
private:
void createMenus();
void viewSatelliteInfo();
bool parsePictureList(QString xmlString);
void downloadFlickerPictureList();
void downloadPictureFromFlickr();
void downloadNextThumbnail();
private Q_SLOTS:
void delayedInit();
void networkSessionOpened();
void downloadButtonClicked();
void cancelDownload();
void pictureListDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void pictureListFinished();
void pictureListError(QNetworkReply::NetworkError code);
void clearPictureListRequest();
void thumbnailFinished();
void thumbnailError(QNetworkReply::NetworkError code);
void clearThumbnailRequest();
void pictureDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void pictureFinished();
void pictureError(QNetworkReply::NetworkError code);
void clearPictureRequest();
void positionUpdated(const QGeoPositionInfo &gpsPos);
void satellitesInViewUpdated(const QList<QGeoSatelliteInfo>&);
void satellitesInUseUpdated(const QList<QGeoSatelliteInfo>&);
private:
static const QSize gridSize;
static const QSize thumbnailSize;
static const QSize imageSize;
static const QString apikey;
static const QString savePath;
void displayImage(const QPixmap &pixmap);
QLabel *locationLabel;
QLabel *satellitesLabel;
XQListWidget *listWidget;
QPushButton *downloadButton;
QAction* m_downloadAct;
bool m_logfileInUse;
QGeoPositionInfoSource* m_location;
QGeoSatelliteInfoSource* m_satellite;
QNetworkSession* m_session;
ConnectivityHelper *m_connectivityHelper;
QProgressDialog *m_progressDialog;
QNetworkAccessManager *m_nam;
QNetworkReply *m_pictureListReply;
QNetworkReply *m_thumbnailReply;
QNetworkReply *m_pictureReply;
int m_pages;
int m_page;
int m_satellitesInView;
int m_satellitesUsed;
double m_latitude;
double m_longitude;
bool m_downloadPictureList;
int m_nameCounter;
QStringList m_names;
bool m_shuttingDown;
};
class PictureDialog: public QDialog
{
Q_OBJECT
public:
PictureDialog(const QPixmap& pixmapd, const QString& pictureName, QWidget* parent = 0);
private:
QLabel *label;
QLabel *imageLabel;
QDialogButtonBox *buttonBox;
};
#endif
|