📄 yawpwserv.h
字号:
//// C++ Implementation: yawp//// Description:////// Author: Ruan <ruans@kr8.co.za>, (C) 2008//// Copyright: Do what you want, whenever you want.////#ifndef YAWP_WSERV_H#define YAWP_WSERV_H#include "yawpwday.h"#include <QObject>#include <kdebug.h>#include <kio/job.h>//-----------------------------------------------------------------------------/** The abstract base class of a weather service. @see YaWPGoogleWeatherService @author Ruan <ruans@kr8.co.za> */class YaWPWeatherService : public QObject { Q_OBJECTpublic: static const int SUCCESS = 0; static const int CONNECTION_FAILED = 1; static const int DATA_FAILED = 2; static const int ERROR = 3; virtual ~YaWPWeatherService(){} virtual void update(const QString &country, const QString &city){ Q_UNUSED(country); Q_UNUSED(city); kDebug() << "YaWPWeatherService::update() NOT IMPLEMENTED!" << endl; } const QString & serviceName() const { return m_name; } const QVector<YaWPDay>& days(){return m_days;}signals: void completed(QObject *, int); protected: YaWPWeatherService(const QString &name); QString m_name; QVector<YaWPDay> m_days;};//-----------------------------------------------------------------------------/** An google implementation of YaWPWeatherService. @author Ruan <ruans@kr8.co.za> */class YaWPGoogleWeatherService : public YaWPWeatherService { Q_OBJECTpublic: YaWPGoogleWeatherService(); virtual ~YaWPGoogleWeatherService(); void update(const QString &country, const QString &city);protected slots: void slotData( KIO::Job *, const QByteArray & ); void slotResult(KJob *); private: bool parseInfo(const QByteArray &data, QVector<YaWPDay> &days); QString m_city; QString m_country; QByteArray m_xmldata;};#endif //YAWP_WSERV_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -