1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/textrenderer/qgstextdocument.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsTextDocument
{
%Docstring(signature="appended")
Represents a document consisting of one or more :py:class:`QgsTextBlock`
objects.
.. warning::
This API is not considered stable and may change in future QGIS versions.
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgstextdocument.h"
%End
public:
QgsTextDocument();
~QgsTextDocument();
explicit QgsTextDocument( const QgsTextBlock &block );
%Docstring
Constructor for a QgsTextDocument consisting of a single text ``block``.
%End
explicit QgsTextDocument( const QgsTextFragment &fragment );
%Docstring
Constructor for a QgsTextDocument consisting of a single text
``fragment``.
%End
static QgsTextDocument fromPlainText( const QStringList &lines );
%Docstring
Constructor for QgsTextDocument consisting of a set of plain text
``lines``.
If any line contains tab characters they will be appended as separate
text fragments within the document, consisting of just the tab
character.
%End
static QgsTextDocument fromHtml( const QStringList &lines );
%Docstring
Constructor for QgsTextDocument consisting of a set of HTML formatted
``lines``.
If the HTML contains tab characters they will be appended as separate
text fragments within the document, consisting of just the tab
character.
%End
static QgsTextDocument fromTextAndFormat( const QStringList &lines, const QgsTextFormat &format );
%Docstring
Constructor for QgsTextDocument consisting of a set of ``lines``,
respecting settings from a text ``format``.
This method will determine from the text ``format`` whether the lines
should be treated as HTML or plain text.
.. versionadded:: 3.40
%End
void append( const QgsTextBlock &block );
%Docstring
Appends a ``block`` to the document.
%End
void insert( int index, const QgsTextBlock &block );
%Docstring
Inserts a ``block`` into the document, at the specified index.
:raises IndexError: if no block exists at the specified index.
.. versionadded:: 3.40
%End
%MethodCode
if ( a0 < 0 || a0 > sipCpp->size() )
{
PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
sipIsErr = 1;
}
else
{
sipCpp->insert( a0, *a1 );
}
%End
void reserve( int count );
%Docstring
Reserves the specified ``count`` of blocks for optimised block
appending.
%End
const QgsTextBlock &at( int index ) const /Factory/;
%Docstring
Returns the block at the specified ``index``.
:raises KeyError: if no block exists at the specified index.
%End
%MethodCode
if ( a0 < 0 || a0 >= sipCpp->size() )
{
PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
sipIsErr = 1;
}
else
{
sipRes = new QgsTextBlock( sipCpp->at( a0 ) );
}
%End
QgsTextBlock &operator[]( int index ) /Factory/;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex( a0, sipCpp->size() );
if ( idx < 0 )
sipIsErr = 1;
else
sipRes = new QgsTextBlock( sipCpp->operator[]( idx ) );
%End
int size() const;
%Docstring
Returns the number of blocks in the document.
%End
Py_ssize_t __len__() const;
%MethodCode
sipRes = sipCpp->size();
%End
QStringList toPlainText() const;
%Docstring
Returns a list of plain text lines of text representing the document.
%End
void splitLines( const QString &wrapCharacter, int autoWrapLength = 0, bool useMaxLineLengthWhenAutoWrapping = true );
%Docstring
Splits lines of text in the document to separate lines, using a
specified wrap character (``wrapCharacter``) or newline characters.
The ``autoWrapLength`` argument can be used to specify an ideal length
of line to automatically wrap text to (automatic wrapping is disabled if
``autoWrapLength`` is 0). This automatic wrapping is performed after
processing wrapping using ``wrapCharacter``. When auto wrapping is
enabled, the ``useMaxLineLengthWhenAutoWrapping`` argument controls
whether the lines should be wrapped to an ideal maximum of
``autoWrapLength`` characters, or if ``False`` then the lines are
wrapped to an ideal minimum length of ``autoWrapLength`` characters.
%End
void applyCapitalization( Qgis::Capitalization capitalization );
%Docstring
Applies a ``capitalization`` style to the document's text.
.. versionadded:: 3.16
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/textrenderer/qgstextdocument.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|