Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

214 lines
6.4 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/actions/qgsaction.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAction
{
%Docstring(signature="appended")
Utility class that encapsulates an action based on vector attributes.
%End
%TypeHeaderCode
#include "qgsaction.h"
%End
public:
QgsAction();
QgsAction( Qgis::AttributeActionType 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
%End
QgsAction( Qgis::AttributeActionType 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
%End
QgsAction( const QUuid &id, Qgis::AttributeActionType 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 id: The unique identifier of this action
: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
%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.
%End
bool isValid() const;
%Docstring
Returns ``True`` if this action was a default constructed one.
%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 :py:func:`~QgsAction.type` and the
:py:func:`~QgsAction.actionScope`.
%End
QString notificationMessage() const;
%Docstring
Returns the notification message that triggers the action
%End
Qgis::AttributeActionType 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
void setEnabledOnlyWhenEditable( bool enable );
%Docstring
Set whether the action is only enabled in editable mode
.. versionadded:: 3.16
%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.
%End
void run( const QgsExpressionContext &expressionContext ) const;
%Docstring
Run this action.
%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`
%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.
%End
void readXml( const QDomNode &actionNode );
%Docstring
Reads an XML definition from actionNode into this object.
%End
void writeXml( QDomNode &actionsNode ) const;
%Docstring
Appends an XML definition for this action as a new child node to
actionsNode.
%End
void setExpressionContextScope( const QgsExpressionContextScope &scope );
%Docstring
Sets an expression context scope to use for running the action.
%End
QgsExpressionContextScope expressionContextScope() const;
%Docstring
Returns an expression context scope used for running the action.
%End
QString html( ) const;
%Docstring
Returns an HTML table with the basic information about this action.
.. versionadded:: 3.24
%End
void setCommand( const QString &newCommand );
%Docstring
Sets the action ``command``.
.. versionadded:: 3.26
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/actions/qgsaction.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/