Syndication::RSS2::Document

#include <document.h>

Inheritance diagram for Syndication::RSS2::Document:

Public Types

enum  DayOfWeek {
  Monday = 0, Tuesday = 1, Wednesday = 2, Thursday = 3,
  Friday = 4, Saturday = 5, Sunday = 6
}
 

Public Member Functions

 Document ()
 
 Document (const Document &other)
 
 Document (const QDomElement &element)
 
 ~Document () override
 
bool accept (DocumentVisitor *visitor) override
 
QList< Categorycategories () const
 
Cloud cloud () const
 
QString copyright () const
 
QString debugInfo () const override
 
QString description () const
 
QString docs () const
 
QString generator () const
 
Image image () const
 
bool isValid () const override
 
QList< Itemitems () const
 
QString language () const
 
time_t lastBuildDate () const
 
QString link () const
 
QString managingEditor () const
 
Documentoperator= (const Document &other)
 
time_t pubDate () const
 
QSet< DayOfWeekskipDays () const
 
QSet< int > skipHours () const
 
TextInput textInput () const
 
QString title () const
 
int ttl () const
 
QList< QDomElementunhandledElements () const
 
QString webMaster () const
 
- Public Member Functions inherited from Syndication::SpecificDocument
virtual ~SpecificDocument ()
 
- Public Member Functions inherited from Syndication::ElementWrapper
 ElementWrapper ()
 
 ElementWrapper (const ElementWrapper &other)
 
 ElementWrapper (const QDomElement &element)
 
virtual ~ElementWrapper ()
 
QString attribute (const QString &name, const QString &defValue=QString()) const
 
QString attributeNS (const QString &nsURI, const QString &localName, const QString &defValue=QString()) const
 
QString childNodesAsXML () const
 
QString completeURI (const QString &uri) const
 
const QDomElementelement () const
 
QList< QDomElementelementsByTagName (const QString &tagName) const
 
QList< QDomElementelementsByTagNameNS (const QString &nsURI, const QString &tagName) const
 
QString extractElementText (const QString &tagName) const
 
QString extractElementTextNS (const QString &namespaceURI, const QString &localName) const
 
QDomElement firstElementByTagNameNS (const QString &nsURI, const QString &tagName) const
 
bool hasAttribute (const QString &name) const
 
bool hasAttributeNS (const QString &nsURI, const QString &localName) const
 
bool isNull () const
 
ElementWrapperoperator= (const ElementWrapper &other)
 
bool operator== (const ElementWrapper &other) const
 
QString text () const
 
QString xmlBase () const
 
QString xmlLang () const
 

Static Public Member Functions

static Document fromXML (const QDomDocument &document)
 
- Static Public Member Functions inherited from Syndication::ElementWrapper
static QString childNodesAsXML (const QDomElement &parent)
 

Public Attributes

QSharedPointer< DocumentPrivate > d
 

Detailed Description

document implementation, representing an RSS feed from the 0.91-0.94/2.0 family.

Author
Frank Osterfeld

Definition at line 57 of file rss2/document.h.

Member Enumeration Documentation

days of week, used for skip days

Enumerator
Monday 

self-explanatory

Tuesday 

self-explanatory

Wednesday 

self-explanatory

Thursday 

self-explanatory

Friday 

self-explanatory

Saturday 

self-explanatory

Sunday 

self-explanatory

Definition at line 255 of file rss2/document.h.

Constructor & Destructor Documentation

Syndication::RSS2::Document::Document ( )

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

Definition at line 77 of file rss2/document.cpp.

Syndication::RSS2::Document::Document ( const Document other)

copy constructor

Definition at line 81 of file rss2/document.cpp.

Syndication::RSS2::Document::~Document ( )
override

destructor

Definition at line 86 of file rss2/document.cpp.

Syndication::RSS2::Document::Document ( const QDomElement element)
explicit

