15 #ifndef QGSNEWSFEEDPARSER_H
16 #define QGSNEWSFEEDPARSER_H
18 #include "qgis_core.h"
20 #include "qgssettingsentry.h"
87 QList< QgsNewsFeedParser::Entry > entries()
const;
96 void dismissEntry(
int key );
107 QString authcfg()
const;
112 static QString keyForFeed(
const QString &baseUrl );
116 static const inline QgsSettingsEntryInteger settingsFeedLastFetchTime = QgsSettingsEntryInteger( QStringLiteral(
"%1/lastFetchTime" ), QgsSettings::Core, 0, QObject::tr(
"Feed last fetch time" ), 0 );
118 static const inline QgsSettingsEntryString settingsFeedLanguage = QgsSettingsEntryString( QStringLiteral(
"%1/lang" ), QgsSettings::Core, QString(), QObject::tr(
"Feed language" ) );
120 static const inline QgsSettingsEntryDouble settingsFeedLatitude = QgsSettingsEntryDouble( QStringLiteral(
"%1/latitude" ), QgsSettings::Core, 0.0, QObject::tr(
"Feed latitude" ) );
122 static const inline QgsSettingsEntryDouble settingsFeedLongitude = QgsSettingsEntryDouble( QStringLiteral(
"%1/longitude" ), QgsSettings::Core, 0.0, QObject::tr(
"Feed longitude" ) );
140 void fetched(
const QList< QgsNewsFeedParser::Entry > &entries );
166 void onFetch(
const QString &content );
173 qint64 mFetchStartTime = 0;
174 QString mSettingsKey;
176 QList< Entry > mEntries;
177 bool mBlockSignals =
false;
179 void readStoredEntries();
180 Entry readEntryFromSettings(
int key );
181 void storeEntryInSettings(
const Entry &entry );
182 void fetchImageForEntry(
const Entry &entry );
184 friend class TestQgsNewsFeedParser;
HTTP network content fetcher.
Represents a single entry from a news feed.
QString content
HTML content of news entry.
QUrl link
Optional URL link for entry.
QString imageUrl
Optional URL for image associated with entry.
QPixmap image
Optional image data.
QDateTime expiry
Optional auto-expiry time for entry.
QString title
Entry title.
Parser for published QGIS news feeds.
void entryDismissed(const QgsNewsFeedParser::Entry &entry)
Emitted whenever an entry is dismissed (as a result of a call to dismissEntry()).
void fetched(const QList< QgsNewsFeedParser::Entry > &entries)
Emitted when entries have fetched from the feed.
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 imageFetched(int key, const QPixmap &pixmap)
Emitted when the image attached to the entry with the specified key has been fetched and is now avail...