You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdenetwork/dcoprss/rssnewsfeed.h

116 lines
4.2 KiB

/*
* rssnewsfeed.h
*
* Copyright (c) 2003 Frerich Raabe <raabe@kde.org>
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
* accompanying file 'COPYING'.
*/
#ifndef RSSNEWSFEED_H
#define RSSNEWSFEED_H
#include <tqdatetime.h>
#include <tqstringlist.h>
#include <tqvariant.h>
#include <kdatastream.h>
class QueryService;
class RSSNewsFeed
{
friend TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed );
friend TQDataStream &operator<<( TQDataStream &stream, const RSSNewsFeed &feed );
friend class QueryService;
public:
unsigned int id() const { return m_id; }
TQString name() const { return m_name; }
TQString description() const { return m_description; }
TQString origin() const { return m_origin; }
TQString languageCode() const { return m_languageCode; }
TQString status() const { return m_status; }
TQString version() const { return m_version; }
TQString homePage() const { return m_homePage; }
TQString sourceFile() const { return m_sourceFile; }
TQString imageUrl() const { return m_imageUrl; }
TQString webmaster() const { return m_webmaster; }
TQString editor() const { return m_editor; }
TQString publisher() const { return m_publisher; }
TQString creator() const { return m_creator; }
const TQDateTime &dateCreated() const { return m_dateCreated; }
const TQDateTime &dateApproved() const { return m_dateApproved; }
const TQDateTime dateXmlChanged() const { return m_dateXmlChanged; }
bool fetchable() const { return m_fetchable; }
unsigned int views() const { return m_views; }
unsigned int headlinesPerDay() const { return m_headlinesPerDay; }
unsigned int headlinesRank() const { return m_headlinesRank; }
TQString toolkit() const { return m_toolkit; }
TQString toolkitVersion() const { return m_toolkitVersion; }
unsigned int pollingInterval() const { return m_pollingInterval; }
const TQDateTime &lastPoll() const { return m_lastPoll; }
TQStringList categories() const { return m_categories; }
private:
unsigned int m_id;
TQString m_name;
TQString m_description;
TQString m_origin;
TQString m_languageCode;
TQString m_status;
TQString m_version;
TQString m_homePage;
TQString m_sourceFile;
TQString m_imageUrl;
TQString m_webmaster;
TQString m_editor;
TQString m_publisher;
TQString m_creator;
TQDateTime m_dateCreated;
TQDateTime m_dateApproved;
TQDateTime m_dateXmlChanged;
bool m_fetchable;
unsigned int m_views;
unsigned int m_headlinesPerDay;
unsigned int m_headlinesRank;
TQString m_toolkit;
TQString m_toolkitVersion;
unsigned int m_pollingInterval;
TQDateTime m_lastPoll;
TQStringList m_categories;
};
inline TQDataStream &operator<<( TQDataStream &stream, const RSSNewsFeed &feed )
{
return stream << feed.m_id << feed.m_name << feed.m_description
<< feed.m_origin << feed.m_languageCode << feed.m_status
<< feed.m_version << feed.m_homePage << feed.m_sourceFile
<< feed.m_imageUrl << feed.m_webmaster << feed.m_publisher
<< feed.m_creator << feed.m_dateCreated << feed.m_dateApproved
<< feed.m_dateXmlChanged << feed.m_fetchable << feed.m_views
<< feed.m_headlinesPerDay << feed.m_headlinesRank
<< feed.m_toolkit << feed.m_toolkitVersion
<< feed.m_pollingInterval << feed.m_lastPoll
<< feed.m_categories;
}
inline TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed )
{
int i;
stream >> feed.m_id >> feed.m_name >> feed.m_description
>> feed.m_origin >> feed.m_languageCode >> feed.m_status
>> feed.m_version >> feed.m_homePage >> feed.m_sourceFile
>> feed.m_imageUrl >> feed.m_webmaster >> feed.m_publisher
>> feed.m_creator >> feed.m_dateCreated >> feed.m_dateApproved
>> feed.m_dateXmlChanged >> i >> feed.m_views
>> feed.m_headlinesPerDay >> feed.m_headlinesRank
>> feed.m_toolkit >> feed.m_toolkitVersion
>> feed.m_pollingInterval >> feed.m_lastPoll
>> feed.m_categories;
feed.m_fetchable = i != 0;
return stream;
}
#endif
// vim:ts=4:sw=4:noet