1// qaction.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets 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 QAction : QObject
24{
25%TypeHeaderCode
26#include <qaction.h>
27%End
28
29public:
30%If (Qt_5_7_0 -)
31    explicit QAction(QObject *parent /TransferThis/ = 0);
32%End
33%If (- Qt_5_7_0)
34    explicit QAction(QObject *parent /TransferThis/);
35%End
36%If (Qt_5_7_0 -)
37    QAction(const QString &text, QObject *parent /TransferThis/ = 0);
38%End
39%If (- Qt_5_7_0)
40    QAction(const QString &text, QObject *parent /TransferThis/);
41%End
42%If (Qt_5_7_0 -)
43    QAction(const QIcon &icon, const QString &text, QObject *parent /TransferThis/ = 0);
44%End
45%If (- Qt_5_7_0)
46    QAction(const QIcon &icon, const QString &text, QObject *parent /TransferThis/);
47%End
48    virtual ~QAction();
49    void setActionGroup(QActionGroup *group /KeepReference/);
50    QActionGroup *actionGroup() const;
51    void setIcon(const QIcon &icon);
52    QIcon icon() const;
53    void setText(const QString &text);
54    QString text() const;
55    void setIconText(const QString &text);
56    QString iconText() const;
57    void setToolTip(const QString &tip);
58    QString toolTip() const;
59    void setStatusTip(const QString &statusTip);
60    QString statusTip() const;
61    void setWhatsThis(const QString &what);
62    QString whatsThis() const;
63    QMenu *menu() const;
64    void setMenu(QMenu *menu /KeepReference/);
65    void setSeparator(bool b);
66    bool isSeparator() const;
67    void setShortcut(const QKeySequence &shortcut);
68    QKeySequence shortcut() const;
69    void setShortcutContext(Qt::ShortcutContext context);
70    Qt::ShortcutContext shortcutContext() const;
71    void setFont(const QFont &font);
72    QFont font() const;
73    void setCheckable(bool);
74    bool isCheckable() const;
75    QVariant data() const;
76    void setData(const QVariant &var);
77    bool isChecked() const;
78    bool isEnabled() const;
79    bool isVisible() const;
80
81    enum ActionEvent
82    {
83        Trigger,
84        Hover,
85    };
86
87    void activate(QAction::ActionEvent event);
88    bool showStatusText(QWidget *widget = 0);
89    QWidget *parentWidget() const;
90
91protected:
92    virtual bool event(QEvent *);
93
94public slots:
95    void trigger();
96    void hover();
97    void setChecked(bool);
98    void toggle();
99    void setEnabled(bool);
100    void setDisabled(bool b);
101    void setVisible(bool);
102
103signals:
104    void changed();
105    void triggered(bool checked = false);
106    void hovered();
107    void toggled(bool);
108
109public:
110    enum MenuRole
111    {
112        NoRole,
113        TextHeuristicRole,
114        ApplicationSpecificRole,
115        AboutQtRole,
116        AboutRole,
117        PreferencesRole,
118        QuitRole,
119    };
120
121    void setShortcuts(const QList<QKeySequence> &shortcuts);
122    void setShortcuts(QKeySequence::StandardKey);
123    QList<QKeySequence> shortcuts() const;
124    void setAutoRepeat(bool);
125    bool autoRepeat() const;
126    void setMenuRole(QAction::MenuRole menuRole);
127    QAction::MenuRole menuRole() const;
128    QList<QWidget *> associatedWidgets() const;
129    QList<QGraphicsWidget *> associatedGraphicsWidgets() const;
130    void setIconVisibleInMenu(bool visible);
131    bool isIconVisibleInMenu() const;
132
133    enum Priority
134    {
135        LowPriority,
136        NormalPriority,
137        HighPriority,
138    };
139
140    void setPriority(QAction::Priority priority);
141    QAction::Priority priority() const;
142%If (Qt_5_10_0 -)
143    void setShortcutVisibleInContextMenu(bool show);
144%End
145%If (Qt_5_10_0 -)
146    bool isShortcutVisibleInContextMenu() const;
147%End
148};
149