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

tdeui

  • tdeui
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 <tdelibs_export.h>
28 
29 class KTabWidgetPrivate;
30 
36 class TDEUI_EXPORT KTabWidget : public TQTabWidget
37 {
38  TQ_OBJECT
39  TQ_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
40  TQ_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
41  TQ_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
42  TQ_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
43  TQ_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
44 
45 public:
46  KTabWidget( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
47 
51  virtual ~KTabWidget();
52 
56  void setTabColor( TQWidget *, const TQColor& color );
57 
61  void resetTabColor( TQWidget * );
62 
66  TQColor tabColor( TQWidget * ) const;
67 
72  bool isTabReorderingEnabled() const;
73 
78  bool hoverCloseButton() const;
79 
84  bool hoverCloseButtonDelayed() const;
85 
91  bool tabCloseActivatePrevious() const;
92 
98  bool automaticResizeTabs() const;
99 
105  void setTabBarHidden( bool hide );
106 
111  bool isTabBarHidden() const;
112 
118  void setMouseWheelScroll(bool mouseWheelScroll);
119 
123  virtual void insertTab( TQWidget *, const TQString &, int index = -1 );
124 
128  virtual void insertTab( TQWidget *child, const TQIconSet& iconset,
129  const TQString &label, int index = -1 );
133  virtual void insertTab( TQWidget *, TQTab *, int index = -1 );
134 
138  void changeTab( TQWidget *, const TQString & );
139 
143  void changeTab( TQWidget *child, const TQIconSet& iconset, const TQString &label );
144 
148  TQString label( int ) const;
149 
153  TQString tabLabel( TQWidget * ) const;
154 
158  void setTabLabel( TQWidget *, const TQString & );
159 
160 public slots:
165  virtual void moveTab( int, int );
166 
171  virtual void removePage ( TQWidget * w );
172 
182  void setTabReorderingEnabled( bool enable );
183 
189  void setHoverCloseButton( bool enable );
190 
195  void setHoverCloseButtonDelayed( bool delayed );
196 
202  void setTabCloseActivatePrevious( bool previous );
203 
211  void setAutomaticResizeTabs( bool enable );
212 
213 signals:
217  void testCanDecode(const TQDragMoveEvent *e, bool &accept /* result */);
218 
223  void receivedDropEvent( TQDropEvent * );
224 
229  void receivedDropEvent( TQWidget *, TQDropEvent * );
230 
234  void initiateDrag( TQWidget * );
235 
239  void contextMenu( const TQPoint & );
240 
244  void contextMenu( TQWidget *, const TQPoint & );
245 
250  void movedTab( int, int );
251 
256  void mouseDoubleClick();
257 
261  void mouseDoubleClick( TQWidget * );
262 
266  void mouseMiddleClick();
267 
271  void mouseMiddleClick( TQWidget * );
272 
277  void closeRequest( TQWidget * );
278 
279 protected:
280  virtual void mouseDoubleClickEvent( TQMouseEvent *e );
281  virtual void mousePressEvent( TQMouseEvent * );
282  virtual void dragMoveEvent( TQDragMoveEvent * );
283  virtual void dropEvent( TQDropEvent * );
284  unsigned int tabBarWidthForMaxChars( uint maxLength );
285 #ifndef TQT_NO_WHEELEVENT
286  virtual void wheelEvent( TQWheelEvent *e );
287 #endif
288  virtual void resizeEvent( TQResizeEvent * );
289 
290 protected slots:
291  virtual void receivedDropEvent( int, TQDropEvent * );
292  virtual void initiateDrag( int );
293  virtual void contextMenu( int, const TQPoint & );
294  virtual void mouseDoubleClick( int );
295  virtual void mouseMiddleClick( int );
296  virtual void closeRequest( int );
297 #ifndef TQT_NO_WHEELEVENT
298  virtual void wheelDelta( int );
299 #endif
300 
301 private:
302  bool isEmptyTabbarSpace( const TQPoint & ) const;
303  void resizeTabs( int changedTabIndex = -1 );
304  void updateTab( int index );
305 
306  KTabWidgetPrivate *d;
307 };
308 
309 #endif
KTabWidget
A widget containing multiple tabs.
Definition: ktabwidget.h:37
KTabWidget::receivedDropEvent
void receivedDropEvent(TQWidget *, TQDropEvent *)
KTabWidget::mouseDoubleClick
void mouseDoubleClick()
KTabWidget::receivedDropEvent
void receivedDropEvent(TQDropEvent *)
KTabWidget::contextMenu
void contextMenu(const TQPoint &)
KTabWidget::testCanDecode
void testCanDecode(const TQDragMoveEvent *e, bool &accept)
KTabWidget::movedTab
void movedTab(int, int)
KTabWidget::mouseMiddleClick
void mouseMiddleClick()
KTabWidget::mouseMiddleClick
void mouseMiddleClick(TQWidget *)
KTabWidget::closeRequest
void closeRequest(TQWidget *)
KTabWidget::contextMenu
void contextMenu(TQWidget *, const TQPoint &)
KTabWidget::initiateDrag
void initiateDrag(TQWidget *)
KTabWidget::mouseDoubleClick
void mouseDoubleClick(TQWidget *)

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.