QGIS/python/core/qgsaction.sip

188 lines
4.8 KiB
Plaintext
Raw Normal View History

2017-04-02 11:04:39 +02:00
/************************************************************************
* 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
{
2017-04-02 11:04:39 +02:00
%Docstring
Utility class that encapsulates an action based on vector attributes.
%End
%TypeHeaderCode
2017-04-02 11:04:39 +02:00
#include "qgsaction.h"
%End
public:
enum ActionType
{
Generic,
GenericPython,
Mac,
Windows,
Unix,
OpenUrl,
};
2016-11-03 22:48:19 +01:00
QgsAction();
2017-04-02 11:04:39 +02:00
%Docstring
Default constructor
%End
2017-04-02 11:04:39 +02:00
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false );
%Docstring
Create a new QgsAction
2017-04-03 11:59:45 +10:00
\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
2017-04-02 11:04:39 +02:00
%End
2017-04-02 11:04:39 +02:00
QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>() );
%Docstring
Create a new QgsAction
2017-04-03 11:59:45 +10:00
\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
2017-04-02 11:04:39 +02:00
%End
QString name() const;
2017-04-02 11:04:39 +02:00
%Docstring
The name of the action. This may be a longer description.
:rtype: str
2017-04-02 11:04:39 +02:00
%End
2016-04-29 13:22:11 +02:00
QString shortTitle() const;
2017-04-02 11:04:39 +02:00
%Docstring
The short title is used to label user interface elements like buttons
:rtype: str
2017-04-02 11:04:39 +02:00
%End
2016-04-29 13:22:11 +02:00
2016-11-03 22:48:19 +01:00
QUuid id() const;
2017-04-02 11:04:39 +02:00
%Docstring
Returns a unique id for this action.
.. versionadded:: 3.0
:rtype: QUuid
2017-04-02 11:04:39 +02:00
%End
2016-11-03 19:11:51 +01:00
2016-11-03 22:48:19 +01:00
bool isValid() const;
2017-04-02 11:04:39 +02:00
%Docstring
Returns true if this action was a default constructed one.
.. versionadded:: 3.0
:rtype: bool
2017-04-02 11:04:39 +02:00
%End
2016-11-03 19:11:51 +01:00
QString iconPath() const;
2017-04-02 11:04:39 +02:00
%Docstring
The path to the icon
:rtype: str
2017-04-02 11:04:39 +02:00
%End
QIcon icon() const;
2017-04-02 11:04:39 +02:00
%Docstring
The icon
:rtype: QIcon
2017-04-02 11:04:39 +02:00
%End
QString command() const;
2017-04-02 11:04:39 +02:00
%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
:rtype: str
2017-04-02 11:04:39 +02:00
%End
ActionType type() const;
2017-04-02 11:04:39 +02:00
%Docstring
The action type
:rtype: ActionType
2017-04-02 11:04:39 +02:00
%End
bool capture() const;
2017-04-02 11:04:39 +02:00
%Docstring
Whether to capture output for display when this action is run
:rtype: bool
2017-04-02 11:04:39 +02:00
%End
bool runable() const;
2017-04-02 11:04:39 +02:00
%Docstring
Checks if the action is runable on the current platform
:rtype: bool
2017-04-02 11:04:39 +02:00
%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;
2017-04-02 11:04:39 +02:00
%Docstring
The action scopes define where an action will be available.
Action scopes may offer additional variables like the clicked
coordinate.
2017-04-30 16:51:18 +02:00
.. seealso:: QgsActionScope
2017-04-02 11:04:39 +02:00
.. versionadded:: 3.0
:rtype: set of str
2017-04-02 11:04:39 +02:00
%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
};
2017-04-02 11:04:39 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsaction.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/