home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / qtabwidget.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  5KB  |  158 lines

  1. /****************************************************************************
  2. ** $Id:  qt/qtabwidget.h   3.0.0   edited Oct 4 14:03 $
  3. **
  4. ** Definition of QTabWidget class
  5. **
  6. ** Created : 990318
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the widgets module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QTABWIDGET_H
  39. #define QTABWIDGET_H
  40.  
  41. #ifndef QT_H
  42. #include "qwidget.h"
  43. #include "qiconset.h"
  44. #endif // QT_H
  45.  
  46. #ifndef QT_NO_TABWIDGET
  47.  
  48. class QTabBar;
  49. class QTabWidgetData;
  50. class QTab;
  51. class QWidgetStack;
  52.  
  53.  
  54. class Q_EXPORT QTabWidget : public QWidget
  55. {
  56.     Q_OBJECT
  57.     Q_ENUMS( TabPosition )
  58.     Q_ENUMS( TabShape )
  59.     Q_PROPERTY( TabPosition tabPosition READ tabPosition WRITE setTabPosition )
  60.     Q_PROPERTY( TabShape tabShape READ tabShape WRITE setTabShape )
  61.     Q_PROPERTY( int margin READ margin WRITE setMargin )
  62.     Q_PROPERTY( int currentPage READ currentPageIndex WRITE setCurrentPage )
  63.     Q_PROPERTY( int count READ count )
  64.     Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true )
  65.  
  66. public:
  67.     QTabWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
  68.     ~QTabWidget();
  69.  
  70.     virtual void addTab( QWidget *, const QString & );
  71.     virtual void addTab( QWidget *child, const QIconSet& iconset,
  72.              const QString &label );
  73.     virtual void addTab( QWidget *, QTab* );
  74.  
  75.     virtual void insertTab( QWidget *, const QString &, int index = -1 );
  76.     virtual void insertTab( QWidget *child, const QIconSet& iconset,
  77.                 const QString &label, int index = -1 );
  78.     virtual void insertTab( QWidget *, QTab*, int index = -1 );
  79.  
  80.     void changeTab( QWidget *, const QString &);
  81.     void changeTab( QWidget *child, const QIconSet& iconset,
  82.             const QString &label );
  83.  
  84.     bool isTabEnabled(  QWidget * ) const;
  85.     void setTabEnabled( QWidget *, bool );
  86.  
  87.     QString tabLabel( QWidget * ) const;
  88.     void setTabLabel( QWidget *p, const QString &l );
  89.  
  90.     QIconSet tabIconSet( QWidget * w ) const;
  91.     void setTabIconSet( QWidget * w, const QIconSet & iconset );
  92.  
  93.     void removeTabToolTip( QWidget * w );
  94.     void setTabToolTip( QWidget * w, const QString & tip );
  95.     QString tabToolTip( QWidget * w ) const;
  96.  
  97.     QWidget * currentPage() const;
  98.     QWidget *page( int ) const;
  99.     QString label( int ) const;
  100.     int currentPageIndex() const;
  101.     int indexOf( QWidget * ) const;
  102.  
  103.     QSize sizeHint() const;
  104.     QSize minimumSizeHint() const;
  105.  
  106.     enum TabPosition { Top, Bottom };
  107.     TabPosition tabPosition() const;
  108.     void setTabPosition( TabPosition );
  109.  
  110.     enum TabShape { Rounded, Triangular };
  111.     TabShape tabShape() const;
  112.     void setTabShape( TabShape s );
  113.  
  114.     int margin() const;
  115.     void setMargin( int );
  116.  
  117.     int count() const;
  118.  
  119. public slots:
  120.     void setCurrentPage( int );
  121.     virtual void showPage( QWidget * );
  122.     virtual void removePage( QWidget * );
  123.  
  124. protected:
  125.     void showEvent( QShowEvent * );
  126.     void resizeEvent( QResizeEvent * );
  127.     void setTabBar( QTabBar * );
  128.     QTabBar* tabBar() const;
  129.     void styleChange( QStyle& );
  130.     void updateMask();
  131.     bool eventFilter( QObject *, QEvent * );
  132.  
  133. signals:
  134.     void currentChanged( QWidget * );
  135. #ifndef Q_QDOC
  136.     void selected( const QString& );
  137. #endif
  138.  
  139. private slots:
  140.     void showTab( int i );
  141.  
  142. private:
  143.     QTabWidgetData *d;
  144.     void setUpLayout( bool = FALSE );
  145.  
  146.     friend class QTabDialog;
  147.  
  148. private:    // Disabled copy constructor and operator=
  149. #if defined(Q_DISABLE_COPY)
  150.     QTabWidget( const QTabWidget & );
  151.     QTabWidget& operator=( const QTabWidget & );
  152. #endif
  153. };
  154.  
  155. #endif // QT_NO_TABWIDGET
  156.  
  157. #endif // QTABWIDGET_H
  158.