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

syndication/atom

  • Syndication
  • Atom
  • Content
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Syndication::Atom::Content Class Reference

#include <content.h>

Inherits ElementWrapper.

Public Types

enum  Format { PlainText, EscapedHTML, XML, Binary }
 

Public Member Functions

 Content ()
 
 Content (const QDomElement &element)
 
 Content (const Content &other)
 
 ~Content ()
 
QByteArray asByteArray () const
 
QString asString () const
 
QString debugInfo () const
 
Format format () const
 
bool isBinary () const
 
bool isContained () const
 
bool isEscapedHTML () const
 
bool isPlainText () const
 
bool isXML () const
 
Content & operator= (const Content &other)
 
QString src () const
 
QString type () const
 

Static Public Member Functions

static Format mapTypeToFormat (const QString &type, const QString &src=QString())
 

Detailed Description

The content element either contains or links the content of an entry.

The content is usually plain text or HTML, but arbitrary XML or binary content are also possible. If isContained() is false, the content is not contained in the feed source, but linked.

Author
Frank Osterfeld

Definition at line 46 of file content.h.

Member Enumeration Documentation

enum Syndication::Atom::Content::Format

format of the content.

Enumerator
PlainText 

the content is plain text (i.e.

"<", ">" etc. are text, not markup

EscapedHTML 

the content is escaped HTML, (i.e., "<", ">" etc.

are markup)

XML 

the content is embedded XML

Binary 

the content is base64-encoded binary content

Definition at line 53 of file content.h.

Constructor & Destructor Documentation

Syndication::Atom::Content::Content ( )

creates a null content object.

Definition at line 46 of file content.cpp.

Syndication::Atom::Content::Content ( const QDomElement &  element)
explicit

creates a Content object wrapping an atom:content element.

Parameters
elementa DOM element, should be a atom:content element (although not enforced), otherwise this object will not parse anything useful

Definition at line 50 of file content.cpp.

Syndication::Atom::Content::Content ( const Content &  other)

creates a copy of another Content object

Parameters
otherthe content object to copy

Definition at line 54 of file content.cpp.

Syndication::Atom::Content::~Content ( )

destructor

Definition at line 58 of file content.cpp.

Member Function Documentation

QByteArray Syndication::Atom::Content::asByteArray ( ) const

returns binary content as byte array.

Returns
byte array containing the embedded binary data, or an empty array if the content is not in binary format

Definition at line 79 of file content.cpp.

QString Syndication::Atom::Content::asString ( ) const

returns the content as string.

If the content format is Text, the returned string contains the text as HTML. If the content is embedded XML, the XML is returned as string.

Returns
a string representation of the content, or a null string if the content is either binary content or not contained but linked (see isContained())

Definition at line 165 of file content.cpp.

QString Syndication::Atom::Content::debugInfo ( ) const

returns a description of the content object for debugging purposes

Returns
debug string

Definition at line 185 of file content.cpp.

Content::Format Syndication::Atom::Content::format ( ) const

returns the content format

Definition at line 130 of file content.cpp.

bool Syndication::Atom::Content::isBinary ( ) const

returns whether the content is binary content or not.

Use asByteArray() to access it.

Definition at line 140 of file content.cpp.

bool Syndication::Atom::Content::isContained ( ) const

returns whether the content is contained in the feed source, or not.

If it is not contained, src() provides a URL to the content.

Definition at line 145 of file content.cpp.

bool Syndication::Atom::Content::isEscapedHTML ( ) const

returns whether the content is escaped HTML or not Use asString() to access it

Definition at line 155 of file content.cpp.

bool Syndication::Atom::Content::isPlainText ( ) const

returns whether the content is plain text or not.

Use asString() to access it.

Definition at line 150 of file content.cpp.

bool Syndication::Atom::Content::isXML ( ) const

returns whether the content is embedded XML.

Use element() to access the DOM tree, or asString() to get the XML as string.

Definition at line 160 of file content.cpp.

Content::Format Syndication::Atom::Content::mapTypeToFormat ( const QString &  type,
const QString &  src = QString() 
)
static

maps a mimetype to Format enum according to the Atom 1.0 specification

Parameters
typea valid mimetype, or one of "text", "html", "xhtml"
srccontent source, see src() for details.

Definition at line 90 of file content.cpp.

Content & Syndication::Atom::Content::operator= ( const Content &  other)

assigns another content objecct

Parameters
otherthe Content object to assign

Definition at line 62 of file content.cpp.

QString Syndication::Atom::Content::src ( ) const

If src() is set, the content of this entry is not contained in the feed source, but available on the net.

src() then contains a URL (more precise: IRI reference) linking to remote content. If src is provided, type() should contain a mimetype, instead of "text", "html" or "xhtml".

Returns
a null string if the content is contained in the feed source, or a URL linking to the remote content

Definition at line 74 of file content.cpp.

QString Syndication::Atom::Content::type ( ) const

the type of the content.

This is either "text" (plain text), "html" (escaped HTML), "xhtml" (embedded XHTML) or a mime type

Returns
the content type. If no type is specified, "text" (the default) is returned.

Definition at line 69 of file content.cpp.


The documentation for this class was generated from the following files:
  • content.h
  • content.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

syndication/atom

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

kdepimlibs API Reference

Skip menu "kdepimlibs 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

Search



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