mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			105 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			105 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsnetworkcontentfetchertask.h                              *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
class QgsNetworkContentFetcherTask : QgsTask
 | 
						|
{
 | 
						|
%Docstring
 | 
						|
Handles HTTP network content fetching in a background task.
 | 
						|
 | 
						|
Provides a simple method for fetching remote HTTP content in a QgsTask.
 | 
						|
Url redirects are automatically handled.
 | 
						|
 | 
						|
After constructing a QgsNetworkContentFetcherTask, callers should
 | 
						|
connect to the QgsNetworkContentFetcherTask.fetched signal. They can
 | 
						|
then safely access the network :py:func:`~reply` from the connected slot
 | 
						|
without danger of the task being first removed by the QgsTaskManager.
 | 
						|
 | 
						|
.. seealso:: :py:class:`QgsNetworkContentFetcher`
 | 
						|
 | 
						|
.. versionadded:: 3.2
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsnetworkcontentfetchertask.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    QgsNetworkContentFetcherTask( const QUrl &url, const QString &authcfg = QString(), QgsTask::Flags flags = QgsTask::CanCancel );
 | 
						|
%Docstring
 | 
						|
Constructor for a QgsNetworkContentFetcherTask which fetches
 | 
						|
the specified ``url``.
 | 
						|
 | 
						|
Optionally, authentication configuration can be set via the ``authcfg`` argument.
 | 
						|
%End
 | 
						|
 | 
						|
    QgsNetworkContentFetcherTask( const QNetworkRequest &request, const QString &authcfg = QString(), QgsTask::Flags flags = QgsTask::CanCancel );
 | 
						|
%Docstring
 | 
						|
Constructor for a QgsNetworkContentFetcherTask which fetches
 | 
						|
the specified network ``request``.
 | 
						|
 | 
						|
Optionally, authentication configuration can be set via the ``authcfg`` argument.
 | 
						|
%End
 | 
						|
 | 
						|
    ~QgsNetworkContentFetcherTask();
 | 
						|
 | 
						|
    virtual bool run();
 | 
						|
 | 
						|
    virtual void cancel();
 | 
						|
 | 
						|
 | 
						|
    QNetworkReply *reply();
 | 
						|
%Docstring
 | 
						|
Returns the network reply. Ownership is not transferred.
 | 
						|
 | 
						|
May return ``None`` if the request has not yet completed.
 | 
						|
 | 
						|
.. warning::
 | 
						|
 | 
						|
   This should only be accessed from a slot connected directly to
 | 
						|
   the :py:func:`QgsNetworkContentFetcherTask.fetched()` signal.
 | 
						|
%End
 | 
						|
 | 
						|
    QString contentAsString() const;
 | 
						|
%Docstring
 | 
						|
Returns the fetched content as a string
 | 
						|
 | 
						|
.. warning::
 | 
						|
 | 
						|
   This should only be accessed from a slot connected directly to
 | 
						|
   the :py:func:`QgsNetworkContentFetcherTask.fetched()` signal.
 | 
						|
 | 
						|
.. versionadded:: 3.10
 | 
						|
%End
 | 
						|
 | 
						|
  signals:
 | 
						|
 | 
						|
    void fetched();
 | 
						|
%Docstring
 | 
						|
Emitted when the network content has been fetched, regardless
 | 
						|
of whether the fetch was successful or not.
 | 
						|
 | 
						|
Users of QgsNetworkContentFetcherTask should connect to this signal,
 | 
						|
and from the associated slot they can then safely access the network :py:func:`~QgsNetworkContentFetcherTask.reply`
 | 
						|
without danger of the task being first removed by the :py:class:`QgsTaskManager`.
 | 
						|
%End
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsnetworkcontentfetchertask.h                              *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | 
						|
 ************************************************************************/
 |