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




class QgsAction
{
%Docstring
Utility class that encapsulates an action based on vector attributes.
%End

%TypeHeaderCode
#include "qgsaction.h"
%End
  public:
    enum ActionType
    {
      Generic,
      GenericPython,
      Mac,
      Windows,
      Unix,
      OpenUrl,
    };

    QgsAction();
%Docstring
Default constructor
%End

    QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false );
%Docstring
Create a new QgsAction

:param type: The type of this action
:param description: A human readable description string
:param command: The action text. Its interpretation depends on the type
:param capture: If this is set to ``True``, the output will be captured when an action is run
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode
%End

    QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString() );
%Docstring
Create a new QgsAction

:param type: The type of this action
:param description: A human readable description string
:param action: The action text. Its interpretation depends on the type
:param icon: Path to an icon for this action
:param capture: If this is set to ``True``, the output will be captured when an action is run
:param shortTitle: A short string used to label user interface elements like buttons
:param actionScopes: A set of scopes in which this action will be available
:param notificationMessage: A particular message which reception will trigger the action
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode
%End

    QString name() const;
%Docstring
The name of the action. This may be a longer description.
%End

    QString shortTitle() const;
%Docstring
The short title is used to label user interface elements like buttons
%End

    QUuid id() const;
%Docstring
Returns a unique id for this action.

.. versionadded:: 3.0
%End

    bool isValid() const;
%Docstring
Returns ``True`` if this action was a default constructed one.

.. versionadded:: 3.0
%End

    QString iconPath() const;
%Docstring
The path to the icon
%End

    QIcon icon() const;
%Docstring
The icon
%End

    QString command() const;
%Docstring
Returns the command that is executed by this action.
How the content is interpreted depends on the type() and
the actionScope().

.. versionadded:: 3.0
%End

    QString notificationMessage() const;
%Docstring
Returns the notification message that triggers the action

.. versionadded:: 3.0
%End

    ActionType type() const;
%Docstring
The action type
%End

    bool capture() const;
%Docstring
Whether to capture output for display when this action is run
%End


    bool isEnabledOnlyWhenEditable() const;
%Docstring
Returns whether only enabled in editable mode
%End


    bool runable() const;
%Docstring
Checks if the action is runable on the current platform
%End

    void run( QgsVectorLayer *layer, const QgsFeature &feature, const QgsExpressionContext &expressionContext ) const;
%Docstring
Run this action.

.. versionadded:: 3.0
%End

    void run( const QgsExpressionContext &expressionContext ) const;
%Docstring
Run this action.

.. versionadded:: 3.0
%End

    QSet<QString> actionScopes() const;
%Docstring
The action scopes define where an action will be available.
Action scopes may offer additional variables like the clicked
coordinate.

.. seealso:: :py:class:`QgsActionScope`

.. versionadded:: 3.0
%End

    void setActionScopes( const QSet<QString> &actionScopes );
%Docstring
The action scopes define where an action will be available.
Action scopes may offer additional variables like the clicked
coordinate.

.. versionadded:: 3.0
%End

    void readXml( const QDomNode &actionNode );
%Docstring
Reads an XML definition from actionNode
into this object.

.. versionadded:: 3.0
%End

    void writeXml( QDomNode &actionsNode ) const;
%Docstring
Appends an XML definition for this action as a new
child node to actionsNode.

.. versionadded:: 3.0
%End

    void setExpressionContextScope( const QgsExpressionContextScope &scope );
%Docstring
Sets an expression context scope to use for running the action.

.. versionadded:: 3.0
%End

    QgsExpressionContextScope expressionContextScope() const;
%Docstring
Returns an expression context scope used for running the action.

.. versionadded:: 3.0
%End

};


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