QGIS/python/core/auto_generated/qgsattributeeditorelement.sip.in

358 lines
9.2 KiB
Plaintext
Raw Normal View History

2017-04-04 08:44:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributeeditorelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeEditorElement /Abstract/
{
%Docstring
2017-12-15 10:36:55 -04:00
This is an abstract base class for any elements of a drag and drop form.
2017-12-15 10:36:55 -04:00
This can either be a container which will be represented on the screen
as a tab widget or ca collapsible group box. Or it can be a field which will
then be represented based on the QgsEditorWidget type and configuration.
Or it can be a relation and embed the form of several children of another
layer.
%End
2017-04-04 08:44:22 +02:00
%TypeHeaderCode
2017-04-04 08:44:22 +02:00
#include "qgsattributeeditorelement.h"
%End
%ConvertToSubClassCode
2017-04-04 08:44:22 +02:00
switch ( sipCpp->type() )
{
case QgsAttributeEditorElement::AeTypeContainer:
sipType = sipType_QgsAttributeEditorContainer;
break;
case QgsAttributeEditorElement::AeTypeField:
sipType = sipType_QgsAttributeEditorField;
break;
case QgsAttributeEditorElement::AeTypeRelation:
sipType = sipType_QgsAttributeEditorRelation;
break;
default:
sipType = nullptr;
2017-04-04 08:44:22 +02:00
break;
}
%End
public:
enum AttributeEditorType
{
2017-04-04 08:44:22 +02:00
AeTypeContainer,
AeTypeField,
AeTypeRelation,
AeTypeInvalid
};
2017-04-04 08:44:22 +02:00
QgsAttributeEditorElement( AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param type: The type of the new element. Should never
:param name:
:param parent:
2017-04-04 08:44:22 +02:00
%End
2017-04-04 08:44:22 +02:00
virtual ~QgsAttributeEditorElement();
QString name() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return the name of this element
:return: The name for this element
2017-04-04 08:44:22 +02:00
%End
AttributeEditorType type() const;
%Docstring
2017-12-15 10:36:55 -04:00
The type of this element
:return: The type
2017-04-04 08:44:22 +02:00
%End
QgsAttributeEditorElement *parent() const;
%Docstring
2017-12-15 10:36:55 -04:00
Get the parent of this element.
2017-04-04 08:44:22 +02:00
.. versionadded:: 3.0
%End
QDomElement toDomElement( QDomDocument &doc ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Get the XML Dom element to save this element.
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param doc: The QDomDocument which is used to create new XML elements
:return: A DOM element to serialize this element
2017-04-04 08:44:22 +02:00
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const = 0 /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a clone of this element. To be implemented by subclasses.
2017-04-04 08:44:22 +02:00
.. versionadded:: 3.0
%End
bool showLabel() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Controls if this element should be labeled with a title (field, relation or groupname).
2017-04-04 08:44:22 +02:00
.. versionadded:: 2.18
%End
void setShowLabel( bool showLabel );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Controls if this element should be labeled with a title (field, relation or groupname).
2017-04-04 08:44:22 +02:00
.. versionadded:: 2.18
%End
protected:
};
class QgsAttributeEditorContainer : QgsAttributeEditorElement
{
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
This is a container for attribute editors, used to group them visually in the
attribute form if it is set to the drag and drop designer.
2017-04-04 08:44:22 +02:00
%End
%TypeHeaderCode
2017-04-04 08:44:22 +02:00
#include "qgsattributeeditorelement.h"
%End
public:
2017-04-04 08:44:22 +02:00
QgsAttributeEditorContainer( const QString &name, QgsAttributeEditorElement *parent );
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new attribute editor container
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param name: The name to show as title
:param parent: The parent. May be another container.
2017-04-04 08:44:22 +02:00
%End
~QgsAttributeEditorContainer();
2017-04-04 08:44:22 +02:00
2017-07-10 17:02:54 +02:00
virtual void addChildElement( QgsAttributeEditorElement *element /Transfer/ );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Add a child element to this container. This may be another container, a field or a relation.
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param element: The element to add as child
2017-04-04 08:44:22 +02:00
%End
virtual void setIsGroupBox( bool isGroupBox );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Determines if this container is rendered as collapsible group box or tab in a tabwidget
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param isGroupBox: If true, this will be a group box
2017-04-04 08:44:22 +02:00
%End
virtual bool isGroupBox() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns if this container is going to be rendered as a group box
:return: True if it will be a group box, false if it will be a tab
2017-04-04 08:44:22 +02:00
%End
QList<QgsAttributeEditorElement *> children() const;
%Docstring
2017-12-15 10:36:55 -04:00
Get a list of the children elements of this container
:return: A list of elements
2017-04-04 08:44:22 +02:00
%End
virtual QList<QgsAttributeEditorElement *> findElements( AttributeEditorType type ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Traverses the element tree to find any element of the specified type
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param type: The type which should be searched
:return: A list of elements of the type which has been searched for
2017-04-04 08:44:22 +02:00
%End
void clear();
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Clear all children from this container.
2017-04-04 08:44:22 +02:00
%End
2017-04-04 08:44:22 +02:00
void setName( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Change the name of this container
2017-04-04 08:44:22 +02:00
%End
int columnCount() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get the number of columns in this group
2017-04-04 08:44:22 +02:00
%End
void setColumnCount( int columnCount );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the number of columns in this group
2017-04-04 08:44:22 +02:00
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a deep copy of this element. To be implemented by subclasses.
2017-04-04 08:44:22 +02:00
.. versionadded:: 3.0
%End
2016-09-09 09:49:25 +02:00
QgsOptionalExpression visibilityExpression() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The visibility expression is used in the attribute form to
show or hide this container based on an expression incorporating
the field value controlled by editor widgets.
2017-04-04 08:44:22 +02:00
.. versionadded:: 3.0
%End
void setVisibilityExpression( const QgsOptionalExpression &visibilityExpression );
%Docstring
2017-12-15 10:36:55 -04:00
The visibility expression is used in the attribute form to
show or hide this container based on an expression incorporating
the field value controlled by editor widgets.
2017-04-04 08:44:22 +02:00
.. versionadded:: 3.0
%End
2016-09-09 09:49:25 +02:00
};
2017-04-04 08:44:22 +02:00
class QgsAttributeEditorField : QgsAttributeEditorElement
{
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
This element will load a field's widget onto the form.
2017-04-04 08:44:22 +02:00
%End
%TypeHeaderCode
2017-04-04 08:44:22 +02:00
#include "qgsattributeeditorelement.h"
%End
public:
2017-04-04 08:44:22 +02:00
QgsAttributeEditorField( const QString &name, int idx, QgsAttributeEditorElement *parent );
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new attribute editor element which represents a field
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param name: The name of the element
:param idx: The index of the field which should be embedded
:param parent: The parent of this widget (used as container)
2017-04-04 08:44:22 +02:00
%End
int idx() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return the index of the field
:return:
2017-04-04 08:44:22 +02:00
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
};
class QgsAttributeEditorRelation : QgsAttributeEditorElement
{
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
This element will load a relation editor onto the form.
2017-04-04 08:44:22 +02:00
%End
%TypeHeaderCode
2017-04-04 08:44:22 +02:00
#include "qgsattributeeditorelement.h"
%End
public:
2017-04-04 08:44:22 +02:00
2018-03-29 16:47:56 +02:00
QgsAttributeEditorRelation( const QString &name, const QString &relationId, QgsAttributeEditorElement *parent );
%Docstring
.. deprecated:: since QGIS 3.0.2. The name parameter is not used for anything and overwritten by the relationId internally.
%End
QgsAttributeEditorRelation( const QString &name, const QgsRelation &relation, QgsAttributeEditorElement *parent );
%Docstring
.. deprecated:: since QGIS 3.0.2. The name parameter is not used for anything and overwritten by the relationId internally.
%End
QgsAttributeEditorRelation( const QString &relationId, QgsAttributeEditorElement *parent );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new element which embeds a relation.
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param relationId: The id of the relation to embed
:param parent: The parent (used as container)
2017-04-04 08:44:22 +02:00
%End
2018-03-29 16:47:56 +02:00
QgsAttributeEditorRelation( const QgsRelation &relation, QgsAttributeEditorElement *parent );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new element which embeds a relation.
2017-04-04 08:44:22 +02:00
2017-12-15 10:36:55 -04:00
:param relation: The relation to embed
:param parent: The parent (used as container)
2017-04-04 08:44:22 +02:00
%End
2018-03-29 16:47:56 +02:00
2017-04-04 08:44:22 +02:00
const QgsRelation &relation() const;
%Docstring
2017-12-15 10:36:55 -04:00
Get the id of the relation which shall be embedded
:return: the id
2017-04-04 08:44:22 +02:00
%End
bool init( QgsRelationManager *relManager );
%Docstring
2017-12-15 10:36:55 -04:00
Initializes the relation from the id
:param relManager: The relation manager to use for the initialization
:return: true if the relation was found in the relationmanager
2017-04-04 08:44:22 +02:00
%End
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;
bool showLinkButton() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Determines if the "link feature" button should be shown
2017-04-04 08:44:22 +02:00
.. versionadded:: 2.18
%End
void setShowLinkButton( bool showLinkButton );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Determines if the "link feature" button should be shown
2017-04-04 08:44:22 +02:00
.. versionadded:: 2.18
%End
bool showUnlinkButton() const;
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Determines if the "unlink feature" button should be shown
2017-04-04 08:44:22 +02:00
.. versionadded:: 2.18
%End
void setShowUnlinkButton( bool showUnlinkButton );
2017-04-04 08:44:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Determines if the "unlink feature" button should be shown
2017-04-04 08:44:22 +02:00
.. versionadded:: 2.18
%End
};
2017-04-04 08:44:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributeeditorelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/