MythTV  master
Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
NewsSite Class Reference

#include <newssite.h>

Inheritance diagram for NewsSite:
Inheritance graph
[legend]
Collaboration diagram for NewsSite:
Collaboration graph
[legend]

Classes

class  List
 

Public Types

enum  State { Retrieving = 0, RetrieveFailed, WriteFailed, Success }
 

Signals

void finished (NewsSite *item)
 

Public Member Functions

 NewsSite (const QString &name, const QString &url, const QDateTime &updated, const bool podcast)
 
virtual void deleteLater ()
 
void customEvent (QEvent *event) override
 
QString url (void) const
 
QString name (void) const
 
QString sortName (void) const
 
QString description (void) const
 
QDateTime lastUpdated (void) const
 
QString imageURL (void) const
 
bool podcast (void) const
 
unsigned int timeSinceLastUpdate (void) const
 
void insertNewsArticle (const NewsArticle &item)
 
void clearNewsArticles (void)
 
NewsArticle::List GetArticleList (void) const
 
void retrieve (void)
 
void stop (void)
 
void process (void)
 
void parseRSS (const QDomDocument &domDoc)
 
void parseAtom (const QDomDocument &domDoc)
 
bool successful (void) const
 
QString errorMsg (void) const
 

Static Public Member Functions

static bool sortByName (NewsSite *a, NewsSite *b)
 

Private Member Functions

 ~NewsSite ()
 

Static Private Member Functions

static QString ReplaceHtmlChar (const QString &orig)
 

Private Attributes

QMutex m_lock {QMutex::Recursive}
 
QString m_name
 
QString m_sortName
 
QString m_url
 
QUrl m_urlReq
 
QString m_desc
 
QDateTime m_updated
 
QString m_destDir
 
QByteArray m_data
 
State m_state {NewsSite::Success}
 
QString m_errorString
 
QString m_updateErrorString
 
QString m_imageURL
 
bool m_podcast
 
NewsArticle::List m_articleList
 

Detailed Description

Definition at line 52 of file newssite.h.

Member Enumeration Documentation

◆ State

Enumerator
Retrieving 
RetrieveFailed 
WriteFailed 
Success 

Definition at line 58 of file newssite.h.

Constructor & Destructor Documentation

◆ NewsSite()

NewsSite::NewsSite ( const QString &  name,
const QString &  url,
const QDateTime &  updated,
const bool  podcast 
)

Definition at line 19 of file newssite.cpp.

◆ ~NewsSite()

NewsSite::~NewsSite ( )
private

Definition at line 41 of file newssite.cpp.

Member Function Documentation

◆ deleteLater()

void NewsSite::deleteLater ( void  )
virtual

Definition at line 32 of file newssite.cpp.

◆ customEvent()

void NewsSite::customEvent ( QEvent *  event)
override

Definition at line 157 of file newssite.cpp.

◆ url()

QString NewsSite::url ( void  ) const

Definition at line 92 of file newssite.cpp.

Referenced by MythNewsEditor::Create(), parseAtom(), and parseRSS().

◆ name()

QString NewsSite::name ( void  ) const

◆ sortName()

QString NewsSite::sortName ( void  ) const

Definition at line 104 of file newssite.cpp.

◆ description()

QString NewsSite::description ( void  ) const

Definition at line 116 of file newssite.cpp.

Referenced by parseAtom(), parseRSS(), and MythNews::updateInfoView().

◆ lastUpdated()

QDateTime NewsSite::lastUpdated ( void  ) const

Definition at line 142 of file newssite.cpp.

Referenced by MythNews::slotNewsRetrieved(), and MythNews::updateInfoView().

◆ imageURL()

QString NewsSite::imageURL ( void  ) const

Definition at line 130 of file newssite.cpp.

Referenced by MythNewsEditor::Create(), and MythNews::updateInfoView().

◆ podcast()

bool NewsSite::podcast ( void  ) const

Definition at line 110 of file newssite.cpp.

Referenced by MythNewsEditor::Create(), and MythNews::updateInfoView().

◆ timeSinceLastUpdate()

unsigned int NewsSite::timeSinceLastUpdate ( void  ) const

Definition at line 148 of file newssite.cpp.

◆ insertNewsArticle()

void NewsSite::insertNewsArticle ( const NewsArticle item)

