mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-03 00:14:12 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			245 lines
		
	
	
		
			6.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			245 lines
		
	
	
		
			6.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * 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(signature="appended")
 | 
						|
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,
 | 
						|
      SubmitUrlEncoded,
 | 
						|
      SubmitUrlMultipart,
 | 
						|
    };
 | 
						|
 | 
						|
    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
 | 
						|
%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 ¬ificationMessage = 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, 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 ¬ificationMessage = 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.
 | 
						|
 | 
						|
.. 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 :py:func:`~QgsAction.type` and
 | 
						|
the :py:func:`~QgsAction.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
 | 
						|
 | 
						|
    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.
 | 
						|
 | 
						|
.. 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
 | 
						|
 | 
						|
    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/qgsaction.h                                                 *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | 
						|
 ************************************************************************/
 |