mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			192 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			192 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsabstractcontentcache.h                                   *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
class QgsAbstractContentCacheEntry
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
Base class for entries in a :py:class:`QgsAbstractContentCache`.
 | 
						|
 | 
						|
Subclasses must take care to correctly implement the :py:func:`~isEqual`
 | 
						|
method, applying their own logic for testing extra cache properties
 | 
						|
(e.g. image size for an image-based cache).
 | 
						|
 | 
						|
.. versionadded:: 3.6
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsabstractcontentcache.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    QgsAbstractContentCacheEntry( const QString &path );
 | 
						|
%Docstring
 | 
						|
Constructor for QgsAbstractContentCacheEntry for an entry relating to
 | 
						|
the specified ``path``.
 | 
						|
%End
 | 
						|
 | 
						|
    virtual ~QgsAbstractContentCacheEntry();
 | 
						|
 | 
						|
 | 
						|
    QString path;
 | 
						|
 | 
						|
    QDateTime fileModified;
 | 
						|
 | 
						|
    QElapsedTimer fileModifiedLastCheckTimer;
 | 
						|
 | 
						|
    int mFileModifiedCheckTimeout;
 | 
						|
 | 
						|
    QgsAbstractContentCacheEntry *nextEntry;
 | 
						|
 | 
						|
    QgsAbstractContentCacheEntry *previousEntry;
 | 
						|
 | 
						|
    bool operator==( const QgsAbstractContentCacheEntry &other ) const;
 | 
						|
 | 
						|
    virtual int dataSize() const = 0;
 | 
						|
%Docstring
 | 
						|
Returns the memory usage in bytes for the entry.
 | 
						|
%End
 | 
						|
 | 
						|
    virtual void dump() const = 0;
 | 
						|
%Docstring
 | 
						|
Dumps debugging strings containing the item's properties. For testing
 | 
						|
purposes only.
 | 
						|
%End
 | 
						|
 | 
						|
  protected:
 | 
						|
 | 
						|
    virtual bool isEqual( const QgsAbstractContentCacheEntry *other ) const = 0;
 | 
						|
%Docstring
 | 
						|
Tests whether this entry matches another entry. Subclasses must take
 | 
						|
care to check that the type of ``other`` is of a matching class, and
 | 
						|
then test extra cache-specific properties, such as image size.
 | 
						|
%End
 | 
						|
 | 
						|
  private:
 | 
						|
    QgsAbstractContentCacheEntry( const QgsAbstractContentCacheEntry &rh );
 | 
						|
};
 | 
						|
 | 
						|
class QgsAbstractContentCacheBase: QObject
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
A QObject derived base class for :py:class:`QgsAbstractContentCache`.
 | 
						|
 | 
						|
Required because template based class (such as
 | 
						|
:py:class:`QgsAbstractContentCache`) cannot use the Q_OBJECT macro.
 | 
						|
 | 
						|
.. versionadded:: 3.6
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsabstractcontentcache.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    QgsAbstractContentCacheBase( QObject *parent );
 | 
						|
%Docstring
 | 
						|
Constructor for QgsAbstractContentCacheBase, with the specified
 | 
						|
``parent`` object.
 | 
						|
%End
 | 
						|
 | 
						|
    static bool parseBase64DataUrl( const QString &path, QString *mimeType /Out/ = 0, QString *data /Out/ = 0 );
 | 
						|
%Docstring
 | 
						|
Parses a ``path`` to determine if it represents a base 64 encoded HTML
 | 
						|
data URL, and if so, extracts the components of the URL.
 | 
						|
 | 
						|
Data URLs are of the form ``data:[<mediatype>;]base64,<data>``.
 | 
						|
 | 
						|
:param path: path to test
 | 
						|
 | 
						|
:return: - ``True`` if ``path`` is a base 64 encoded data URL
 | 
						|
         - mimeType: the extracted mime type if the ``path`` is a data
 | 
						|
           URL
 | 
						|
         - data: the extracted base64 data if the ``path`` is a data URL
 | 
						|
 | 
						|
.. versionadded:: 3.40
 | 
						|
%End
 | 
						|
 | 
						|
 | 
						|
    static bool parseEmbeddedStringData( const QString &path, QString *mimeType /Out/ = 0, QString *data /Out/ = 0 );
 | 
						|
%Docstring
 | 
						|
Parses a ``path`` to determine if it represents a embedded string data,
 | 
						|
and if so, extracts the components of the URL.
 | 
						|
 | 
						|
Data URLs are of the form ``data:[<mediatype>;]utf8,<data>``.
 | 
						|
 | 
						|
:param path: path to test
 | 
						|
 | 
						|
:return: - ``True`` if ``path`` is an embedded string data URL
 | 
						|
         - mimeType: the extracted mime type if the ``path`` is a data
 | 
						|
           URL
 | 
						|
         - data: the extracted string data if the ``path`` is a data URL
 | 
						|
 | 
						|
.. versionadded:: 3.42
 | 
						|
%End
 | 
						|
 | 
						|
    static bool isBase64Data( const QString &path );
 | 
						|
%Docstring
 | 
						|
Returns ``True`` if ``path`` represents base64 encoded data.
 | 
						|
 | 
						|
.. versionadded:: 3.40
 | 
						|
%End
 | 
						|
 | 
						|
    virtual bool invalidateCacheEntry( const QString &path );
 | 
						|
%Docstring
 | 
						|
Invalidates a cache entry for the specified ``path``.
 | 
						|
 | 
						|
If an entry exists for the given ``path``, it will be removed from the
 | 
						|
cache.
 | 
						|
 | 
						|
:param path: The path of the cache entry to invalidate.
 | 
						|
 | 
						|
:return: ``True`` if an entry was invalidated, ``False`` otherwise.
 | 
						|
 | 
						|
.. versionadded:: 3.44
 | 
						|
%End
 | 
						|
 | 
						|
  signals:
 | 
						|
 | 
						|
    void remoteContentFetched( const QString &url );
 | 
						|
%Docstring
 | 
						|
Emitted when the cache has finished retrieving content from a remote
 | 
						|
``url``.
 | 
						|
%End
 | 
						|
 | 
						|
  protected:
 | 
						|
 | 
						|
    virtual bool checkReply( QNetworkReply *reply, const QString &path ) const;
 | 
						|
%Docstring
 | 
						|
Runs additional checks on a network ``reply`` to ensure that the reply
 | 
						|
content is consistent with that required by the cache.
 | 
						|
%End
 | 
						|
 | 
						|
  protected slots:
 | 
						|
 | 
						|
    virtual void onRemoteContentFetched( const QString &url, bool success );
 | 
						|
%Docstring
 | 
						|
Triggered after remote content (i.e. HTTP linked content at the given
 | 
						|
``url``) has been fetched.
 | 
						|
 | 
						|
The ``success`` argument will be ``True`` if the content was
 | 
						|
successfully fetched, or ``False`` if it was not fetched successfully.
 | 
						|
%End
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsabstractcontentcache.h                                   *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 |