KDEUI
ktabbar.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 Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KTABBAR_H 00023 #define KTABBAR_H 00024 00025 #include <kdeui_export.h> 00026 00027 #include <QtGui/QTabBar> 00028 00034 class KDEUI_EXPORT KTabBar: public QTabBar //krazy:exclude=qclasses 00035 { 00036 Q_OBJECT 00037 00038 public: 00044 explicit KTabBar( QWidget* parent = 0 ); 00045 00049 virtual ~KTabBar(); 00050 00062 #ifndef KDE_NO_DEPRECATED 00063 KDE_DEPRECATED void setTabReorderingEnabled( bool enable ); 00064 #endif 00065 00071 #ifndef KDE_NO_DEPRECATED 00072 KDE_DEPRECATED bool isTabReorderingEnabled() const; 00073 #endif 00074 00083 #ifndef KDE_NO_DEPRECATED 00084 KDE_DEPRECATED void setHoverCloseButton( bool ); 00085 #endif 00086 00088 #ifndef KDE_NO_DEPRECATED 00089 KDE_DEPRECATED bool hoverCloseButton() const; 00090 #endif 00091 00099 #ifndef KDE_NO_DEPRECATED 00100 KDE_DEPRECATED void setHoverCloseButtonDelayed( bool ); 00101 #endif 00102 00104 #ifndef KDE_NO_DEPRECATED 00105 KDE_DEPRECATED bool hoverCloseButtonDelayed() const; 00106 #endif 00107 00117 #ifndef KDE_NO_DEPRECATED 00118 KDE_DEPRECATED void setCloseButtonEnabled( bool ); 00119 #endif 00120 00128 #ifndef KDE_NO_DEPRECATED 00129 KDE_DEPRECATED bool isCloseButtonEnabled() const; 00130 #endif 00131 00139 #ifndef KDE_NO_DEPRECATED 00140 KDE_DEPRECATED void setTabCloseActivatePrevious( bool ); 00141 #endif 00142 00149 #ifndef KDE_NO_DEPRECATED 00150 KDE_DEPRECATED bool tabCloseActivatePrevious() const; 00151 #endif 00152 00159 int selectTab( const QPoint &position ) const; 00160 00161 Q_SIGNALS: 00166 void contextMenu( int index, const QPoint& globalPos ); 00171 void emptyAreaContextMenu( const QPoint& globalPos ); 00173 #ifndef KDE_NO_DEPRECATED 00174 QT_MOC_COMPAT void mouseDoubleClick( int ); 00175 #endif 00176 00180 void tabDoubleClicked( int index ); 00185 void newTabRequest(); 00190 void mouseMiddleClick( int index ); 00191 void initiateDrag( int ); 00192 void testCanDecode( const QDragMoveEvent*, bool& ); 00193 void receivedDropEvent( int, QDropEvent* ); 00198 void moveTab( int, int ); 00200 #ifndef KDE_NO_DEPRECATED 00201 QT_MOC_COMPAT void closeRequest( int ); 00202 #endif 00203 #ifndef QT_NO_WHEELEVENT 00204 void wheelDelta( int ); 00205 #endif 00206 00207 protected: 00208 virtual void mouseDoubleClickEvent( QMouseEvent *event ); 00209 virtual void mousePressEvent( QMouseEvent *event ); 00210 virtual void mouseMoveEvent( QMouseEvent *event ); 00211 virtual void mouseReleaseEvent( QMouseEvent *event ); 00212 #ifndef QT_NO_WHEELEVENT 00213 virtual void wheelEvent( QWheelEvent *event ); 00214 #endif 00215 00216 virtual void dragEnterEvent( QDragEnterEvent *event ); 00217 virtual void dragMoveEvent( QDragMoveEvent *event ); 00218 virtual void dropEvent( QDropEvent *event ); 00219 00220 virtual void paintEvent( QPaintEvent *event ); 00221 virtual void leaveEvent( QEvent *event ); 00222 virtual QSize tabSizeHint( int index ) const; 00223 00224 protected Q_SLOTS: 00226 #ifndef KDE_NO_DEPRECATED 00227 QT_MOC_COMPAT void closeButtonClicked(); 00228 #endif 00229 00230 #ifndef KDE_NO_DEPRECATED 00231 QT_MOC_COMPAT void enableCloseButton(); 00232 #endif 00233 virtual void activateDragSwitchTab(); 00234 00235 protected: 00236 virtual void tabLayoutChange(); 00237 00238 private: 00239 QPoint closeButtonPos( int tabIndex ) const; 00240 QRect closeButtonRect( int tabIndex ) const; 00241 00242 private: 00243 class Private; 00244 Private* const d; 00245 }; 00246 00247 #endif
KDE 4.6 API Reference