1// qtabbar.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 QTabBar : QWidget
24{
25%TypeHeaderCode
26#include <qtabbar.h>
27%End
28
29public:
30    explicit QTabBar(QWidget *parent /TransferThis/ = 0);
31    virtual ~QTabBar();
32
33    enum Shape
34    {
35        RoundedNorth,
36        RoundedSouth,
37        RoundedWest,
38        RoundedEast,
39        TriangularNorth,
40        TriangularSouth,
41        TriangularWest,
42        TriangularEast,
43    };
44
45    QTabBar::Shape shape() const;
46    void setShape(QTabBar::Shape shape);
47    int addTab(const QString &text);
48    int addTab(const QIcon &icon, const QString &text);
49    int insertTab(int index, const QString &text);
50    int insertTab(int index, const QIcon &icon, const QString &text);
51    void removeTab(int index);
52    bool isTabEnabled(int index) const;
53    void setTabEnabled(int index, bool);
54    QString tabText(int index) const;
55    void setTabText(int index, const QString &text);
56    QColor tabTextColor(int index) const;
57    void setTabTextColor(int index, const QColor &color);
58    QIcon tabIcon(int index) const;
59    void setTabIcon(int index, const QIcon &icon);
60    void setTabToolTip(int index, const QString &tip);
61    QString tabToolTip(int index) const;
62    void setTabWhatsThis(int index, const QString &text);
63    QString tabWhatsThis(int index) const;
64    void setTabData(int index, const QVariant &data);
65    QVariant tabData(int index) const;
66    int tabAt(const QPoint &pos) const;
67    QRect tabRect(int index) const;
68    int currentIndex() const;
69    int count() const /__len__/;
70    virtual QSize sizeHint() const;
71    virtual QSize minimumSizeHint() const;
72    void setDrawBase(bool drawTheBase);
73    bool drawBase() const;
74    QSize iconSize() const;
75    void setIconSize(const QSize &size);
76    Qt::TextElideMode elideMode() const;
77    void setElideMode(Qt::TextElideMode);
78    void setUsesScrollButtons(bool useButtons);
79    bool usesScrollButtons() const;
80
81public slots:
82    void setCurrentIndex(int index);
83
84signals:
85    void currentChanged(int index);
86
87protected:
88    void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
89    virtual QSize tabSizeHint(int index) const;
90    virtual void tabInserted(int index);
91    virtual void tabRemoved(int index);
92    virtual void tabLayoutChange();
93    virtual bool event(QEvent *);
94    virtual void resizeEvent(QResizeEvent *);
95    virtual void showEvent(QShowEvent *);
96    virtual void paintEvent(QPaintEvent *);
97    virtual void mousePressEvent(QMouseEvent *);
98    virtual void mouseMoveEvent(QMouseEvent *);
99    virtual void mouseReleaseEvent(QMouseEvent *);
100    virtual void keyPressEvent(QKeyEvent *);
101    virtual void changeEvent(QEvent *);
102
103public:
104    enum ButtonPosition
105    {
106        LeftSide,
107        RightSide,
108    };
109
110    enum SelectionBehavior
111    {
112        SelectLeftTab,
113        SelectRightTab,
114        SelectPreviousTab,
115    };
116
117    void moveTab(int from, int to);
118    bool tabsClosable() const;
119    void setTabsClosable(bool closable);
120    void setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget /Transfer/);
121    QWidget *tabButton(int index, QTabBar::ButtonPosition position) const;
122    QTabBar::SelectionBehavior selectionBehaviorOnRemove() const;
123    void setSelectionBehaviorOnRemove(QTabBar::SelectionBehavior behavior);
124    bool expanding() const;
125    void setExpanding(bool enabled);
126    bool isMovable() const;
127    void setMovable(bool movable);
128    bool documentMode() const;
129    void setDocumentMode(bool set);
130
131signals:
132    void tabCloseRequested(int index);
133    void tabMoved(int from, int to);
134
135protected:
136    virtual void hideEvent(QHideEvent *);
137    virtual void wheelEvent(QWheelEvent *event);
138    virtual QSize minimumTabSizeHint(int index) const;
139
140signals:
141%If (Qt_5_2_0 -)
142    void tabBarClicked(int index);
143%End
144%If (Qt_5_2_0 -)
145    void tabBarDoubleClicked(int index);
146%End
147
148public:
149%If (Qt_5_4_0 -)
150    bool autoHide() const;
151%End
152%If (Qt_5_4_0 -)
153    void setAutoHide(bool hide);
154%End
155%If (Qt_5_4_0 -)
156    bool changeCurrentOnDrag() const;
157%End
158%If (Qt_5_4_0 -)
159    void setChangeCurrentOnDrag(bool change);
160%End
161
162protected:
163%If (Qt_5_4_0 -)
164    virtual void timerEvent(QTimerEvent *event);
165%End
166
167public:
168%If (Qt_5_8_0 -)
169%If (PyQt_Accessibility)
170    QString accessibleTabName(int index) const;
171%End
172%End
173%If (Qt_5_8_0 -)
174%If (PyQt_Accessibility)
175    void setAccessibleTabName(int index, const QString &name);
176%End
177%End
178%If (Qt_5_15_0 -)
179    bool isTabVisible(int index) const;
180%End
181%If (Qt_5_15_0 -)
182    void setTabVisible(int index, bool visible);
183%End
184};
185