• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

syndication/rss2

  • Syndication
  • RSS2
  • Item
Public Member Functions | List of all members
Syndication::RSS2::Item Class Reference

#include <item.h>

Inherits ElementWrapper, and SpecificItem.

Public Member Functions

 Item (boost::shared_ptr< Document > doc=boost::shared_ptr< Document >())
 
 Item (const QDomElement &element, boost::shared_ptr< Document > doc=boost::shared_ptr< Document >())
 
 Item (const Item &other)
 
 ~Item ()
 
bool accept (SpecificItemVisitor *visitor)
 
QString author () const
 
QList< Category > categories () const
 
QString comments () const
 
QString content () const
 
QString debugInfo () const
 
QString description () const
 
QList< Enclosure > enclosures () const
 
time_t expirationDate () const
 
QString guid () const
 
bool guidIsPermaLink () const
 
QString link () const
 
Item & operator= (const Item &other)
 
time_t pubDate () const
 
QString rating () const
 
Source source () const
 
QString title () const
 
QList< QDomElement > unhandledElements () const
 

Detailed Description

An Item, representing an entry in an RSS feed.

Author
Frank Osterfeld

Definition at line 52 of file item.h.

Constructor & Destructor Documentation

Syndication::RSS2::Item::Item ( boost::shared_ptr< Document >  doc = boost::shared_ptr<Document>())
explicit

Default constructor, creates a null object, for which isNull() is true.

Definition at line 47 of file item.cpp.

Syndication::RSS2::Item::Item ( const QDomElement &  element,
boost::shared_ptr< Document >  doc = boost::shared_ptr<Document>() 
)
explicit

Creates an Item object wrapping an <item> XML element.

Parameters
elementThe <item> element to wrap
docthe document this item is part of

Definition at line 52 of file item.cpp.

Syndication::RSS2::Item::Item ( const Item &  other)

creates a copy of an item.

As the d pointer is shared, this is a cheap operation.

Parameters
otherthe item to copy

Definition at line 61 of file item.cpp.

Syndication::RSS2::Item::~Item ( )

destructor

Definition at line 57 of file item.cpp.

Member Function Documentation

bool Syndication::RSS2::Item::accept ( SpecificItemVisitor *  visitor)

Used by visitors for double dispatch.

See SpecificItemVisitor for more information.

Parameters
visitorthe visitor calling the method

Definition at line 293 of file item.cpp.

QString Syndication::RSS2::Item::author ( ) const

The email address of the author of this item.

For newspapers and magazines syndicating via RSS, the author is the person who wrote the article that this item describes. For collaborative weblogs, the author of the item might be different from the managing editor or webmaster. This method returns the content of the <author> element. If <author> is not available, the method returns <dc:creator> instead, if available.

Returns
an email address of the author, or a null string if not specified

Definition at line 140 of file item.cpp.

QList< Category > Syndication::RSS2::Item::categories ( ) const

Set of categories this item is included in.

Returns
a list of categories, possibly empty.

Definition at line 120 of file item.cpp.

QString Syndication::RSS2::Item::comments ( ) const

URL of a page for comments relating to the item.

Returns
an URL to the comments, or a null string if not set

Definition at line 135 of file item.cpp.

QString Syndication::RSS2::Item::content ( ) const

Returns the actual content of the item.

In RSS2, this can be stored in various elements, e.g. in content:encoded, xhtml:body or xhtml:div. If this is not set, description() might also contain the content of the item.

Returns
the content in HTML format (whitespace is irrelevant, <br/> is used for newlines, "&", "&lt;", "&gt;" are escaped) If no content is specified, a null string is returned.

Definition at line 114 of file item.cpp.

QString Syndication::RSS2::Item::debugInfo ( ) const

Returns a description of the object and its children for debugging purposes.

Returns
debug string

Definition at line 224 of file item.cpp.

QString Syndication::RSS2::Item::description ( ) const

The item synopsis.

This might contain a short summary of the item, but also the full content. If content() is set, that usually contains the full content instead.

Returns
a string in HTML format (whitespace is irrelevant, <br/> is used for newlines, "&", "&lt;", "&gt;" are escaped) summarizing the item. A null string if no description was specified.

Definition at line 102 of file item.cpp.

QList< Enclosure > Syndication::RSS2::Item::enclosures ( ) const

Descriptions of media objects that are attached to the item.

Note that the RSS2 spec is a bit unclear about whether an item can have multiple enclosures or not. Originally it was not intended, but in reality, some tools out there specify multiple enclosures. So most of the time, this list be either empty or contains a single item, but don't take that for granted

Definition at line 156 of file item.cpp.

time_t Syndication::RSS2::Item::expirationDate ( ) const

expiration date, specifying a date when the item is not longer available.

Only available in RSS 0.93.

Returns
the expiration date, or 0 if no date was specified or parsing failed

Definition at line 208 of file item.cpp.

QString Syndication::RSS2::Item::guid ( ) const

"guid stands for globally unique identifier.

It's a string that uniquely identifies the item. When present, an aggregator may choose to use this string to determine if an item is new. There are no rules for the syntax of a guid. Aggregators must view them as a string. It's up to the source of the feed to establish the uniqueness of the string."

Returns
a guid string, or a null string if none specified in the feed

Definition at line 171 of file item.cpp.

bool Syndication::RSS2::Item::guidIsPermaLink ( ) const

If true, it can be assumed that the guid is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item.

Returns
true if the guid is a permalink and can be interpreted as URL

Definition at line 176 of file item.cpp.

QString Syndication::RSS2::Item::link ( ) const

The URL of the item.

This usually links to the web representation of the item, e.g. the full news article.

Returns
an URL, or a null string if not set

Definition at line 97 of file item.cpp.

Item & Syndication::RSS2::Item::operator= ( const Item &  other)

assigns another item.

As the d pointer is shared, this is a cheap operation.

Parameters
otherthe item to assign

Definition at line 66 of file item.cpp.

time_t Syndication::RSS2::Item::pubDate ( ) const

Indicates when the item was published.

If it's a date in the future, you may choose to not display the item until that date. This returns the content of the <pubDate> element. If <pubDate> is not available, the method returns <dc:date> instead, if available.

Returns
the publication date, or 0 if no date was specified or parsing failed

Definition at line 194 of file item.cpp.

QString Syndication::RSS2::Item::rating ( ) const

A Platform for Internet Content Selection (PICS) rating tag.

More information on the format of the rating tag can be found here: http://www.w3.org/PICS/

Returns
PICS rating information, or a null string if not specified

Definition at line 219 of file item.cpp.

Source Syndication::RSS2::Item::source ( ) const

The RSS channel that the item came from.

See Source class for more information.

Returns
a Source object, or a null object (see Source.isNull()) if not set.

Definition at line 214 of file item.cpp.

QString Syndication::RSS2::Item::title ( ) const

The title of the item.

Returns
The title in plain text. Note that e.g. characters like <, >, & are not escaped! (TODO: this might change, check what makes more sense)

Definition at line 74 of file item.cpp.

QList< QDomElement > Syndication::RSS2::Item::unhandledElements ( ) const

returns all child elements of this item not covered by this class.

You can use this to access additional metadata from RSS extensions.

Definition at line 261 of file item.cpp.


The documentation for this class was generated from the following files:
  • item.h
  • item.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:36 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

syndication/rss2

Skip menu "syndication/rss2"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Members
  • File List

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal