20 #ifndef PLASMA_TABBAR_H
21 #define PLASMA_TABBAR_H
23 #include <QtGui/QGraphicsWidget>
50 Q_PROPERTY(KTabBar *nativeWidget READ nativeWidget)
51 Q_PROPERTY(
int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
52 Q_PROPERTY(
int count READ count)
53 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
54 Q_PROPERTY(
bool tabBarShown READ isTabBarShown WRITE setTabBarShown)
55 Q_PROPERTY(
QGraphicsWidget *firstPositionWidget READ firstPositionWidget WRITE setFirstPositionWidget)
56 Q_PROPERTY(
QGraphicsWidget *lastPositionWidget READ lastPositionWidget WRITE setLastPositionWidget)
78 Q_INVOKABLE
int insertTab(
int index, const QIcon &icon, const QString &label,
79 QGraphicsLayoutItem *content = 0);
93 Q_INVOKABLE
int insertTab(
int index, const QString &label, QGraphicsLayoutItem *content = 0);
103 Q_INVOKABLE
int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
114 Q_INVOKABLE
int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
121 Q_INVOKABLE
void removeTab(
int index);
129 Q_INVOKABLE QGraphicsLayoutItem *takeTab(
int index);
137 Q_INVOKABLE QGraphicsLayoutItem *tabAt(
int index);
142 int currentIndex() const;
155 Q_INVOKABLE
void setTabText(
int index, const QString &label);
162 Q_INVOKABLE QString tabText(
int index) const;
170 Q_INVOKABLE
void setTabIcon(
int index, const QIcon &icon);
177 Q_INVOKABLE QIcon tabIcon(
int index) const;
187 void setTabBarShown(
bool show);
193 bool isTabBarShown() const;
200 void setStyleSheet(const QString &stylesheet);
205 QString styleSheet() const;
213 Q_INVOKABLE
void setTabHighlighted(
int index,
bool highlight);
219 Q_INVOKABLE
bool isTabHighlighted(
int index) const;
224 KTabBar *nativeWidget() const;
262 void setCurrentIndex(
int index);
270 void currentChanged(
int index);
273 void wheelEvent(QGraphicsSceneWheelEvent *event);
274 void resizeEvent(QGraphicsSceneResizeEvent * event);
275 void changeEvent(QEvent *event);
278 TabBarPrivate * const d;
280 friend class TabBarPrivate;
282 Q_PRIVATE_SLOT(d,
void slidingNewPageCompleted())
283 Q_PRIVATE_SLOT(d,
void slidingOldPageCompleted())
284 Q_PRIVATE_SLOT(d,
void shapeChanged(const QTabBar::Shape shape))
285 Q_PRIVATE_SLOT(d,
void setPalette())
290 #endif // multiple inclusion guard
A tab bar widget, to be used for tabbed interfaces.