2017-05-12 17:31:01 +08:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsreadwritecontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-27 11:38:45 -04:00
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
class QgsReadWriteContext
|
|
|
|
{
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
The class is used as a container of context for various read/write operations on other objects.
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsreadwritecontext.h"
|
|
|
|
%End
|
|
|
|
public:
|
2017-09-11 21:55:20 +10:00
|
|
|
|
2018-02-26 14:08:03 -04:00
|
|
|
struct ReadWriteMessage
|
|
|
|
{
|
2018-02-26 14:48:05 -04:00
|
|
|
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, const QStringList &categories = QStringList() );
|
2018-02-26 14:08:03 -04:00
|
|
|
%Docstring
|
|
|
|
Construct a container for QgsReadWriteContext error or warning messages
|
|
|
|
%End
|
|
|
|
|
|
|
|
QString message() const;
|
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns the message string
|
2018-02-26 14:08:03 -04:00
|
|
|
%End
|
|
|
|
|
|
|
|
Qgis::MessageLevel level() const;
|
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns the message level
|
2018-02-26 14:08:03 -04:00
|
|
|
%End
|
|
|
|
|
|
|
|
QStringList categories() const;
|
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns the stack of categories of the message
|
2018-02-26 14:08:03 -04:00
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
QgsReadWriteContext();
|
2017-09-11 21:55:20 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsReadWriteContext.
|
2017-09-11 21:55:20 +10:00
|
|
|
%End
|
2017-05-12 17:31:01 +08:00
|
|
|
|
2018-02-26 14:08:03 -04:00
|
|
|
~QgsReadWriteContext();
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
const QgsPathResolver &pathResolver() const;
|
|
|
|
%Docstring
|
|
|
|
Returns path resolver for conversion between relative and absolute paths
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setPathResolver( const QgsPathResolver &resolver );
|
|
|
|
%Docstring
|
|
|
|
Sets up path resolver for conversion between relative and absolute paths
|
2018-02-06 14:57:04 -04:00
|
|
|
%End
|
|
|
|
|
2018-02-27 11:38:45 -04:00
|
|
|
void pushMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning );
|
2018-02-06 14:57:04 -04:00
|
|
|
%Docstring
|
2018-02-26 14:48:05 -04:00
|
|
|
Append a message to the context
|
2018-02-26 14:08:03 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
2018-02-27 21:32:45 -04:00
|
|
|
QgsReadWriteContextCategoryPopper enterCategory( const QString &category, const QString &details = QString() ) /PyName=_enterCategory/;
|
|
|
|
%Docstring
|
|
|
|
Push a category to the stack
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The return value should always be used so category can be automatically left.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
It is not aimed at being used in Python. Instead use the context manager.
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
context = QgsReadWriteContext()
|
|
|
|
with QgsReadWriteContext.enterCategory(context, category, details):
|
|
|
|
# do something
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
2018-02-06 14:57:04 -04:00
|
|
|
|
2018-02-26 14:08:03 -04:00
|
|
|
QList<QgsReadWriteContext::ReadWriteMessage> takeMessages();
|
2018-02-06 14:57:04 -04:00
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Returns the stored messages and remove them
|
2018-02-26 14:08:03 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
2017-05-12 17:31:01 +08:00
|
|
|
%End
|
|
|
|
|
2018-07-31 20:32:54 +02:00
|
|
|
const QgsProjectTranslator *projectTranslator( ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the project translator
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setProjectTranslator( QgsProjectTranslator *projectTranslator );
|
|
|
|
%Docstring
|
2018-08-07 14:18:45 +02:00
|
|
|
Sets the project translator. Means it shouldn't conform mDefaultTranslator anymore.
|
|
|
|
It's usually the QgsProject where the function with the context is made and won't be changed anymore.
|
2018-07-31 20:32:54 +02:00
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
2018-02-27 11:38:45 -04:00
|
|
|
|
2018-07-31 20:32:54 +02:00
|
|
|
public:
|
2017-05-12 17:31:01 +08:00
|
|
|
};
|
|
|
|
|
2018-02-27 11:38:45 -04:00
|
|
|
|
2018-02-27 21:32:45 -04:00
|
|
|
class QgsReadWriteContextCategoryPopper
|
|
|
|
{
|
|
|
|
%Docstring
|
2018-02-28 15:00:11 -04:00
|
|
|
Allows entering a context category and takes care of
|
|
|
|
leaving this category on deletion of the class.
|
2018-02-27 21:32:45 -04:00
|
|
|
This would happen when it gets out of scope.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsreadwritecontext.h"
|
|
|
|
%End
|
|
|
|
public:
|
2018-02-28 20:32:51 -04:00
|
|
|
QgsReadWriteContextCategoryPopper( QgsReadWriteContext &context );
|
2018-02-27 21:32:45 -04:00
|
|
|
%Docstring
|
|
|
|
Creates a popper
|
|
|
|
%End
|
|
|
|
~QgsReadWriteContextCategoryPopper();
|
|
|
|
};
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsreadwritecontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|