2019-07-01 11:35:59 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsnewsfeedparser.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsNewsFeedParser : QObject
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Parser for published QGIS news feeds.
|
|
|
|
|
2019-07-09 15:45:15 +10:00
|
|
|
This class is designed to work with the specialized QGIS news feed API. See
|
2019-07-01 11:35:59 +10:00
|
|
|
https://github.com/elpaso/qgis-feed.
|
|
|
|
|
|
|
|
.. versionadded:: 3.10
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsnewsfeedparser.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
class Entry
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Represents a single entry from a news feed.
|
2019-07-15 09:49:00 +10:00
|
|
|
|
|
|
|
.. versionadded:: 3.10
|
2019-07-01 11:35:59 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsnewsfeedparser.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
int key;
|
|
|
|
|
|
|
|
QString title;
|
|
|
|
|
|
|
|
QString imageUrl;
|
|
|
|
|
2019-07-09 13:38:02 +10:00
|
|
|
QPixmap image;
|
2019-07-09 12:54:13 +10:00
|
|
|
|
2019-07-01 11:35:59 +10:00
|
|
|
QString content;
|
|
|
|
|
|
|
|
QUrl link;
|
|
|
|
|
|
|
|
bool sticky;
|
|
|
|
};
|
|
|
|
|
2019-07-09 11:56:25 +10:00
|
|
|
QgsNewsFeedParser( const QUrl &feedUrl, const QString &authcfg = QString(), QObject *parent /TransferThis/ = 0 );
|
2019-07-01 11:35:59 +10:00
|
|
|
%Docstring
|
|
|
|
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.
|
|
|
|
%End
|
|
|
|
|
|
|
|
QList< QgsNewsFeedParser::Entry > entries() const;
|
|
|
|
%Docstring
|
|
|
|
Returns a list of existing entries in the feed.
|
2019-07-09 11:16:25 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void dismissEntry( int key );
|
|
|
|
%Docstring
|
|
|
|
Dismisses an entry with matching ``key``.
|
|
|
|
|
|
|
|
This removes the entry from the local store, ensuring it will never be present again.
|
2019-07-09 13:43:58 +10:00
|
|
|
|
|
|
|
.. seealso:: :py:func:`dismissAll`
|
|
|
|
%End
|
|
|
|
|
|
|
|
void dismissAll();
|
|
|
|
%Docstring
|
|
|
|
Dismisses all current news items.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`dismissEntry`
|
2019-07-09 12:54:13 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString authcfg() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the authentication configuration for the parser.
|
2019-07-09 14:02:01 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
static QString keyForFeed( const QString &baseUrl );
|
|
|
|
%Docstring
|
|
|
|
Returns the settings key used for a feed with the given ``baseUrl``.
|
2019-07-01 11:35:59 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
void fetch();
|
|
|
|
%Docstring
|
|
|
|
Fetches new entries from the feed's URL.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`fetched`
|
|
|
|
%End
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
void fetched( const QList< QgsNewsFeedParser::Entry > &entries );
|
|
|
|
%Docstring
|
|
|
|
Emitted when ``entries`` have fetched from the feed.
|
|
|
|
|
2019-07-09 11:16:25 +10:00
|
|
|
.. seealso:: :py:func:`fetch`
|
|
|
|
%End
|
|
|
|
|
|
|
|
void entryAdded( const QgsNewsFeedParser::Entry &entry );
|
|
|
|
%Docstring
|
2019-07-09 11:56:25 +10:00
|
|
|
Emitted whenever a new ``entry`` is available from the feed (as a result
|
2019-07-09 11:16:25 +10:00
|
|
|
of a call to fetch()).
|
|
|
|
|
2019-07-01 11:35:59 +10:00
|
|
|
.. seealso:: :py:func:`fetch`
|
2019-07-09 11:56:25 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void entryDismissed( const QgsNewsFeedParser::Entry &entry );
|
|
|
|
%Docstring
|
|
|
|
Emitted whenever an ``entry`` is dismissed (as a result of a call
|
|
|
|
to dismissEntry()).
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`dismissEntry`
|
2019-07-09 13:38:02 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void imageFetched( int key, const QPixmap &pixmap );
|
|
|
|
%Docstring
|
|
|
|
Emitted when the image attached to the entry with the specified ``key`` has been fetched
|
|
|
|
and is now available.
|
2019-07-01 11:35:59 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsnewsfeedparser.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|