1
/***************************************************************************
2
* Copyright (C) 2006 by Alan Jones *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19
***************************************************************************/
25
#include <qdatetime.h>
26
#include <qvaluelist.h>
28
#include <qdatastream.h>
32
#include "rss/loader.h"
33
#include "rss/document.h"
35
#include "rssarticle.h"
42
* @brief RssFeed Class
43
* @author Alan Jones <skyphyr@gmail.com>
48
class RssFeed : public QObject
54
* Default constructor.
56
RssFeed(QObject * parent = 0);
57
RssFeed(KURL feedUrl, QString title = "", bool active = false, int articleAge = 3, bool ignoreTTL = false, QTime autoRefresh = QTime());
58
RssFeed(const RssFeed &other);
59
RssFeed &operator=(const RssFeed &other);
62
KURL feedUrl() const { return m_feedUrl; }
63
bool active() const { return m_active; }
64
int articleAge() const { return m_articleAge; }
65
QString title() const { return m_title; }
66
QTime autoRefresh() const { return m_autoRefresh; }
67
bool ignoreTTL() const { return m_ignoreTTL; }
70
RssArticle::List articles() const { return m_articles; }
75
void feedLoaded(Loader *feedLoader, Document doc, Status status);
79
void setFeedUrl( const KURL& url );
80
void setFeedUrl( const QString& url );
81
void setActive( bool active );
82
void setArticleAge( int articleAge );
83
void setTitle( const QString& title );
84
void setAutoRefresh( const QTime& autoRefresh );
85
void setIgnoreTTL( bool ignoreTTL );
88
void setDownloaded(QString link, int downloaded);
91
void feedUrlChanged( const KURL& url );
92
void activeChanged( bool active );
93
void articleAgeChanged( int articleAge );
94
void titleChanged( const QString& title );
95
void updateTitle( const QString& title );
96
void autoRefreshChanged( const QTime& autoRefresh );
97
void ignoreTTLChanged( bool ignoreTTL );
99
void articlesChanged( const RssArticle::List& articles );
101
void scanRssArticle( RssArticle article );
110
RssArticle::List m_articles;
115
QString getFilename();
118
void cleanArticles();
122
QDataStream &operator<<( QDataStream &out, const RssFeed &feed );
123
QDataStream &operator>>( QDataStream &in, RssFeed &feed );