home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ktabctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.7 KB  |  91 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 1997 Alexander Sanda (alex@darkstar.ping.at)
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19. /*
  20.  * $Id: ktabctl.h 465272 2005-09-29 09:47:40Z mueller $
  21. */
  22.  
  23. #ifndef KTABCTL_H
  24. #define KTABCTL_H
  25.  
  26. #include <qwidget.h>
  27. #include <qtabbar.h>
  28. #include <qmemarray.h>
  29.  
  30. #include <kdelibs_export.h>
  31.  
  32. /**
  33.  * Tabbed dialog with extended features.
  34.  * KTabCtl is very similar to QTabDialog, with the following differences:
  35.  * 
  36.  * @li To avoid confusion, the API is almost identical with QTabDialog.
  37.  * @li Does not create any buttons, therefore KTabCtl is not limited
  38.  * to dialog boxes. You can use it whereever you want.
  39.  * @li emits the signal tabSelected(int pagenumber) when the user
  40.  * selects one of the tabs. This gives you the chance to update the
  41.  * widget contents of a single page. The signal is emitted _before_ the
  42.  * page is shown.  This is very useful if the contents of some widgets
  43.  * on page A depend on the contents of some other widgets on page B.
  44.  *
  45.  * @author Alexander Sanda (alex@darkstar.ping.at)
  46.  * @version $Id: ktabctl.h 465272 2005-09-29 09:47:40Z mueller $
  47. */
  48. class KDEUI_EXPORT KTabCtl : public QWidget
  49. {
  50.     Q_OBJECT
  51.  
  52. public:
  53.     KTabCtl(QWidget *parent = 0, const char *name = 0);
  54.    ~KTabCtl();
  55.  
  56.     void show();
  57.     void setFont(const QFont & font);
  58.     void setTabFont( const QFont &font );
  59.  
  60.     void addTab(QWidget *, const QString&);
  61.     bool isTabEnabled(const QString& );
  62.     void setTabEnabled(const QString&, bool);
  63.     void setBorder(bool);
  64.     void setShape( QTabBar::Shape shape );
  65.     virtual QSize sizeHint() const;
  66.  
  67. protected:
  68.     void paintEvent(QPaintEvent *);
  69.     void resizeEvent(QResizeEvent *);
  70.  
  71. signals:
  72.     void tabSelected(int);
  73.     
  74. protected slots:
  75.     void showTab(int i);
  76.  
  77. protected:
  78.     void setSizes();
  79.     QRect getChildRect() const;
  80.  
  81.     QTabBar * tabs;
  82.     QMemArray<QWidget *> pages;
  83.     int bh;
  84.     bool blBorder;
  85. protected:
  86.     virtual void virtual_hook( int id, void* data );
  87. private:
  88.     class KTabCtrlPrivate* d;
  89. };
  90. #endif
  91.