~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to python/core/qgsattributeaction.sip

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class QgsAction
 
2
{
 
3
%TypeHeaderCode
 
4
#include "qgsattributeaction.h"
 
5
%End
 
6
 
 
7
  public:
 
8
    enum ActionType
 
9
    {
 
10
      Generic,
 
11
      GenericPython,
 
12
      Mac,
 
13
      Windows,
 
14
      Unix,
 
15
    };
 
16
 
 
17
    QgsAction( ActionType type, QString name, QString action, bool capture );
 
18
 
 
19
    //! The name of the action
 
20
    QString name() const;
 
21
 
 
22
    //! The action
 
23
    QString action() const;
 
24
 
 
25
    //! The action type
 
26
    ActionType type() const;
 
27
 
 
28
    //! Whether to capture output for display when this action is run
 
29
    bool capture() const;
 
30
 
 
31
    bool runable() const;
 
32
};
 
33
 
 
34
class QgsAttributeAction
 
35
{
 
36
%TypeHeaderCode
 
37
#include "qgsattributeaction.h"
 
38
%End
 
39
  public:
 
40
    QgsAttributeAction();
 
41
 
 
42
    //! Destructor
 
43
    virtual ~QgsAttributeAction();
 
44
 
 
45
    //! Add an action with the given name and action details.
 
46
    // Will happily have duplicate names and actions. If
 
47
    // capture is true, when running the action using doAction(),
 
48
    // any stdout from the process will be captured and displayed in a
 
49
    // dialog box.
 
50
    void addAction( QgsAction::ActionType type, QString name, QString action, bool capture = false );
 
51
 
 
52
/*
 
53
    //! Does the action using the given values. defaultValueIndex is an
 
54
    // index into values which indicates which value in the values vector
 
55
    // is to be used if the action has a default placeholder.
 
56
    void doAction( int index, const QList< QPair<QString, QString> > &values,
 
57
                   int defaultValueIndex = 0, void *executePython = 0 );
 
58
 */
 
59
 
 
60
    //! Removes all actions
 
61
    void clearActions();
 
62
 
 
63
    //! Expands the given action, replacing all %'s with the value as
 
64
    // given.
 
65
    static QString expandAction( QString action, const QList< QPair<QString, QString> > &values,
 
66
                                 uint defaultValueIndex );
 
67
 
 
68
    //! Writes the actions out in XML format
 
69
    bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const;
 
70
 
 
71
    //! Reads the actions in in XML format
 
72
    bool readXML( const QDomNode& layer_node );
 
73
 
 
74
    int size() const;
 
75
    QgsAction &at( int idx );
 
76
    QgsAction &operator[]( int idx );
 
77
};