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 
00026 class KTabWidgetPrivate;
00027 
00031 class KTabWidget : public QTabWidget
00032 {
00033     Q_OBJECT
00034     Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
00035     Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
00036     Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
00037 
00038 public:
00039     KTabWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00043     virtual ~KTabWidget();
00047     void setTabColor( QWidget *, const QColor& color );
00048     QColor tabColor( QWidget * ) const;
00049 
00054     bool isTabReorderingEnabled() const;
00055 
00060     bool hoverCloseButton() const;
00061 
00066     bool hoverCloseButtonDelayed() const;
00067 
00068 public slots:
00073     virtual void moveTab( int, int );
00074 
00084     void setTabReorderingEnabled( bool enable );
00085 
00091     void setHoverCloseButton( bool enable );
00092 
00097     void setHoverCloseButtonDelayed( bool delayed );
00098 
00099 
00100 
00101 signals:
00105     void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
00106 
00111     void receivedDropEvent( QDropEvent * );
00112 
00117     void receivedDropEvent( QWidget *, QDropEvent * );
00118 
00122     void initiateDrag( QWidget * );
00123 
00127     void contextMenu( const QPoint & );
00128 
00132     void contextMenu( QWidget *, const QPoint & );
00133 
00138     void movedTab( int, int );
00139 
00143     void mouseDoubleClick( QWidget * );
00144 
00148     void mouseMiddleClick();
00149 
00153     void mouseMiddleClick( QWidget * );
00154 
00159     void closeRequest( QWidget * );
00160 
00161 protected:
00162     virtual void mousePressEvent( QMouseEvent * );
00163     virtual void dragMoveEvent( QDragMoveEvent * );
00164     virtual void dropEvent( QDropEvent * );
00165 
00166 protected slots:
00167     virtual void receivedDropEvent( int, QDropEvent * );
00168     virtual void initiateDrag( int );
00169     virtual void contextMenu( int, const QPoint & );
00170     virtual void mouseDoubleClick( int );
00171     virtual void mouseMiddleClick( int );
00172     virtual void closeRequest( int );
00173 
00174 private:
00175     bool isEmptyTabbarSpace( const QPoint & )  const;
00176 
00177     KTabWidgetPrivate *d;
00178 };
00179 
00180 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Mar 4 22:43:54 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003