yawpwserv.h

来自「KDE4.1 weather plasmoid」· C头文件 代码 · 共 83 行

H
83
字号
//// 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 + =
减小字号Ctrl + -
显示快捷键?