private: /**

private constructor, used by fromXML() TODO: remove fromXML(), make this one private

Definition at line 64 of file rss2/document.cpp.

Member Function Documentation

bool Syndication::RSS2::Document::accept ( DocumentVisitor visitor)
overridevirtual

Used by visitors for double dispatch.

See DocumentVisitor for more information.

Parameters
visitorthe visitor calling the method

Implements Syndication::SpecificDocument.

Definition at line 480 of file rss2/document.cpp.

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

Specifies one or more categories that the channel belongs to.

Returns
TODO

Definition at line 174 of file rss2/document.cpp.

Cloud Syndication::RSS2::Document::cloud ( ) const

Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds.

Returns
cloud information, or a null object if not set

Definition at line 200 of file rss2/document.cpp.

QString Syndication::RSS2::Document::copyright ( ) const

Copyright notice for content in the channel.

This method returns the content of the <copyright> element. If <copyright> is not available, the method returns <dc:rights> instead, if available.

Returns
copyright information, or a null string if not set

Definition at line 131 of file rss2/document.cpp.

QString Syndication::RSS2::Document::debugInfo ( ) const
overridevirtual

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

Returns
debug string

Implements Syndication::SpecificDocument.

Definition at line 345 of file rss2/document.cpp.

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

Phrase or sentence describing the channel.

Returns
TODO

Definition at line 111 of file rss2/document.cpp.

QString Syndication::RSS2::Document::docs ( ) const

A URL that points to the documentation for the format used in the RSS file.

It's probably a pointer to the RSS specification. It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is.

Returns
URL pointing to the format specification, or a null string if not set

Definition at line 195 of file rss2/document.cpp.

Document Syndication::RSS2::Document::fromXML ( const QDomDocument document)
static

Parses an RSS2 document from an XML document.

TODO: More on supported formats etc.

Parameters
documentThe dom document to parse the document from
Returns
the document parsed from XML, or an invalid document if parsing failed.

Definition at line 70 of file rss2/document.cpp.

QString Syndication::RSS2::Document::generator ( ) const

A string indicating the program used to generate the channel.

Returns
description of the generator program, or a null string if not set

Definition at line 190 of file rss2/document.cpp.

Image Syndication::RSS2::Document::image ( ) const

Specifies a GIF, JPEG or PNG image that can be displayed with the channel.

Returns
the image, or a null object if not set

Definition at line 215 of file rss2/document.cpp.

bool Syndication::RSS2::Document::isValid ( ) const
overridevirtual

returns whether this document is valid or not.

Invalid documents do not contain any useful information.

Implements Syndication::SpecificDocument.

Definition at line 96 of file rss2/document.cpp.

QList< Item > Syndication::RSS2::Document::items ( ) const

the items contained in this document

Definition at line 284 of file rss2/document.cpp.

QString Syndication::RSS2::Document::language ( ) const
Returns
TODO

Definition at line 117 of file rss2/document.cpp.

time_t Syndication::RSS2::Document::lastBuildDate ( ) const

The last time the content of the channel changed.

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

Definition at line 167 of file rss2/document.cpp.

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

The URL to the HTML website corresponding to the channel.

Returns
TODO

Definition at line 106 of file rss2/document.cpp.

QString Syndication::RSS2::Document::managingEditor ( ) const

Email address for person responsible for editorial content.

Returns
editor's email address, or a null string if not set

Definition at line 144 of file rss2/document.cpp.

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

assigns another document.

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

Parameters
otherthe document to assign

Definition at line 90 of file rss2/document.cpp.

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

The publication date for the content in the channel.

For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes. This method 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 154 of file rss2/document.cpp.

QSet< Document::DayOfWeek > Syndication::RSS2::Document::skipDays ( ) const

A set of week days where aggregators shouldn't read the channel.

Definition at line 256 of file rss2/document.cpp.

QSet< int > Syndication::RSS2::Document::skipHours ( ) const

Contains a set of hours (from 0 to 23), time in GMT, when the channel is not updated.

Definition at line 232 of file rss2/document.cpp.

TextInput Syndication::RSS2::Document::textInput ( ) const

Specifies a text input box that can be displayed with the channel.

Returns
the text input, or a null object if not set

Definition at line 220 of file rss2/document.cpp.

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

The title of the channel.

Returns
title TODO: more on escaping/HTML

Definition at line 101 of file rss2/document.cpp.

int Syndication::RSS2::Document::ttl ( ) const

ttl stands for time to live.

It's a number of minutes that indicates how long a channel can be cached before refreshing from the source.

Returns
the "time to live" in minutes, or 0 if not set

Definition at line 205 of file rss2/document.cpp.

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

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

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

Definition at line 300 of file rss2/document.cpp.

QString Syndication::RSS2::Document::webMaster ( ) const

Email address for person responsible for technical issues relating to channel.

Returns
web master's email address, or a null string if not

Definition at line 149 of file rss2/document.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 23:01:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.