flickrdemo.h Example File
flickrdemo/flickrdemo.h
#ifndef FLICKRDEMO_H
#define FLICKRDEMO_H
#include <QtGui>
#include <QtNetwork>
#include <qmobilityglobal.h>
#include "xqlistwidget.h"
QTM_BEGIN_NAMESPACE
class QNetworkSession;
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 httpRequestFinished(int requestId, bool error);
void readResponseHeader(const QHttpResponseHeader& responseHeader);
void updateDataReadProgress(int bytesRead, int totalBytes);
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();
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;
QHttp *m_http;
QString m_filePath;
QFile* m_file;
int m_httpGetId;
int m_httpThumbnailGetId;
bool m_httpRequestAborted;
int m_pages;
int m_page;
int m_satellitesInView;
int m_satellitesUsed;
double m_latitude;
double m_longitude;
bool m_downloadPictureList;
bool m_downloadingThumbnails;
int m_nameCounter;
QStringList m_names;
};
class PictureDialog: public QDialog
{
Q_OBJECT
public:
PictureDialog(const QString& filePath, const QString& pictureName, QWidget* parent = 0);
private slots:
void clicked(QAbstractButton *button);
private:
static const QSize imageSize;
QLabel *label;
QLabel *imageLabel;
QDialogButtonBox *buttonBox;
QPushButton *keepButton;
QPushButton *discardButton;
};
#endif
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) |
Trademarks |
Qt Mobility Project 1.0.0 |