akregator/src/librss

RSS::Article Class Reference

#include <article.h>

Public Types

typedef TQValueList< ArticleList
 
typedef TQMap< TQString, TQString > MetaInfoMap
 

Public Member Functions

 Article ()
 
 Article (const Article &other)
 
 Article (const TQDomNode &node, Format format, Version version)
 
Articleoperator= (const Article &other)
 
bool operator== (const Article &other) const
 
bool operator!= (const Article &other) const
 
virtual ~Article ()
 
TQString title () const
 
const KURL & link () const
 
TQString description () const
 
TQString author () const
 
TQString guid () const
 
bool guidIsPermaLink () const
 
const TQDateTime & pubDate () const
 
const KURL & commentsLink () const
 
int comments () const
 
Enclosure enclosure () const
 
TQValueList< Category > categories () const
 
TQString meta (const TQString &key) const
 
KURLLabel * widget (TQWidget *parent=0, const char *name=0) const
 

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.

Member Typedef Documentation

◆ List

typedef TQValueList<Article> RSS::Article::List

A list of articles.

Definition at line 43 of file article.h.

Constructor & Destructor Documentation

◆ Article() [1/3]

Article::Article ( )

Default constructor.

Definition at line 47 of file article.cpp.

◆ Article() [2/3]

Article::Article ( const Article other)

Copy constructor.

Parameters
otherThe Article object to copy.

Definition at line 51 of file article.cpp.

◆ Article() [3/3]

Article::Article ( const TQDomNode &  node,
Format  format,
Version  version 
)

Constructs an Article from a piece of RSS markup.

Parameters
nodeA TQDomNode which references the DOM leaf to be used for constructing the Article.

Definition at line 67 of file article.cpp.

◆ ~Article()

Article::~Article ( )
virtual

Destructor.

Definition at line 207 of file article.cpp.

Member Function Documentation

◆ author()

TQString Article::author ( ) const

a string desribing the author of the item.

Definition at line 218 of file article.cpp.

◆ categories()

TQValueList< 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.

◆ description()

TQString Article::description ( ) const

RSS 0.91 and upwards.

Returns
A story synopsis, or TQString() if no description was available.

Definition at line 228 of file article.cpp.

◆ guid()

TQString Article::guid ( ) const

RSS 2.0 and upwards.

Returns
An article GUID (globally unique identifier).

Definition at line 233 of file article.cpp.

◆ guidIsPermaLink()

bool Article::guidIsPermaLink ( ) const

RSS 2.0 and upwards.

Returns
If this article GUID is permalink. Has no meaning when guid() is TQString().

Definition at line 238 of file article.cpp.

◆ link()

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.

◆ operator!=()

bool RSS::Article::operator!= ( const Article other) const
inline

Convenience method.

Simply calls !operator==().

Parameters
otherThe article this article should be compared with.
Returns
Whether the two articles are unequal.

Definition at line 84 of file article.h.

◆ operator=()

Article & Article::operator= ( const Article other)

Assignment operator.

Parameters
otherThe Article object to clone.
Returns
A reference to the cloned Article object.

Definition at line 274 of file article.cpp.

◆ operator==()

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
otherThe article this article should be compared with.
Returns
Whether the two articles are equal.

Definition at line 285 of file article.cpp.

◆ pubDate()

const TQDateTime & Article::pubDate ( ) const

RSS 2.0 and upwards.

Returns
The date when the article was published.

Definition at line 243 of file article.cpp.

◆ title()

TQString Article::title ( ) const

RSS 0.90 and upwards.

Returns
The headline of this article, or TQString() if no headline was available.

Definition at line 213 of file article.cpp.

◆ widget()

KURLLabel * Article::widget ( TQWidget *  parent = 0,
const char *  name = 0 
) const
Parameters
parentThe parent widget for the KURLLabel.
nameA 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 TQToolTip 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: