• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
ktabwidget.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2003 Stephan Binner <binner@kde.org>
3  Copyright (C) 2003 Zack Rusin <zack@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KTABWIDGET_H
22 #define KTABWIDGET_H
23 
24 #include <tqtabwidget.h>
25 #include <tqstringlist.h>
26 
27 #include <kdelibs_export.h>
28 
29 class KTabWidgetPrivate;
30 
36 class KDEUI_EXPORT KTabWidget : public TQTabWidget
37 {
38  Q_OBJECT
39  Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
40  Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
41  Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
42  Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
43  Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
44 
45 public:
46  KTabWidget( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
50  virtual ~KTabWidget();
54  void setTabColor( TQWidget *, const TQColor& color );
58  TQColor tabColor( TQWidget * ) const;
59 
64  bool isTabReorderingEnabled() const;
65 
70  bool hoverCloseButton() const;
71 
76  bool hoverCloseButtonDelayed() const;
77 
83  bool tabCloseActivatePrevious() const;
84 
90  bool automaticResizeTabs() const;
91 
97  void setTabBarHidden( bool hide );
98 
103  bool isTabBarHidden() const;
104 
108  virtual void insertTab( TQWidget *, const TQString &, int index = -1 );
109 
113  virtual void insertTab( TQWidget *child, const TQIconSet& iconset,
114  const TQString &label, int index = -1 );
118  virtual void insertTab( TQWidget *, TQTab *, int index = -1 );
119 
123  void changeTab( TQWidget *, const TQString & );
124 
128  void changeTab( TQWidget *child, const TQIconSet& iconset, const TQString &label );
129 
133  TQString label( int ) const;
134 
138  TQString tabLabel( TQWidget * ) const;
139 
143  void setTabLabel( TQWidget *, const TQString & );
144 
145 public slots:
150  virtual void moveTab( int, int );
151 
156  virtual void removePage ( TQWidget * w );
157 
167  void setTabReorderingEnabled( bool enable );
168 
174  void setHoverCloseButton( bool enable );
175 
180  void setHoverCloseButtonDelayed( bool delayed );
181 
187  void setTabCloseActivatePrevious( bool previous );
188 
196  void setAutomaticResizeTabs( bool enable );
197 
198 signals:
202  void testCanDecode(const TQDragMoveEvent *e, bool &accept /* result */);
203 
208  void receivedDropEvent( TQDropEvent * );
209 
214  void receivedDropEvent( TQWidget *, TQDropEvent * );
215 
219  void initiateDrag( TQWidget * );
220 
224  void contextMenu( const TQPoint & );
225 
229  void contextMenu( TQWidget *, const TQPoint & );
230 
235  void movedTab( int, int );
236 
241  void mouseDoubleClick();
242 
246  void mouseDoubleClick( TQWidget * );
247 
251  void mouseMiddleClick();
252 
256  void mouseMiddleClick( TQWidget * );
257 
262  void closeRequest( TQWidget * );
263 
264 protected:
265  virtual void mouseDoubleClickEvent( TQMouseEvent *e );
266  virtual void mousePressEvent( TQMouseEvent * );
267  virtual void dragMoveEvent( TQDragMoveEvent * );
268  virtual void dropEvent( TQDropEvent * );
269  unsigned int tabBarWidthForMaxChars( uint maxLength );
270 #ifndef QT_NO_WHEELEVENT
271  virtual void wheelEvent( TQWheelEvent *e );
272 #endif
273  virtual void resizeEvent( TQResizeEvent * );
274 
275 protected slots:
276  virtual void receivedDropEvent( int, TQDropEvent * );
277  virtual void initiateDrag( int );
278  virtual void contextMenu( int, const TQPoint & );
279  virtual void mouseDoubleClick( int );
280  virtual void mouseMiddleClick( int );
281  virtual void closeRequest( int );
282 #ifndef QT_NO_WHEELEVENT
283  virtual void wheelDelta( int );
284 #endif
285 
286 private:
287  bool isEmptyTabbarSpace( const TQPoint & ) const;
288  void resizeTabs( int changedTabIndex = -1 );
289  void updateTab( int index );
290 
291  KTabWidgetPrivate *d;
292 };
293 
294 #endif
KTabWidget
A widget containing multiple tabs.
Definition: ktabwidget.h:36

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |