TDE network applications
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.

rssnewsfeed.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * rssnewsfeed.h
  3. *
  4. * Copyright (c) 2003 Frerich Raabe <raabe@kde.org>
  5. *
  6. * This program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
  9. * accompanying file 'COPYING'.
  10. */
  11. #ifndef RSSNEWSFEED_H
  12. #define RSSNEWSFEED_H
  13. #include <tqdatetime.h>
  14. #include <tqstringlist.h>
  15. #include <tqvariant.h>
  16. #include <kdatastream.h>
  17. class QueryService;
  18. class RSSNewsFeed
  19. {
  20. friend TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed );
  21. friend TQDataStream &operator<<( TQDataStream &stream, const RSSNewsFeed &feed );
  22. friend class QueryService;
  23. public:
  24. unsigned int id() const { return m_id; }
  25. TQString name() const { return m_name; }
  26. TQString description() const { return m_description; }
  27. TQString origin() const { return m_origin; }
  28. TQString languageCode() const { return m_languageCode; }
  29. TQString status() const { return m_status; }
  30. TQString version() const { return m_version; }
  31. TQString homePage() const { return m_homePage; }
  32. TQString sourceFile() const { return m_sourceFile; }
  33. TQString imageUrl() const { return m_imageUrl; }
  34. TQString webmaster() const { return m_webmaster; }
  35. TQString editor() const { return m_editor; }
  36. TQString publisher() const { return m_publisher; }
  37. TQString creator() const { return m_creator; }
  38. const TQDateTime &dateCreated() const { return m_dateCreated; }
  39. const TQDateTime &dateApproved() const { return m_dateApproved; }
  40. const TQDateTime dateXmlChanged() const { return m_dateXmlChanged; }
  41. bool fetchable() const { return m_fetchable; }
  42. unsigned int views() const { return m_views; }
  43. unsigned int headlinesPerDay() const { return m_headlinesPerDay; }
  44. unsigned int headlinesRank() const { return m_headlinesRank; }
  45. TQString toolkit() const { return m_toolkit; }
  46. TQString toolkitVersion() const { return m_toolkitVersion; }
  47. unsigned int pollingInterval() const { return m_pollingInterval; }
  48. const TQDateTime &lastPoll() const { return m_lastPoll; }
  49. TQStringList categories() const { return m_categories; }
  50. private:
  51. unsigned int m_id;
  52. TQString m_name;
  53. TQString m_description;
  54. TQString m_origin;
  55. TQString m_languageCode;
  56. TQString m_status;
  57. TQString m_version;
  58. TQString m_homePage;
  59. TQString m_sourceFile;
  60. TQString m_imageUrl;
  61. TQString m_webmaster;
  62. TQString m_editor;
  63. TQString m_publisher;
  64. TQString m_creator;
  65. TQDateTime m_dateCreated;
  66. TQDateTime m_dateApproved;
  67. TQDateTime m_dateXmlChanged;
  68. bool m_fetchable;
  69. unsigned int m_views;
  70. unsigned int m_headlinesPerDay;
  71. unsigned int m_headlinesRank;
  72. TQString m_toolkit;
  73. TQString m_toolkitVersion;
  74. unsigned int m_pollingInterval;
  75. TQDateTime m_lastPoll;
  76. TQStringList m_categories;
  77. };
  78. inline TQDataStream &operator<<( TQDataStream &stream, const RSSNewsFeed &feed )
  79. {
  80. stream << feed.m_id;
  81. stream << feed.m_name;
  82. stream << feed.m_description;
  83. stream << feed.m_origin;
  84. stream << feed.m_languageCode;
  85. stream << feed.m_status;
  86. stream << feed.m_version;
  87. stream << feed.m_homePage;
  88. stream << feed.m_sourceFile;
  89. stream << feed.m_imageUrl;
  90. stream << feed.m_webmaster;
  91. stream << feed.m_publisher;
  92. stream << feed.m_creator;
  93. stream << feed.m_dateCreated;
  94. stream << feed.m_dateApproved;
  95. stream << feed.m_dateXmlChanged;
  96. stream << feed.m_fetchable;
  97. stream << feed.m_views;
  98. stream << feed.m_headlinesPerDay;
  99. stream << feed.m_headlinesRank;
  100. stream << feed.m_toolkit;
  101. stream << feed.m_toolkitVersion;
  102. stream << feed.m_pollingInterval;
  103. stream << feed.m_lastPoll;
  104. stream << feed.m_categories;
  105. return stream;
  106. }
  107. inline TQDataStream &operator>>( TQDataStream &stream, RSSNewsFeed &feed )
  108. {
  109. int i;
  110. stream >> feed.m_id;
  111. stream >> feed.m_name;
  112. stream >> feed.m_description;
  113. stream >> feed.m_origin;
  114. stream >> feed.m_languageCode;
  115. stream >> feed.m_status;
  116. stream >> feed.m_version;
  117. stream >> feed.m_homePage;
  118. stream >> feed.m_sourceFile;
  119. stream >> feed.m_imageUrl;
  120. stream >> feed.m_webmaster;
  121. stream >> feed.m_publisher;
  122. stream >> feed.m_creator;
  123. stream >> feed.m_dateCreated;
  124. stream >> feed.m_dateApproved;
  125. stream >> feed.m_dateXmlChanged;
  126. stream >> i;
  127. stream >> feed.m_views;
  128. stream >> feed.m_headlinesPerDay;
  129. stream >> feed.m_headlinesRank;
  130. stream >> feed.m_toolkit;
  131. stream >> feed.m_toolkitVersion;
  132. stream >> feed.m_pollingInterval;
  133. stream >> feed.m_lastPoll;
  134. stream >> feed.m_categories;
  135. feed.m_fetchable = i != 0;
  136. return stream;
  137. }
  138. #endif
  139. // vim:ts=4:sw=4:noet