• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

ktabwidget.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2003 Stephan Binner <binner@kde.org>
00003     Copyright (C) 2003 Zack Rusin <zack@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KTABWIDGET_H
00022 #define KTABWIDGET_H
00023 
00024 #include <qtabwidget.h>
00025 #include <qstringlist.h>
00026 
00027 #include <kdelibs_export.h>
00028 
00029 class KTabWidgetPrivate;
00030 
00036 class KDEUI_EXPORT KTabWidget : public QTabWidget
00037 {
00038     Q_OBJECT
00039     Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
00040     Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
00041     Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
00042     Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
00043     Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
00044 
00045 public:
00046     KTabWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00050     virtual ~KTabWidget();
00054     void setTabColor( QWidget *, const QColor& color );
00058     QColor tabColor( QWidget * ) const;
00059 
00064     bool isTabReorderingEnabled() const;
00065 
00070     bool hoverCloseButton() const;
00071 
00076     bool hoverCloseButtonDelayed() const;
00077 
00083     bool tabCloseActivatePrevious() const;
00084 
00090     bool automaticResizeTabs() const;
00091 
00097     void setTabBarHidden( bool hide );
00098 
00103     bool isTabBarHidden() const;
00104 
00108     virtual void insertTab( QWidget *, const QString &, int index = -1 );
00109 
00113     virtual void insertTab( QWidget *child, const QIconSet& iconset,
00114                             const QString &label, int index = -1 );
00118     virtual void insertTab( QWidget *, QTab *, int index = -1 );
00119 
00123     void changeTab( QWidget *, const QString & );
00124 
00128     void changeTab( QWidget *child, const QIconSet& iconset, const QString &label );
00129 
00133     QString label( int ) const;
00134 
00138     QString tabLabel( QWidget * ) const;
00139 
00143     void setTabLabel( QWidget *, const QString & );
00144 
00145 public slots:
00150     virtual void moveTab( int, int );
00151 
00156     virtual void removePage ( QWidget * w );
00157 
00167     void setTabReorderingEnabled( bool enable );
00168 
00174     void setHoverCloseButton( bool enable );
00175 
00180     void setHoverCloseButtonDelayed( bool delayed );
00181 
00187     void setTabCloseActivatePrevious( bool previous );
00188 
00196     void setAutomaticResizeTabs( bool enable );
00197 
00198 signals:
00202     void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
00203 
00208     void receivedDropEvent( QDropEvent * );
00209 
00214     void receivedDropEvent( QWidget *, QDropEvent * );
00215 
00219     void initiateDrag( QWidget * );
00220 
00224     void contextMenu( const QPoint & );
00225 
00229     void contextMenu( QWidget *, const QPoint & );
00230 
00235     void movedTab( int, int );
00236 
00241     void mouseDoubleClick();
00242 
00246     void mouseDoubleClick( QWidget * );
00247 
00251     void mouseMiddleClick();
00252 
00256     void mouseMiddleClick( QWidget * );
00257 
00262     void closeRequest( QWidget * );
00263 
00264 protected:
00265     virtual void mouseDoubleClickEvent( QMouseEvent *e );
00266     virtual void mousePressEvent( QMouseEvent * );
00267     virtual void dragMoveEvent( QDragMoveEvent * );
00268     virtual void dropEvent( QDropEvent * );
00269     unsigned int tabBarWidthForMaxChars( uint maxLength );
00270 #ifndef QT_NO_WHEELEVENT
00271     virtual void wheelEvent( QWheelEvent *e );
00272 #endif
00273     virtual void resizeEvent( QResizeEvent * );
00274 
00275 protected slots:
00276     virtual void receivedDropEvent( int, QDropEvent * );
00277     virtual void initiateDrag( int );
00278     virtual void contextMenu( int, const QPoint & );
00279     virtual void mouseDoubleClick( int );
00280     virtual void mouseMiddleClick( int );
00281     virtual void closeRequest( int );
00282 #ifndef QT_NO_WHEELEVENT
00283     virtual void wheelDelta( int );
00284 #endif
00285 
00286 private:
00287     bool isEmptyTabbarSpace( const QPoint & )  const;
00288     void resizeTabs( int changedTabIndex = -1 );
00289     void updateTab( int index );
00290 
00291     KTabWidgetPrivate *d;
00292 };
00293 
00294 #endif

kdeui

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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