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 <mythplugins/mythnews/mythnews/newssite.h>

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

Classes

class  List
 

Public Types

enum  State : std::uint8_t { Retrieving = 0, RetrieveFailed, WriteFailed, Success }
 

Signals

void finished (NewsSite *item)
 

Public Member Functions

 NewsSite (QString name, const QString &url, QDateTime updated, 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
 
std::chrono::minutes 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 () override
 

Static Private Member Functions

static QString ReplaceHtmlChar (const QString &orig)
 

Private Attributes

QRecursiveMutex m_lock
 
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 50 of file newssite.h.

Member Enumeration Documentation

◆ State

enum NewsSite::State : std::uint8_t
Enumerator
Retrieving 
RetrieveFailed 
WriteFailed 
Success 

Definition at line 56 of file newssite.h.

Constructor & Destructor Documentation

◆ NewsSite()

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

Definition at line 19 of file newssite.cpp.

◆ ~NewsSite()

NewsSite::~NewsSite ( )
overrideprivate

Definition at line 39 of file newssite.cpp.

Member Function Documentation

◆ deleteLater()

void NewsSite::deleteLater ( )
virtual

Definition at line 30 of file newssite.cpp.

◆ customEvent()

void NewsSite::customEvent ( QEvent *  event)
override

Definition at line 155 of file newssite.cpp.

◆ url()

QString NewsSite::url ( void  ) const

Definition at line 90 of file newssite.cpp.

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

◆ name()

QString NewsSite::name ( void  ) const

◆ sortName()

QString NewsSite::sortName ( void  ) const

Definition at line 102 of file newssite.cpp.

◆ description()

QString NewsSite::description ( void  ) const

Definition at line 114 of file newssite.cpp.

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

◆ lastUpdated()

QDateTime NewsSite::lastUpdated ( void  ) const

Definition at line 140 of file newssite.cpp.

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

◆ imageURL()

QString NewsSite::imageURL ( void  ) const

Definition at line 128 of file newssite.cpp.

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

◆ podcast()

bool NewsSite::podcast ( void  ) const

Definition at line 108 of file newssite.cpp.

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

◆ timeSinceLastUpdate()

std::chrono::minutes NewsSite::timeSinceLastUpdate ( void  ) const

Definition at line 146 of file newssite.cpp.

◆ insertNewsArticle()

void NewsSite::insertNewsArticle ( const NewsArticle item)

Definition at line 46 of file newssite.cpp.

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

◆ clearNewsArticles()

void NewsSite::clearNewsArticles ( void  )

Definition at line 52 of file newssite.cpp.

◆ GetArticleList()

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

Definition at line 134 of file newssite.cpp.

Referenced by MythNews::processAndShowNews().

◆ retrieve()

void NewsSite::retrieve ( void  )

Definition at line 58 of file newssite.cpp.

◆ stop()

void NewsSite::stop ( void  )

Definition at line 71 of file newssite.cpp.

Referenced by retrieve().

◆ process()

void NewsSite::process ( void  )

Definition at line 221 of file newssite.cpp.

Referenced by MythNews::processAndShowNews().

◆ parseRSS()

void NewsSite::parseRSS ( const QDomDocument &  domDoc)

Definition at line 301 of file newssite.cpp.

Referenced by process().

◆ parseAtom()

void NewsSite::parseAtom ( const QDomDocument &  domDoc)

Definition at line 457 of file newssite.cpp.

Referenced by process().

◆ sortByName()

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

Definition at line 102 of file newssite.h.

Referenced by MythNews::loadSites().

◆ successful()

bool NewsSite::successful ( void  ) const

Definition at line 78 of file newssite.cpp.

◆ errorMsg()

QString NewsSite::errorMsg ( void  ) const

Definition at line 84 of file newssite.cpp.

◆ ReplaceHtmlChar()

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

Definition at line 488 of file newssite.cpp.

Referenced by parseAtom(), and parseRSS().

◆ finished

void NewsSite::finished ( NewsSite item)
signal

Referenced by customEvent(), and MythNews::loadSites().

Member Data Documentation

◆ m_lock

QRecursiveMutex NewsSite::m_lock
mutableprivate

◆ m_name

QString NewsSite::m_name
private

Definition at line 112 of file newssite.h.

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

◆ m_sortName

QString NewsSite::m_sortName
private

Definition at line 113 of file newssite.h.

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

◆ m_url

QString NewsSite::m_url
private

Definition at line 114 of file newssite.h.

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

◆ m_urlReq

QUrl NewsSite::m_urlReq
private

Definition at line 115 of file newssite.h.

◆ m_desc

QString NewsSite::m_desc
private

Definition at line 116 of file newssite.h.

Referenced by description(), and parseRSS().

◆ m_updated

QDateTime NewsSite::m_updated
private

Definition at line 117 of file newssite.h.

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

◆ m_destDir

QString NewsSite::m_destDir
private

Definition at line 118 of file newssite.h.

Referenced by process(), and retrieve().

◆ m_data

QByteArray NewsSite::m_data
private

Definition at line 119 of file newssite.h.

◆ m_state

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

Definition at line 120 of file newssite.h.

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

◆ m_errorString

QString NewsSite::m_errorString
private

Definition at line 121 of file newssite.h.

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

◆ m_updateErrorString

QString NewsSite::m_updateErrorString
private

Definition at line 122 of file newssite.h.

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

◆ m_imageURL

QString NewsSite::m_imageURL
private

Definition at line 123 of file newssite.h.

Referenced by imageURL(), and parseRSS().

◆ m_podcast

bool NewsSite::m_podcast
private

Definition at line 124 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: