/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsattributeeditorcontext.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsAttributeEditorContext
{
%Docstring(signature="appended")
This class contains context information for attribute editor widgets. It
will be passed to embedded widgets whenever this occurs (e.g. when
showing an embedded form due to relations)
%End

%TypeHeaderCode
#include "qgsattributeeditorcontext.h"
%End
  public:
    static const QMetaObject staticMetaObject;

  public:
    enum Mode /BaseType=IntEnum/
    {
      SingleEditMode,
      AddFeatureMode,
      FixAttributeMode,
      MultiEditMode,
      SearchMode,
      AggregateSearchMode,
      IdentifyMode
    };

    enum RelationMode /BaseType=IntEnum/
    {
      Undefined,
      Multiple,
      Single
    };

    enum FormMode /BaseType=IntEnum/
    {
      Embed,
      StandaloneDialog,
      Popup
    };

    QgsAttributeEditorContext();

    QgsAttributeEditorContext( const QgsAttributeEditorContext &parentContext, FormMode formMode );

    QgsAttributeEditorContext( const QgsAttributeEditorContext &parentContext, const QgsRelation &relation, RelationMode relationMode, FormMode widgetMode );

    void setDistanceArea( const QgsDistanceArea &distanceArea );
%Docstring
Sets distance area object, ``distanceArea``, for area/length
calculations

.. seealso:: :py:func:`distanceArea`
%End

    const QgsDistanceArea &distanceArea() const;
%Docstring
Returns the distance area object used for area/length calculations.

.. seealso:: :py:func:`setDistanceArea`
%End

    void setMapCanvas( QgsMapCanvas *mapCanvas );
%Docstring
Sets the associated map canvas, ``mapCanvas``, (e.g. to zoom to related
features).

.. seealso:: :py:func:`mapCanvas`

.. versionadded:: 3.2
%End

    QgsMapCanvas *mapCanvas() const;
%Docstring
Returns the associated map canvas (e.g. to zoom to related features).

.. seealso:: :py:func:`setMapCanvas`

.. versionadded:: 3.2
%End

    void setCadDockWidget( QgsAdvancedDigitizingDockWidget *cadDockWidget );
%Docstring
Sets the associated CAD dock widget, ``cadDockWidget``, (e.g. to be used
in map tools).

.. note::

   Unstable API. This method is unstable API and may be modified or removed at any time.

.. seealso:: :py:func:`cadDockWidget`

.. versionadded:: 3.10
%End

    QgsAdvancedDigitizingDockWidget *cadDockWidget() const;
%Docstring
Returns the associated CAD dock widget (e.g. to be used in map tools).

.. note::

   Unstable API. This method is unstable API and may be modified or removed at any time.

.. seealso:: :py:func:`setCadDockWidget`

.. versionadded:: 3.10
%End

    void setVectorLayerTools( QgsVectorLayerTools *vlTools );
%Docstring
Sets the associated vector layer tools.

:param vlTools: vector layer tools

.. seealso:: :py:func:`vectorLayerTools`
%End

    const QgsVectorLayerTools *vectorLayerTools() const;
%Docstring
Returns the associated vector layer tools.

.. seealso:: :py:func:`setVectorLayerTools`
%End

    void setRelation( const QgsRelation &relation, RelationMode mode );
%Docstring
Set attribute relation and mode

:param relation: relation
:param mode: relation mode

.. seealso:: :py:func:`relation`

.. seealso:: :py:func:`relationMode`
%End

    const QgsRelation &relation() const;
%Docstring
Returns the attribute relation.

.. seealso:: :py:func:`setRelation`

.. seealso:: :py:func:`relationMode`
%End

    RelationMode relationMode() const;
%Docstring
Returns the attribute relation mode.

.. seealso:: :py:func:`setRelation`

.. seealso:: :py:func:`relation`
%End

    FormMode formMode() const;
%Docstring
Returns the form mode.

.. seealso:: :py:func:`setFormMode`
%End

    void setFormMode( FormMode mode );
%Docstring
Sets the form mode.

:param mode: form mode

.. seealso:: :py:func:`formMode`
%End

    bool allowCustomUi() const;
%Docstring
Returns ``True`` if the attribute editor should permit use of custom UI
forms.

.. seealso:: :py:func:`setAllowCustomUi`
%End

    void setAllowCustomUi( bool allow );
%Docstring
Sets whether the attribute editor should permit use of custom UI forms.

:param allow: set to ``True`` to allow custom UI forms, or ``False`` to
              disable them and use default generated QGIS forms

.. seealso:: :py:func:`allowCustomUi`
%End

    const QgsAttributeEditorContext *parentContext() const;

    QgsFeature formFeature() const;
%Docstring
Returns current feature from the currently edited form or table row

.. seealso:: :py:func:`setFormFeature`

.. versionadded:: 3.2
%End

    void setFormFeature( const QgsFeature &feature );
%Docstring
Set current ``feature`` for the currently edited form or table row

.. seealso:: :py:func:`formFeature`

.. versionadded:: 3.2
%End

    QgsFeature parentFormFeature() const;
%Docstring
Returns the feature of the currently edited parent form in its actual
state

.. seealso:: :py:func:`setParentFormFeature`

.. versionadded:: 3.14
%End

    void setParentFormFeature( const QgsFeature &feature );
%Docstring
Sets the ``feature`` of the currently edited parent form

.. seealso:: :py:func:`parentFormFeature`

.. versionadded:: 3.14
%End

    Mode attributeFormMode() const;
%Docstring
Returns current attributeFormMode

.. versionadded:: 3.4
%End

    void setAttributeFormMode( const Mode &attributeFormMode );
%Docstring
Set ``attributeFormMode`` for the edited form

.. versionadded:: 3.4
%End

    QString attributeFormModeString() const;
%Docstring
Returns given ``attributeFormMode`` as string

.. versionadded:: 3.4
%End

    void setMainMessageBar( QgsMessageBar *messageBar );
%Docstring
Set current ``messageBar`` as the main message bar

.. versionadded:: 3.12
%End

    QgsMessageBar *mainMessageBar();
%Docstring
Returns the main message bar

.. versionadded:: 3.12
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsattributeeditorcontext.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/