Definition at line 48 of file newssite.cpp.

Referenced by parseAtom(), parseRSS(), and process().

◆ clearNewsArticles()

void NewsSite::clearNewsArticles ( void  )

Definition at line 54 of file newssite.cpp.

◆ GetArticleList()

NewsArticle::List NewsSite::GetArticleList ( void  ) const

Definition at line 136 of file newssite.cpp.

Referenced by MythNews::processAndShowNews(), and MythNews::slotSiteSelected().

◆ retrieve()

void NewsSite::retrieve ( void  )

Definition at line 60 of file newssite.cpp.

◆ stop()

void NewsSite::stop ( void  )

Definition at line 73 of file newssite.cpp.

Referenced by retrieve().

◆ process()

void NewsSite::process ( void  )

Definition at line 220 of file newssite.cpp.

Referenced by MythNews::processAndShowNews().

◆ parseRSS()

void NewsSite::parseRSS ( const QDomDocument &  domDoc)

Definition at line 300 of file newssite.cpp.

Referenced by process().

◆ parseAtom()

void NewsSite::parseAtom ( const QDomDocument &  domDoc)

Definition at line 456 of file newssite.cpp.

Referenced by process().

◆ sortByName()

static bool NewsSite::sortByName ( NewsSite a,
NewsSite b 
)
inlinestatic

Definition at line 104 of file newssite.h.

Referenced by MythNews::loadSites().

◆ successful()

bool NewsSite::successful ( void  ) const

Definition at line 80 of file newssite.cpp.

◆ errorMsg()

QString NewsSite::errorMsg ( void  ) const

Definition at line 86 of file newssite.cpp.

◆ ReplaceHtmlChar()

QString NewsSite::ReplaceHtmlChar ( const QString &  orig)
staticprivate

Definition at line 487 of file newssite.cpp.

Referenced by parseAtom(), and parseRSS().

◆ finished

void NewsSite::finished ( NewsSite item)
signal

Referenced by customEvent().

Member Data Documentation

◆ m_lock

QMutex NewsSite::m_lock {QMutex::Recursive}
mutableprivate

◆ m_name

QString NewsSite::m_name
private

Definition at line 114 of file newssite.h.

Referenced by customEvent(), name(), NewsSite(), process(), and retrieve().

◆ m_sortName

QString NewsSite::m_sortName
private

Definition at line 115 of file newssite.h.

Referenced by NewsSite(), sortByName(), and sortName().

◆ m_url

QString NewsSite::m_url
private

Definition at line 116 of file newssite.h.

Referenced by deleteLater(), retrieve(), stop(), url(), and ~NewsSite().

◆ m_urlReq

QUrl NewsSite::m_urlReq
private

Definition at line 117 of file newssite.h.

◆ m_desc

QString NewsSite::m_desc
private

Definition at line 118 of file newssite.h.

Referenced by description(), and parseRSS().

◆ m_updated

QDateTime NewsSite::m_updated
private

Definition at line 119 of file newssite.h.

Referenced by customEvent(), lastUpdated(), and timeSinceLastUpdate().

◆ m_destDir

QString NewsSite::m_destDir
private

Definition at line 120 of file newssite.h.

Referenced by process(), and retrieve().

◆ m_data

QByteArray NewsSite::m_data
private

Definition at line 121 of file newssite.h.

◆ m_state

State NewsSite::m_state {NewsSite::Success}
private

Definition at line 122 of file newssite.h.

Referenced by customEvent(), process(), retrieve(), and successful().

◆ m_errorString

QString NewsSite::m_errorString
private

Definition at line 123 of file newssite.h.

Referenced by description(), errorMsg(), process(), and retrieve().

◆ m_updateErrorString

QString NewsSite::m_updateErrorString
private

Definition at line 124 of file newssite.h.

Referenced by customEvent(), process(), and retrieve().

◆ m_imageURL

QString NewsSite::m_imageURL
private

Definition at line 125 of file newssite.h.

Referenced by imageURL(), and parseRSS().

◆ m_podcast

bool NewsSite::m_podcast
private

Definition at line 126 of file newssite.h.

Referenced by podcast().

◆ m_articleList

NewsArticle::List NewsSite::m_articleList
private

The documentation for this class was generated from the following files: