kdeui
ktabbar.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KTABBAR_H
00022 #define KTABBAR_H
00023
00024 #include <qtabbar.h>
00025
00026 #include <kdelibs_export.h>
00027
00028 class QTimer;
00029 class QPushButton;
00030 class KTabBarPrivate;
00031
00035 class KDEUI_EXPORT KTabBar: public QTabBar
00036 {
00037 Q_OBJECT
00038
00039 public:
00040 KTabBar( QWidget* parent=0, const char* name=0 );
00041 virtual ~KTabBar();
00042
00043 virtual void setTabEnabled( int, bool );
00044
00045 const QColor &tabColor( int ) const;
00046 void setTabColor( int, const QColor& );
00047
00048 virtual int insertTab( QTab *, int index = -1 );
00049 virtual void removeTab( QTab * );
00050
00051 void setTabReorderingEnabled( bool enable );
00052 bool isTabReorderingEnabled() const;
00053
00054 void setHoverCloseButton( bool );
00055 bool hoverCloseButton() const;
00056
00057 void setHoverCloseButtonDelayed( bool );
00058 bool hoverCloseButtonDelayed() const;
00059
00060 void setTabCloseActivatePrevious( bool );
00061 bool tabCloseActivatePrevious() const;
00062
00063 signals:
00064 void contextMenu( int, const QPoint & );
00065 void mouseDoubleClick( int );
00066 void mouseMiddleClick( int );
00067 void initiateDrag( int );
00068 void testCanDecode(const QDragMoveEvent *e, bool &accept );
00069 void receivedDropEvent( int, QDropEvent * );
00070 void moveTab( int, int );
00071 void closeRequest( int );
00072 #ifndef QT_NO_WHEELEVENT
00073 void wheelDelta( int );
00074 #endif
00075
00076 protected:
00077 virtual void mouseDoubleClickEvent( QMouseEvent *e );
00078 virtual void mousePressEvent( QMouseEvent *e );
00079 virtual void mouseMoveEvent( QMouseEvent *e );
00080 virtual void mouseReleaseEvent( QMouseEvent *e );
00081 #ifndef QT_NO_WHEELEVENT
00082 virtual void wheelEvent( QWheelEvent *e );
00083 #endif
00084
00085 virtual void dragMoveEvent( QDragMoveEvent *e );
00086 virtual void dropEvent( QDropEvent *e );
00087
00088 virtual void paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
00089
00090 protected slots:
00091 virtual void closeButtonClicked();
00092 virtual void onLayoutChange();
00093 virtual void enableCloseButton();
00094 virtual void activateDragSwitchTab();
00095
00096 private:
00097 QPoint mDragStart;
00098 int mReorderStartTab;
00099 int mReorderPreviousTab;
00100 QMap<int, QColor> mTabColors;
00101 QTab *mHoverCloseButtonTab, *mDragSwitchTab;
00102 QPushButton *mHoverCloseButton;
00103 QTimer *mEnableCloseButtonTimer, *mActivateDragSwitchTabTimer;
00104
00105 bool mHoverCloseButtonEnabled;
00106 bool mHoverCloseButtonDelayed;
00107 bool mTabReorderingEnabled;
00108 bool mTabCloseActivatePrevious;
00109
00110 KTabBarPrivate * d;
00111 };
00112
00113 #endif