QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
QgsNewsFeedParser Class Reference

Parser for published QGIS news feeds. More...

#include <qgsnewsfeedparser.h>

Inheritance diagram for QgsNewsFeedParser:
Inheritance graph
[legend]

Classes

class  Entry
 Represents a single entry from a news feed. More...
 

Public Slots

void fetch ()
 Fetches new entries from the feed's URL.
 

Signals

void entryAdded (const QgsNewsFeedParser::Entry &entry)
 Emitted whenever a new entry is available from the feed (as a result of a call to fetch()).
 
void entryDismissed (const QgsNewsFeedParser::Entry &entry)
 Emitted whenever an entry is dismissed (as a result of a call to dismissEntry()).
 
void entryUpdated (const QgsNewsFeedParser::Entry &entry)
 Emitted whenever an existing entry is available from the feed (as a result of a call to fetch()).
 
void fetched (const QList< QgsNewsFeedParser::Entry > &entries)
 Emitted when entries have been fetched from the feed.
 
void imageFetched (int key, const QPixmap &pixmap)
 Emitted when the image attached to the entry with the specified key has been fetched and is now available.
 

Public Member Functions

 QgsNewsFeedParser (const QUrl &feedUrl, const QString &authcfg=QString(), QObject *parent=nullptr)
 Constructor for QgsNewsFeedParser, parsing the specified feedUrl.
 
QString authcfg () const
 Returns the authentication configuration for the parser.
 
void dismissAll ()
 Dismisses all current news items.
 
void dismissEntry (int key)
 Dismisses an entry with matching key.
 
QList< QgsNewsFeedParser::Entryentries () const
 Returns a list of existing entries in the feed.
 

Static Public Member Functions

static QString keyForFeed (const QString &baseUrl)
 Returns the settings key used for a feed with the given baseUrl.
 

Static Public Attributes

