You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
3.3 KiB
115 lines
3.3 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
Copyright (C) 2003 Stephan Binner <binner@kde.org>
|
||
|
Copyright (C) 2003 Zack Rusin <zack@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef KTABBAR_H
|
||
|
#define KTABBAR_H
|
||
|
|
||
15 years ago
|
#include <tqtabbar.h>
|
||
15 years ago
|
|
||
13 years ago
|
#include <tdelibs_export.h>
|
||
15 years ago
|
|
||
15 years ago
|
class TQTimer;
|
||
|
class TQPushButton;
|
||
15 years ago
|
class KTabBarPrivate;
|
||
|
|
||
|
/**
|
||
|
* @since 3.2
|
||
|
*/
|
||
13 years ago
|
class TDEUI_EXPORT KTabBar: public TQTabBar
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
|
public:
|
||
14 years ago
|
KTabBar( TQWidget* parent=0, const char* name=0 );
|
||
15 years ago
|
virtual ~KTabBar();
|
||
|
|
||
|
virtual void setTabEnabled( int, bool );
|
||
|
|
||
15 years ago
|
const TQColor &tabColor( int ) const;
|
||
|
void setTabColor( int, const TQColor& );
|
||
15 years ago
|
|
||
15 years ago
|
virtual int insertTab( TQTab *, int index = -1 );
|
||
|
virtual void removeTab( TQTab * );
|
||
15 years ago
|
|
||
|
void setTabReorderingEnabled( bool enable );
|
||
|
bool isTabReorderingEnabled() const;
|
||
|
|
||
|
void setHoverCloseButton( bool );
|
||
|
bool hoverCloseButton() const;
|
||
|
|
||
|
void setHoverCloseButtonDelayed( bool );
|
||
|
bool hoverCloseButtonDelayed() const;
|
||
|
|
||
|
void setTabCloseActivatePrevious( bool );
|
||
|
bool tabCloseActivatePrevious() const;
|
||
|
|
||
|
signals:
|
||
15 years ago
|
void contextMenu( int, const TQPoint & );
|
||
15 years ago
|
void mouseDoubleClick( int );
|
||
|
void mouseMiddleClick( int );
|
||
|
void initiateDrag( int );
|
||
15 years ago
|
void testCanDecode(const TQDragMoveEvent *e, bool &accept /* result */);
|
||
|
void receivedDropEvent( int, TQDropEvent * );
|
||
15 years ago
|
void moveTab( int, int );
|
||
|
void closeRequest( int );
|
||
14 years ago
|
#ifndef TQT_NO_WHEELEVENT
|
||
15 years ago
|
void wheelDelta( int );
|
||
|
#endif
|
||
|
|
||
|
protected:
|
||
15 years ago
|
virtual void mouseDoubleClickEvent( TQMouseEvent *e );
|
||
|
virtual void mousePressEvent( TQMouseEvent *e );
|
||
|
virtual void mouseMoveEvent( TQMouseEvent *e );
|
||
|
virtual void mouseReleaseEvent( TQMouseEvent *e );
|
||
14 years ago
|
#ifndef TQT_NO_WHEELEVENT
|
||
15 years ago
|
virtual void wheelEvent( TQWheelEvent *e );
|
||
15 years ago
|
#endif
|
||
|
|
||
15 years ago
|
virtual void dragMoveEvent( TQDragMoveEvent *e );
|
||
|
virtual void dropEvent( TQDropEvent *e );
|
||
15 years ago
|
|
||
15 years ago
|
virtual void paintLabel( TQPainter*, const TQRect&, TQTab*, bool ) const;
|
||
15 years ago
|
|
||
|
protected slots:
|
||
|
virtual void closeButtonClicked();
|
||
|
virtual void onLayoutChange();
|
||
|
virtual void enableCloseButton();
|
||
|
virtual void activateDragSwitchTab();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQPoint mDragStart;
|
||
15 years ago
|
int mReorderStartTab;
|
||
|
int mReorderPreviousTab;
|
||
15 years ago
|
TQMap<int, TQColor> mTabColors;
|
||
|
TQTab *mHoverCloseButtonTab, *mDragSwitchTab;
|
||
|
TQPushButton *mHoverCloseButton;
|
||
|
TQTimer *mEnableCloseButtonTimer, *mActivateDragSwitchTabTimer;
|
||
15 years ago
|
|
||
|
bool mHoverCloseButtonEnabled;
|
||
|
bool mHoverCloseButtonDelayed;
|
||
|
bool mTabReorderingEnabled;
|
||
|
bool mTabCloseActivatePrevious;
|
||
|
|
||
|
KTabBarPrivate * d;
|
||
|
};
|
||
|
|
||
|
#endif
|