QGIS API Documentation  3.20.0-Odense (decaadbb31)
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. More...
 

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()). More...
 
void entryDismissed (const QgsNewsFeedParser::Entry &entry)
 Emitted whenever an entry is dismissed (as a result of a call to dismissEntry()). More...
 
void fetched (const QList< QgsNewsFeedParser::Entry > &entries)
 Emitted when entries have fetched from the feed. More...
 
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. More...
 

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const QgsSettingsEntryString settingsFeedLanguage = QgsSettingsEntryString( QStringLiteral( "%1/lang" ), QgsSettings::Core, QString(), QObject::tr( "Feed language" ) )
 Settings entry feed language. More...
 
static const QgsSettingsEntryInteger settingsFeedLastFetchTime = QgsSettingsEntryInteger( QStringLiteral( "%1/lastFetchTime" ), QgsSettings::Core, 0, QObject::tr( "Feed last fetch time" ), 0 )
 Settings entry last fetch time. More...
 
static const QgsSettingsEntryDouble settingsFeedLatitude = QgsSettingsEntryDouble( QStringLiteral( "%1/latitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed latitude" ) )
 Settings entry feed latitude. More...
 
static const QgsSettingsEntryDouble settingsFeedLongitude = QgsSettingsEntryDouble( QStringLiteral( "%1/longitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed longitude" ) )
 Settings entry feed longitude. More...
 

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 37 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 31 of file qgsnewsfeedparser.cpp.

Member Function Documentation

◆ authcfg()

QString QgsNewsFeedParser::authcfg ( ) const

Returns the authentication configuration for the parser.

Definition at line 133 of file qgsnewsfeedparser.cpp.

◆ dismissAll()

void QgsNewsFeedParser::dismissAll ( )

Dismisses all current news items.

See also
dismissEntry()

Definition at line 124 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 90 of file qgsnewsfeedparser.cpp.

◆ entries()

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

Returns a list of existing entries in the feed.

Definition at line 85 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()

◆ fetch

void QgsNewsFeedParser::fetch ( )
slot

Fetches new entries from the feed's URL.

See also
fetched()

Definition at line 138 of file qgsnewsfeedparser.cpp.

◆ fetched

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

Emitted when entries have 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 335 of file qgsnewsfeedparser.cpp.

Friends And Related Function Documentation

◆ TestQgsNewsFeedParser

friend class TestQgsNewsFeedParser
friend

Definition at line 184 of file qgsnewsfeedparser.h.

Member Data Documentation

◆ settingsFeedLanguage

const QgsSettingsEntryString QgsNewsFeedParser::settingsFeedLanguage = QgsSettingsEntryString( QStringLiteral( "%1/lang" ), QgsSettings::Core, QString(), QObject::tr( "Feed language" ) )
inlinestatic

Settings entry feed language.

Definition at line 118 of file qgsnewsfeedparser.h.

◆ settingsFeedLastFetchTime

const QgsSettingsEntryInteger QgsNewsFeedParser::settingsFeedLastFetchTime = QgsSettingsEntryInteger( QStringLiteral( "%1/lastFetchTime" ), QgsSettings::Core, 0, QObject::tr( "Feed last fetch time" ), 0 )
inlinestatic

Settings entry last fetch time.

Definition at line 116 of file qgsnewsfeedparser.h.

◆ settingsFeedLatitude

const QgsSettingsEntryDouble QgsNewsFeedParser::settingsFeedLatitude = QgsSettingsEntryDouble( QStringLiteral( "%1/latitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed latitude" ) )
inlinestatic

Settings entry feed latitude.

Definition at line 120 of file qgsnewsfeedparser.h.

◆ settingsFeedLongitude

const QgsSettingsEntryDouble QgsNewsFeedParser::settingsFeedLongitude = QgsSettingsEntryDouble( QStringLiteral( "%1/longitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed longitude" ) )
inlinestatic

Settings entry feed longitude.

Definition at line 122 of file qgsnewsfeedparser.h.


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