static const QgsSettingsEntryStringsettingsFeedEntryContent = new QgsSettingsEntryString( QStringLiteral( "content" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry content" ) )
 
static const QgsSettingsEntryVariantsettingsFeedEntryExpiry = new QgsSettingsEntryVariant( QStringLiteral( "expiry" ), sTreeNewsFeedEntries, QVariant(), QStringLiteral( "Expiry date" ) )
 
static const QgsSettingsEntryStringsettingsFeedEntryImageUrl = new QgsSettingsEntryString( QStringLiteral( "image-url" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry image URL" ) )
 
static const QgsSettingsEntryStringsettingsFeedEntryLink = new QgsSettingsEntryString( QStringLiteral( "link" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry link" ) )
 
static const QgsSettingsEntryBoolsettingsFeedEntrySticky = new QgsSettingsEntryBool( QStringLiteral( "sticky" ), sTreeNewsFeedEntries, false )
 
static const QgsSettingsEntryStringsettingsFeedEntryTitle = new QgsSettingsEntryString( QStringLiteral( "title" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry title" ) )
 
static const QgsSettingsEntryStringsettingsFeedLanguage = new QgsSettingsEntryString( QStringLiteral( "lang" ), sTreeNewsFeed, QString(), QStringLiteral( "Feed language" ) )
 
static const QgsSettingsEntryInteger64settingsFeedLastFetchTime = new QgsSettingsEntryInteger64( QStringLiteral( "last-fetch-time" ), sTreeNewsFeed, 0, QStringLiteral( "Feed last fetch time" ), Qgis::SettingsOptions(), 0 )
 
static const QgsSettingsEntryDoublesettingsFeedLatitude = new QgsSettingsEntryDouble( QStringLiteral( "latitude" ), sTreeNewsFeed, 0.0, QStringLiteral( "Feed latitude" ) )
 
static const QgsSettingsEntryDoublesettingsFeedLongitude = new QgsSettingsEntryDouble( QStringLiteral( "longitude" ), sTreeNewsFeed, 0.0, QStringLiteral( "Feed longitude" ) )
 
static QgsSettingsTreeNamedListNodesTreeNewsFeed = QgsSettingsTree::sTreeApp->createNamedListNode( QStringLiteral( "news-feed" ) )
 
static QgsSettingsTreeNamedListNodesTreeNewsFeedEntries = sTreeNewsFeed->createNamedListNode( QStringLiteral( "entries" ) )
 

Friends

class TestQgsNewsFeedParser
 

Detailed Description

Parser for published QGIS news feeds.

This class is designed to work with the specialized QGIS news feed API. See https://github.com/elpaso/qgis-feed.

Since
QGIS 3.10

Definition at line 44 of file qgsnewsfeedparser.h.

Constructor & Destructor Documentation

◆ QgsNewsFeedParser()

QgsNewsFeedParser::QgsNewsFeedParser ( const QUrl &  feedUrl,
const QString &  authcfg = QString(),
QObject *  parent = nullptr 
)

Constructor for QgsNewsFeedParser, parsing the specified feedUrl.

The optional authcfg argument can be used to specify an authentication configuration to use when connecting to the feed.

Definition at line 49 of file qgsnewsfeedparser.cpp.

Member Function Documentation

◆ authcfg()

QString QgsNewsFeedParser::authcfg ( ) const

Returns the authentication configuration for the parser.

Definition at line 151 of file qgsnewsfeedparser.cpp.

◆ dismissAll()

void QgsNewsFeedParser::dismissAll ( )

Dismisses all current news items.

See also
dismissEntry()

Definition at line 142 of file qgsnewsfeedparser.cpp.

◆ dismissEntry()

void QgsNewsFeedParser::dismissEntry ( int  key)

Dismisses an entry with matching key.

This removes the entry from the local store, ensuring it will never be present again.

See also
dismissAll()

Definition at line 108 of file qgsnewsfeedparser.cpp.

◆ entries()

QList< QgsNewsFeedParser::Entry > QgsNewsFeedParser::entries ( ) const

Returns a list of existing entries in the feed.

Definition at line 103 of file qgsnewsfeedparser.cpp.

◆ entryAdded

void QgsNewsFeedParser::entryAdded ( const QgsNewsFeedParser::Entry entry)
signal

Emitted whenever a new entry is available from the feed (as a result of a call to fetch()).

See also
fetch()

◆ entryDismissed

void QgsNewsFeedParser::entryDismissed ( const QgsNewsFeedParser::Entry entry)
signal

Emitted whenever an entry is dismissed (as a result of a call to dismissEntry()).

See also
dismissEntry()

◆ entryUpdated

void QgsNewsFeedParser::entryUpdated ( const QgsNewsFeedParser::Entry entry)
signal

Emitted whenever an existing entry is available from the feed (as a result of a call to fetch()).

See also
fetch()
Since
QGIS 3.36

◆ fetch

void QgsNewsFeedParser::fetch ( )
slot

Fetches new entries from the feed's URL.

See also
fetched()

Definition at line 156 of file qgsnewsfeedparser.cpp.

◆ fetched

void QgsNewsFeedParser::fetched ( const QList< QgsNewsFeedParser::Entry > &  entries)
signal

Emitted when entries have been fetched from the feed.

See also
fetch()

◆ imageFetched

void QgsNewsFeedParser::imageFetched ( int  key,
const QPixmap &  pixmap 
)
signal

Emitted when the image attached to the entry with the specified key has been fetched and is now available.

◆ keyForFeed()

QString QgsNewsFeedParser::keyForFeed ( const QString &  baseUrl)
static

Returns the settings key used for a feed with the given baseUrl.

Definition at line 385 of file qgsnewsfeedparser.cpp.

Friends And Related Symbol Documentation

◆ TestQgsNewsFeedParser

friend class TestQgsNewsFeedParser
friend

Definition at line 206 of file qgsnewsfeedparser.h.

Member Data Documentation

◆ settingsFeedEntryContent

const QgsSettingsEntryString * QgsNewsFeedParser::settingsFeedEntryContent = new QgsSettingsEntryString( QStringLiteral( "content" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry content" ) )
static

Definition at line 59 of file qgsnewsfeedparser.h.

◆ settingsFeedEntryExpiry

const QgsSettingsEntryVariant * QgsNewsFeedParser::settingsFeedEntryExpiry = new QgsSettingsEntryVariant( QStringLiteral( "expiry" ), sTreeNewsFeedEntries, QVariant(), QStringLiteral( "Expiry date" ) )
static

Definition at line 62 of file qgsnewsfeedparser.h.

◆ settingsFeedEntryImageUrl

const QgsSettingsEntryString * QgsNewsFeedParser::settingsFeedEntryImageUrl = new QgsSettingsEntryString( QStringLiteral( "image-url" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry image URL" ) )
static

Definition at line 58 of file qgsnewsfeedparser.h.

◆ settingsFeedEntryLink

const QgsSettingsEntryString * QgsNewsFeedParser::settingsFeedEntryLink = new QgsSettingsEntryString( QStringLiteral( "link" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry link" ) )
static

Definition at line 60 of file qgsnewsfeedparser.h.

◆ settingsFeedEntrySticky

const QgsSettingsEntryBool * QgsNewsFeedParser::settingsFeedEntrySticky = new QgsSettingsEntryBool( QStringLiteral( "sticky" ), sTreeNewsFeedEntries, false )
static

Definition at line 61 of file qgsnewsfeedparser.h.

◆ settingsFeedEntryTitle

const QgsSettingsEntryString * QgsNewsFeedParser::settingsFeedEntryTitle = new QgsSettingsEntryString( QStringLiteral( "title" ), sTreeNewsFeedEntries, QString(), QStringLiteral( "Entry title" ) )
static

Definition at line 57 of file qgsnewsfeedparser.h.

◆ settingsFeedLanguage

const QgsSettingsEntryString * QgsNewsFeedParser::settingsFeedLanguage = new QgsSettingsEntryString( QStringLiteral( "lang" ), sTreeNewsFeed, QString(), QStringLiteral( "Feed language" ) )
static

Definition at line 52 of file qgsnewsfeedparser.h.

◆ settingsFeedLastFetchTime

const QgsSettingsEntryInteger64 * QgsNewsFeedParser::settingsFeedLastFetchTime = new QgsSettingsEntryInteger64( QStringLiteral( "last-fetch-time" ), sTreeNewsFeed, 0, QStringLiteral( "Feed last fetch time" ), Qgis::SettingsOptions(), 0 )
static

Definition at line 51 of file qgsnewsfeedparser.h.

◆ settingsFeedLatitude

const QgsSettingsEntryDouble * QgsNewsFeedParser::settingsFeedLatitude = new QgsSettingsEntryDouble( QStringLiteral( "latitude" ), sTreeNewsFeed, 0.0, QStringLiteral( "Feed latitude" ) )
static

Definition at line 53 of file qgsnewsfeedparser.h.

◆ settingsFeedLongitude

const QgsSettingsEntryDouble * QgsNewsFeedParser::settingsFeedLongitude = new QgsSettingsEntryDouble( QStringLiteral( "longitude" ), sTreeNewsFeed, 0.0, QStringLiteral( "Feed longitude" ) )
static

Definition at line 54 of file qgsnewsfeedparser.h.

◆ sTreeNewsFeed

QgsSettingsTreeNamedListNode* QgsNewsFeedParser::sTreeNewsFeed = QgsSettingsTree::sTreeApp->createNamedListNode( QStringLiteral( "news-feed" ) )
inlinestatic

Definition at line 50 of file qgsnewsfeedparser.h.

◆ sTreeNewsFeedEntries

QgsSettingsTreeNamedListNode* QgsNewsFeedParser::sTreeNewsFeedEntries = sTreeNewsFeed->createNamedListNode( QStringLiteral( "entries" ) )
inlinestatic

Definition at line 56 of file qgsnewsfeedparser.h.


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