akregator/src/librss
RSS::Article Class Reference
#include <article.h>
Detailed Description
Represents an article as stored in a RSS file.You don't have to instantiate one of these yourself, the common way to access instances is via Document::articles().
- See also:
- Document::articles()
Definition at line 37 of file article.h.
Public Types | |
typedef QValueList< Article > | List |
typedef QMap< QString, QString > | MetaInfoMap |
Public Member Functions | |
Article () | |
Article (const Article &other) | |
Article (const QDomNode &node, Format format, Version version) | |
Article & | operator= (const Article &other) |
bool | operator== (const Article &other) const |
bool | operator!= (const Article &other) const |
virtual | ~Article () |
QString | title () const |
const KURL & | link () const |
QString | description () const |
QString | author () const |
QString | guid () const |
bool | guidIsPermaLink () const |
const QDateTime & | pubDate () const |
const KURL & | commentsLink () const |
int | comments () const |
Enclosure | enclosure () const |
QValueList< Category > | categories () const |
QString | meta (const QString &key) const |
KURLLabel * | widget (QWidget *parent=0, const char *name=0) const |
Member Typedef Documentation
typedef QValueList<Article> RSS::Article::List |
Constructor & Destructor Documentation
Article::Article | ( | ) |
Article::Article | ( | const Article & | other | ) |
Copy constructor.
- Parameters:
-
other The Article object to copy.
Definition at line 51 of file article.cpp.
Constructs an Article from a piece of RSS markup.
- Parameters:
-
node A QDomNode which references the DOM leaf to be used for constructing the Article.
Definition at line 67 of file article.cpp.
Article::~Article | ( | ) | [virtual] |
Member Function Documentation
Assignment operator.
- Parameters:
-
other The Article object to clone.
- Returns:
- A reference to the cloned Article object.
Definition at line 274 of file article.cpp.
bool Article::operator== | ( | const Article & | other | ) | const |
Compares two articles.
Two articles are treated to be identical if all their properties (title, link, description etc.) are equal.
- Parameters:
-
other The article this article should be compared with.
- Returns:
- Whether the two articles are equal.
Definition at line 285 of file article.cpp.
bool RSS::Article::operator!= | ( | const Article & | other | ) | const [inline] |
QString Article::title | ( | ) | const |
RSS 0.90 and upwards.
- Returns:
- The headline of this article, or QString::null if no headline was available.
Definition at line 213 of file article.cpp.
const KURL & Article::link | ( | ) | const |
RSS 0.90 and upwards.
- Returns:
- A URL referencing the complete text for this article, or an empty KURL if no link was available. Note that the RSS 0.91 Specification dictates that URLs not starting with "http://" or "ftp://" are considered invalid.
Definition at line 223 of file article.cpp.
QString Article::description | ( | ) | const |
RSS 0.91 and upwards.
- Returns:
- A story synopsis, or QString::null if no description was available.
Definition at line 228 of file article.cpp.
QString Article::author | ( | ) | const |
QString Article::guid | ( | ) | const |
RSS 2.0 and upwards.
- Returns:
- An article GUID (globally unique identifier).
Definition at line 233 of file article.cpp.
bool Article::guidIsPermaLink | ( | ) | const |
RSS 2.0 and upwards.
- Returns:
- If this article GUID is permalink. Has no meaning when guid() is QString::null.
Definition at line 238 of file article.cpp.
const QDateTime & Article::pubDate | ( | ) | const |
RSS 2.0 and upwards.
- Returns:
- The date when the article was published.
Definition at line 243 of file article.cpp.
QValueList< Category > Article::categories | ( | ) | const |
returns a list of categories this article is assigned to.
(RSS2 only, Atom is not supported yet)
Definition at line 61 of file article.cpp.
KURLLabel * Article::widget | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) | const |
- Parameters:
-
parent The parent widget for the KURLLabel.
- Parameters:
-
name A name for the widget which will be used internally.
- Returns:
- a widget (a KURLLabel in this case) for the Article. This makes building a user-interface which contains the information in this Article object more convenient. The returned KURLLabel's caption will be the title(), clicking on it will emit the URL link(), and it has a QToolTip attached to it which displays the description() (in case it has one, if there is no description, the URL which the label links to will be used). Note that you have to delete the KURLLabel object returned by this method yourself.
Definition at line 264 of file article.cpp.
The documentation for this class was generated from the following files: