• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
  • widgets
tabbar.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Marco Martin <notmart@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef PLASMA_TABBAR_H
21 #define PLASMA_TABBAR_H
22 
23 #include <QtGui/QGraphicsWidget>
24 
25 #include <ktabbar.h>
26 
27 #include <plasma/plasma_export.h>
28 
29 class QString;
30 class QIcon;
31 
32 namespace Plasma
33 {
34 
35 class TabBarPrivate;
36 
46 class PLASMA_EXPORT TabBar : public QGraphicsWidget
47 {
48  Q_OBJECT
49 
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)
57 
58 public:
64  explicit TabBar(QGraphicsWidget *parent = 0);
65  ~TabBar();
66 
78  Q_INVOKABLE int insertTab(int index, const QIcon &icon, const QString &label,
79  QGraphicsLayoutItem *content = 0);
80 
93  Q_INVOKABLE int insertTab(int index, const QString &label, QGraphicsLayoutItem *content = 0);
94 
103  Q_INVOKABLE int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
104 
114  Q_INVOKABLE int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
115 
121  Q_INVOKABLE void removeTab(int index);
122 
129  Q_INVOKABLE QGraphicsLayoutItem *takeTab(int index);
130 
137  Q_INVOKABLE QGraphicsLayoutItem *tabAt(int index);
138 
142  int currentIndex() const;
143 
147  int count() const;
148 
155  Q_INVOKABLE void setTabText(int index, const QString &label);
156 
162  Q_INVOKABLE QString tabText(int index) const;
163 
170  Q_INVOKABLE void setTabIcon(int index, const QIcon &icon);
171 
177  Q_INVOKABLE QIcon tabIcon(int index) const;
178 
187  void setTabBarShown(bool show);
188 
193  bool isTabBarShown() const;
194 
200  void setStyleSheet(const QString &stylesheet);
201 
205  QString styleSheet() const;
206 
213  Q_INVOKABLE void setTabHighlighted(int index, bool highlight);
214 
219  Q_INVOKABLE bool isTabHighlighted(int index) const;
220 
224  KTabBar *nativeWidget() const;
225 
233  void setFirstPositionWidget(QGraphicsWidget *widget);
234 
239  QGraphicsWidget *firstPositionWidget() const;
240 
248  void setLastPositionWidget(QGraphicsWidget *widget);
249 
254  QGraphicsWidget *lastPositionWidget() const;
255 
256 public Q_SLOTS:
262  void setCurrentIndex(int index);
263 
264 Q_SIGNALS:
270  void currentChanged(int index);
271 
272 protected:
273  void wheelEvent(QGraphicsSceneWheelEvent *event);
274  void resizeEvent(QGraphicsSceneResizeEvent * event);
275  void changeEvent(QEvent *event);
276 
277 private:
278  TabBarPrivate * const d;
279 
280  friend class TabBarPrivate;
281 
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())
286 };
287 
288 } // namespace Plasma
289 
290 #endif // multiple inclusion guard
Plasma::TabBar
A tab bar widget, to be used for tabbed interfaces.
Definition: tabbar.h:46
plasma_export.h
QGraphicsWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:34 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal