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

Plasma

tabbar.h
Go to the documentation of this file.
00001 /*
00002  *   Copyright 2008 Marco Martin <notmart@gmail.com>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #ifndef PLASMA_TABBAR_H
00021 #define PLASMA_TABBAR_H
00022 
00023 #include <QtGui/QGraphicsWidget>
00024 
00025 #include <ktabbar.h>
00026 
00027 #include <plasma/plasma_export.h>
00028 
00029 class QString;
00030 class QIcon;
00031 
00032 namespace Plasma
00033 {
00034 
00035 class TabBarPrivate;
00036 
00046 class PLASMA_EXPORT TabBar : public QGraphicsWidget
00047 {
00048     Q_OBJECT
00049 
00050     Q_PROPERTY(KTabBar *nativeWidget READ nativeWidget)
00051     Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
00052     Q_PROPERTY(int count READ count)
00053     Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00054     Q_PROPERTY(bool tabBarShown READ isTabBarShown WRITE setTabBarShown)
00055     Q_PROPERTY(QGraphicsWidget *firstPositionWidget READ firstPositionWidget WRITE setFirstPositionWidget)
00056     Q_PROPERTY(QGraphicsWidget *lastPositionWidget READ lastPositionWidget WRITE setLastPositionWidget)
00057 
00058 public:
00064     explicit TabBar(QGraphicsWidget *parent = 0);
00065     ~TabBar();
00066 
00078     Q_INVOKABLE int insertTab(int index, const QIcon &icon, const QString &label,
00079                               QGraphicsLayoutItem *content = 0);
00080 
00093     Q_INVOKABLE int insertTab(int index, const QString &label, QGraphicsLayoutItem *content = 0);
00094 
00103     Q_INVOKABLE int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
00104 
00114     Q_INVOKABLE int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
00115 
00121     Q_INVOKABLE void removeTab(int index);
00122 
00129     Q_INVOKABLE QGraphicsLayoutItem *takeTab(int index);
00130 
00137     Q_INVOKABLE QGraphicsLayoutItem *tabAt(int index);
00138 
00142     int currentIndex() const;
00143 
00147     int count() const;
00148 
00155     Q_INVOKABLE void setTabText(int index, const QString &label);
00156 
00162     Q_INVOKABLE QString tabText(int index) const;
00163 
00170     Q_INVOKABLE void setTabIcon(int index, const QIcon &icon);
00171 
00177     Q_INVOKABLE QIcon tabIcon(int index) const;
00178 
00187      void setTabBarShown(bool show);
00188 
00193      bool isTabBarShown() const;
00194 
00200     void setStyleSheet(const QString &stylesheet);
00201 
00205     QString styleSheet() const;
00206 
00213     Q_INVOKABLE void setTabHighlighted(int index, bool highlight);
00214 
00219     Q_INVOKABLE bool isTabHighlighted(int index) const;
00220 
00224     KTabBar *nativeWidget() const;
00225 
00233     void setFirstPositionWidget(QGraphicsWidget *widget);
00234 
00239     QGraphicsWidget *firstPositionWidget() const;
00240 
00248     void setLastPositionWidget(QGraphicsWidget *widget);
00249 
00254     QGraphicsWidget *lastPositionWidget() const;
00255 
00256 public Q_SLOTS:
00262     void setCurrentIndex(int index);
00263 
00264 Q_SIGNALS:
00270     void currentChanged(int index);
00271 
00272 protected:
00273     void wheelEvent(QGraphicsSceneWheelEvent *event);
00274     void resizeEvent(QGraphicsSceneResizeEvent * event);
00275     void changeEvent(QEvent *event);
00276 
00277 private:
00278     TabBarPrivate * const d;
00279 
00280     friend class TabBarPrivate;
00281 
00282     Q_PRIVATE_SLOT(d, void slidingNewPageCompleted())
00283     Q_PRIVATE_SLOT(d, void slidingOldPageCompleted())
00284     Q_PRIVATE_SLOT(d, void shapeChanged(const QTabBar::Shape shape))
00285     Q_PRIVATE_SLOT(d, void setPalette())
00286 };
00287 
00288 } // namespace Plasma
00289 
00290 #endif // multiple inclusion guard

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

Skip menu "kdelibs"
  • 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal