• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • 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)
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 
00056 public:
00062     explicit TabBar(QGraphicsWidget *parent = 0);
00063     ~TabBar();
00064 
00076     Q_INVOKABLE int insertTab(int index, const QIcon &icon, const QString &label,
00077                   QGraphicsLayoutItem *content = 0);
00078 
00091     Q_INVOKABLE int insertTab(int index, const QString &label, QGraphicsLayoutItem *content = 0);
00092 
00101     Q_INVOKABLE int addTab(const QIcon &icon, const QString &label, QGraphicsLayoutItem *content = 0);
00102 
00112     Q_INVOKABLE int addTab(const QString &label, QGraphicsLayoutItem *content = 0);
00113 
00119     Q_INVOKABLE void removeTab(int index);
00120     
00127     Q_INVOKABLE QGraphicsLayoutItem *takeTab(int index);
00128 
00135     Q_INVOKABLE QGraphicsLayoutItem *tabAt(int index);
00136 
00140     int currentIndex() const;
00141 
00145     int count() const;
00146 
00153     Q_INVOKABLE void setTabText(int index, const QString &label);
00154 
00160     Q_INVOKABLE QString tabText(int index) const;
00161 
00168     Q_INVOKABLE void setTabIcon(int index, const QIcon &icon);
00169 
00175     Q_INVOKABLE QIcon tabIcon(int index) const;
00176 
00185      void setTabBarShown(bool show);
00186 
00191      bool isTabBarShown() const;
00192 
00198     void setStyleSheet(const QString &stylesheet);
00199 
00203     QString styleSheet() const;
00204 
00208     KTabBar *nativeWidget() const;
00209 
00210 public Q_SLOTS:
00216     void setCurrentIndex(int index);
00217 
00218 Q_SIGNALS:
00224     void currentChanged(int index);
00225 
00226 protected:
00227     void wheelEvent(QGraphicsSceneWheelEvent *event);
00228     void resizeEvent(QGraphicsSceneResizeEvent * event);
00229     void changeEvent(QEvent *event);
00230 private:
00231     TabBarPrivate * const d;
00232     
00233     friend class TabBarPrivate;
00234 
00235     Q_PRIVATE_SLOT(d, void slidingCompleted(QGraphicsItem *item))
00236     Q_PRIVATE_SLOT(d, void shapeChanged(const QTabBar::Shape shape))
00237     Q_PRIVATE_SLOT(d, void setPalette())
00238 };
00239 
00240 } // namespace Plasma
00241 
00242 #endif // multiple inclusion guard

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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