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




class QgsPropertyOverrideButton: QToolButton
{
%Docstring(signature="appended")
A button for controlling property overrides which may apply to a widget.

:py:class:`QgsPropertyOverrideButton` is designed to be used alongside the QGIS
properties framework (:py:class:`QgsProperty`, :py:class:`QgsPropertyDefinition`
and :py:class:`QgsPropertyCollection`).

It allows users to specify field or expression based overrides
which should be applied to a property of an object. Eg, this widget
is used for controlling data defined overrides in symbology, labeling
and layouts.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgspropertyoverridebutton.h"
%End
  public:

    QgsPropertyOverrideButton( QWidget *parent /TransferThis/ = 0,
                               const QgsVectorLayer *layer = 0 );
%Docstring
Constructor for QgsPropertyOverrideButton.

:param parent: parent widget
:param layer: associated vector layer
%End

    void init( int propertyKey,
               const QgsProperty &property,
               const QgsPropertiesDefinition &definitions,
               const QgsVectorLayer *layer = 0,
               bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was included in a UI layout).

:param propertyKey: key for corresponding property
:param property: initial value of associated property to show in widget
:param definitions: properties definitions for corresponding collection
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If ``True``, activate the button to store data defined in auxiliary storage
%End

    void init( int propertyKey,
               const QgsProperty &property,
               const QgsPropertyDefinition &definition,
               const QgsVectorLayer *layer = 0,
               bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was included in a UI layout).

:param propertyKey: key for corresponding property
:param property: initial value of associated property to show in widget
:param definition: properties definition for button
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If ``True``, activate the button to store data defined in auxiliary storage
%End

    void init( int propertyKey,
               const QgsAbstractPropertyCollection &collection,
               const QgsPropertiesDefinition &definitions,
               const QgsVectorLayer *layer = 0,
               bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was included in a UI layout).

:param propertyKey: key for corresponding property
:param collection: associated property collection
:param definitions: properties definitions for collection
:param layer: associated vector layer
:param auxiliaryStorageEnabled: If ``True``, activate the button to store data defined in auxiliary storage
%End

    QgsProperty toProperty() const;
%Docstring
Returns a :py:class:`QgsProperty` object encapsulating the current state of the
widget.

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

    void setToProperty( const QgsProperty &property );
%Docstring
Sets the widget to reflect the current state of a :py:class:`QgsProperty`.
%End

    int propertyKey() const;
%Docstring
Returns the property key linked to the button.
%End

    bool isActive() const;
%Docstring
Returns ``True`` if the button has an active property.
%End

    QgsPropertyDefinition::DataType validDataType() const;
%Docstring
Returns the data type which the widget will accept. This is used to filter
out fields from the associated vector layer to only show fields which
are compatible with the property.
%End

    QString fullDescription() const;
%Docstring
Returns the full definition description and current definition
(internally generated on a contextual basis).
%End

    QString usageInfo() const;
%Docstring
Returns usage information for the property.

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

    void setUsageInfo( const QString &info );
%Docstring
Set the usage information for the property.

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

    void setVectorLayer( const QgsVectorLayer *layer );
%Docstring
Sets the vector layer associated with the button. This controls which fields are
displayed within the widget's pop up menu.

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

    const QgsVectorLayer *vectorLayer() const;
%Docstring
Returns the vector layer associated with the button. This controls which fields are
displayed within the widget's pop up menu.

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

    void registerCheckedWidget( QWidget *widget, bool natural = true );
%Docstring
Register a sibling ``widget`` that gets checked when the property is active.
if ``natural`` is ``False``, widget gets unchecked when the property is active.

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerEnabledWidget( QWidget *widget, bool natural = true );
%Docstring
Register a sibling ``widget`` that gets enabled when the property is active, and disabled when the property is inactive.
if ``natural`` is ``False``, widget gets disabled when the property is active, and enabled when the property is inactive.

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerVisibleWidget( QWidget *widget, bool natural = true );
%Docstring
Register a sibling ``widget`` that gets visible when the property is active, and hidden when the property is inactive.
if ``natural`` is ``False``, widget gets hidden when the property is active, and visible when the property is inactive.

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerExpressionWidget( QWidget *widget );
%Docstring
Register a sibling ``widget`` (line edit, text edit) that will receive the property as an expression

.. note::

   this should be called after calling :py:func:`~QgsPropertyOverrideButton.init` to be correctly initialized.
%End

    void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator );
%Docstring
Register an expression context generator class that will be used to retrieve
an expression context for the button when required.
%End

    void registerLinkedWidget( QWidget *widget );
%Docstring
Registers a ``widget`` which is linked to this button. The meaning of linked widgets
depends on the property type, and the type of linked widget.

For color properties, linking a :py:class:`QgsColorButton` allows the color button to correctly
reflect the status of the property when it's set to follow a project color.

.. versionadded:: 3.6
%End

    void updateFieldLists();
%Docstring
Updates list of fields.

.. versionadded:: 3.0
%End


  public slots:

    void setActive( bool active );
%Docstring
Set whether the current property override definition is to be used
%End



    void aboutToShowMenu();
    void menuActionTriggered( QAction *action );


  signals:

    void changed();
%Docstring
Emitted when property definition changes
%End

    void activated( bool isActive );
%Docstring
Emitted when the activated status of the widget changes
%End

    void createAuxiliaryField();
%Docstring
Emitted when creating a new auxiliary field
%End

  protected:
    virtual void mouseReleaseEvent( QMouseEvent *event );


};

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