kdeui Library API Documentation

ktabwidget.h

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., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KTABWIDGET_H
00022 #define KTABWIDGET_H
00023 
00024 #include <qtabwidget.h>
00025 #include <kdelibs_export.h>
00026 
00027 class KTabWidgetPrivate;
00028 
00032 class KDEUI_EXPORT KTabWidget : public QTabWidget
00033 {
00034     Q_OBJECT
00035     Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
00036     Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
00037     Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
00038     Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
00039 
00040 public:
00041     KTabWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00045     virtual ~KTabWidget();
00049     void setTabColor( QWidget *, const QColor& color );
00050     QColor tabColor( QWidget * ) const;
00051 
00056     bool isTabReorderingEnabled() const;
00057 
00062     bool hoverCloseButton() const;
00063 
00068     bool hoverCloseButtonDelayed() const;
00069 
00075     bool tabCloseActivatePrevious() const;
00076 
00077 public slots:
00082     virtual void moveTab( int, int );
00083 
00093     void setTabReorderingEnabled( bool enable );
00094 
00100     void setHoverCloseButton( bool enable );
00101 
00106     void setHoverCloseButtonDelayed( bool delayed );
00107 
00113     void setTabCloseActivatePrevious( bool previous );
00114 
00115 signals:
00119     void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
00120 
00125     void receivedDropEvent( QDropEvent * );
00126 
00131     void receivedDropEvent( QWidget *, QDropEvent * );
00132 
00136     void initiateDrag( QWidget * );
00137 
00141     void contextMenu( const QPoint & );
00142 
00146     void contextMenu( QWidget *, const QPoint & );
00147 
00152     void movedTab( int, int );
00153 
00158     void mouseDoubleClick();
00159 
00163     void mouseDoubleClick( QWidget * );
00164 
00168     void mouseMiddleClick();
00169 
00173     void mouseMiddleClick( QWidget * );
00174 
00179     void closeRequest( QWidget * );
00180 
00181 protected:
00182     virtual void mouseDoubleClickEvent( QMouseEvent *e );
00183     virtual void mousePressEvent( QMouseEvent * );
00184     virtual void dragMoveEvent( QDragMoveEvent * );
00185     virtual void dropEvent( QDropEvent * );
00186 #ifndef QT_NO_WHEELEVENT
00187     virtual void wheelEvent( QWheelEvent *e );
00188 #endif
00189 
00190 protected slots:
00191     virtual void receivedDropEvent( int, QDropEvent * );
00192     virtual void initiateDrag( int );
00193     virtual void contextMenu( int, const QPoint & );
00194     virtual void mouseDoubleClick( int );
00195     virtual void mouseMiddleClick( int );
00196     virtual void closeRequest( int );
00197 #ifndef QT_NO_WHEELEVENT
00198     virtual void wheelDelta( int );
00199 #endif
00200 
00201 private:
00202     bool isEmptyTabbarSpace( const QPoint & )  const;
00203 
00204     KTabWidgetPrivate *d;
00205 };
00206 
00207 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:12:02 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003