summaryrefslogtreecommitdiffstats
path: root/dcoprss/rssnewsfeed.h
blob: 0741ac2b736e6588e0f7874ade6da03804861d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * rssnewsfeed.h
 *
 * Copyright (c) 2003 Frerich Raabe <[email protected]>
 *
 * 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 )
{
	stream << feed.m_id;
	stream << feed.m_name;
	stream << feed.m_description;
	stream << feed.m_origin;
	stream << feed.m_languageCode;
	stream << feed.m_status;
	stream << feed.m_version;
	stream << feed.m_homePage;
	stream << feed.m_sourceFile;
	stream << feed.m_imageUrl;
	stream << feed.m_webmaster;
	stream << feed.m_publisher;
	stream << feed.m_creator;
	stream << feed.m_dateCreated;
	stream << feed.m_dateApproved;
	stream << feed.m_dateXmlChanged;
	stream << feed.m_fetchable;
	stream << feed.m_views;
	stream << feed.m_headlinesPerDay;
	stream << feed.m_headlinesRank;
	stream << feed.m_toolkit;
	stream << feed.m_toolkitVersion;
	stream << feed.m_pollingInterval;
	stream << feed.m_lastPoll;
	stream << feed.m_categories;

	return stream;
}

inline TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed )
{
	int i;
	stream >> feed.m_id;
	stream >> feed.m_name;
	stream >> feed.m_description;
	stream >> feed.m_origin;
	stream >> feed.m_languageCode;
	stream >> feed.m_status;
	stream >> feed.m_version;
	stream >> feed.m_homePage;
	stream >> feed.m_sourceFile;
	stream >> feed.m_imageUrl;
	stream >> feed.m_webmaster;
	stream >> feed.m_publisher;
	stream >> feed.m_creator;
	stream >> feed.m_dateCreated;
	stream >> feed.m_dateApproved;
	stream >> feed.m_dateXmlChanged;
	stream >> i;
	stream >> feed.m_views;
	stream >> feed.m_headlinesPerDay;
	stream >> feed.m_headlinesRank;
	stream >> feed.m_toolkit;
	stream >> feed.m_toolkitVersion;
	stream >> feed.m_pollingInterval;
	stream >> feed.m_lastPoll;
	stream >> feed.m_categories;
	feed.m_fetchable = i != 0;
	return stream;
}

#endif
// vim:ts=4:sw=4:noet