1// qstate.sip generated by MetaSIP
2//
3// This file is part of the QtCore Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QState : QAbstractState
24{
25%TypeHeaderCode
26#include <qstate.h>
27%End
28
29public:
30    enum ChildMode
31    {
32        ExclusiveStates,
33        ParallelStates,
34    };
35
36    enum RestorePolicy
37    {
38        DontRestoreProperties,
39        RestoreProperties,
40    };
41
42    QState(QState *parent /TransferThis/ = 0);
43    QState(QState::ChildMode childMode, QState *parent /TransferThis/ = 0);
44    virtual ~QState();
45    QAbstractState *errorState() const;
46    void setErrorState(QAbstractState *state /KeepReference/);
47    void addTransition(QAbstractTransition *transition /Transfer/);
48    QSignalTransition *addTransition(SIP_PYOBJECT signal /TypeHint="pyqtBoundSignal"/, QAbstractState *target);
49%MethodCode
50        QObject *sender;
51        QByteArray signal_signature;
52
53        if ((sipError = pyqt5_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
54        {
55            sipRes = sipCpp->addTransition(sender, signal_signature.constData(), a1);
56        }
57        else
58        {
59            sipError = sipBadCallableArg(0, a0);
60        }
61%End
62
63    QAbstractTransition *addTransition(QAbstractState *target /Transfer/);
64    void removeTransition(QAbstractTransition *transition /TransferBack/);
65    QList<QAbstractTransition *> transitions() const;
66    QAbstractState *initialState() const;
67    void setInitialState(QAbstractState *state /KeepReference/);
68    QState::ChildMode childMode() const;
69    void setChildMode(QState::ChildMode mode);
70    void assignProperty(QObject *object, const char *name, const QVariant &value);
71
72signals:
73    void finished();
74    void propertiesAssigned();
75
76protected:
77    virtual void onEntry(QEvent *event);
78    virtual void onExit(QEvent *event);
79    virtual bool event(QEvent *e);
80
81signals:
82%If (Qt_5_4_0 -)
83    void childModeChanged();
84%End
85%If (Qt_5_4_0 -)
86    void initialStateChanged();
87%End
88%If (Qt_5_4_0 -)
89    void errorStateChanged();
90%End
91};
92