| 1 | /****************************************************************************
 | 
|---|
| 2 | ** $Id: qtabdialog.h 2 2005-11-16 15:49:26Z dmik $
 | 
|---|
| 3 | **
 | 
|---|
| 4 | ** Definition of QTabDialog class
 | 
|---|
| 5 | **
 | 
|---|
| 6 | ** Created : 960825
 | 
|---|
| 7 | **
 | 
|---|
| 8 | ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
 | 
|---|
| 9 | **
 | 
|---|
| 10 | ** This file is part of the dialogs 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 QTABDIALOG_H
 | 
|---|
| 39 | #define QTABDIALOG_H
 | 
|---|
| 40 | 
 | 
|---|
| 41 | #ifndef QT_H
 | 
|---|
| 42 | #include "qdialog.h"
 | 
|---|
| 43 | #include "qiconset.h"
 | 
|---|
| 44 | #endif // QT_H
 | 
|---|
| 45 | 
 | 
|---|
| 46 | #ifndef QT_NO_TABDIALOG
 | 
|---|
| 47 | 
 | 
|---|
| 48 | class  QTabBar;
 | 
|---|
| 49 | class  QTab;
 | 
|---|
| 50 | class  QTabDialogPrivate;
 | 
|---|
| 51 | 
 | 
|---|
| 52 | class Q_EXPORT QTabDialog : public QDialog
 | 
|---|
| 53 | {
 | 
|---|
| 54 |     Q_OBJECT
 | 
|---|
| 55 | public:
 | 
|---|
| 56 |     QTabDialog( QWidget* parent=0, const char* name=0, bool modal=FALSE,
 | 
|---|
| 57 |                 WFlags f=0 );
 | 
|---|
| 58 |     ~QTabDialog();
 | 
|---|
| 59 | 
 | 
|---|
| 60 |     void show();
 | 
|---|
| 61 |     void setFont( const QFont & font );
 | 
|---|
| 62 | 
 | 
|---|
| 63 |     void addTab( QWidget *, const QString &);
 | 
|---|
| 64 |     void addTab( QWidget *child, const QIconSet& iconset, const QString &label);
 | 
|---|
| 65 |     void addTab( QWidget *, QTab* );
 | 
|---|
| 66 | 
 | 
|---|
| 67 |     void insertTab( QWidget *, const QString &, int index = -1);
 | 
|---|
| 68 |     void insertTab( QWidget *child, const QIconSet& iconset, const QString &label, int index = -1);
 | 
|---|
| 69 |     void insertTab( QWidget *, QTab*, int index = -1 );
 | 
|---|
| 70 | 
 | 
|---|
| 71 |     void changeTab( QWidget *, const QString &);
 | 
|---|
| 72 |     void changeTab( QWidget *child, const QIconSet& iconset, const QString &label);
 | 
|---|
| 73 | 
 | 
|---|
| 74 |     bool isTabEnabled(  QWidget * ) const;
 | 
|---|
| 75 |     void setTabEnabled( QWidget *, bool );
 | 
|---|
| 76 |     bool isTabEnabled( const char* ) const; // compatibility
 | 
|---|
| 77 |     void setTabEnabled( const char*, bool ); // compatibility
 | 
|---|
| 78 | 
 | 
|---|
| 79 |     void showPage( QWidget * );
 | 
|---|
| 80 |     void removePage( QWidget * );
 | 
|---|
| 81 |     QString tabLabel( QWidget * );
 | 
|---|
| 82 | 
 | 
|---|
| 83 |     QWidget * currentPage() const;
 | 
|---|
| 84 | 
 | 
|---|
| 85 |     void setDefaultButton( const QString &text );
 | 
|---|
| 86 |     void setDefaultButton();
 | 
|---|
| 87 |     bool hasDefaultButton() const;
 | 
|---|
| 88 | 
 | 
|---|
| 89 |     void setHelpButton( const QString &text );
 | 
|---|
| 90 |     void setHelpButton();
 | 
|---|
| 91 |     bool hasHelpButton() const;
 | 
|---|
| 92 | 
 | 
|---|
| 93 |     void setCancelButton( const QString &text );
 | 
|---|
| 94 |     void setCancelButton();
 | 
|---|
| 95 |     bool hasCancelButton() const;
 | 
|---|
| 96 | 
 | 
|---|
| 97 |     void setApplyButton( const QString &text );
 | 
|---|
| 98 |     void setApplyButton();
 | 
|---|
| 99 |     bool hasApplyButton() const;
 | 
|---|
| 100 | 
 | 
|---|
| 101 | #ifndef Q_QDOC
 | 
|---|
| 102 |     void setOKButton( const QString &text = QString::null );
 | 
|---|
| 103 | #endif
 | 
|---|
| 104 |     void setOkButton( const QString &text );
 | 
|---|
| 105 |     void setOkButton();
 | 
|---|
| 106 |     bool hasOkButton() const;
 | 
|---|
| 107 | 
 | 
|---|
| 108 | protected:
 | 
|---|
| 109 |     void paintEvent( QPaintEvent * );
 | 
|---|
| 110 |     void resizeEvent( QResizeEvent * );
 | 
|---|
| 111 |     void styleChange( QStyle& );
 | 
|---|
| 112 |     void setTabBar( QTabBar* );
 | 
|---|
| 113 |     QTabBar* tabBar() const;
 | 
|---|
| 114 | 
 | 
|---|
| 115 | signals:
 | 
|---|
| 116 |     void aboutToShow();
 | 
|---|
| 117 | 
 | 
|---|
| 118 |     void applyButtonPressed();
 | 
|---|
| 119 |     void cancelButtonPressed();
 | 
|---|
| 120 |     void defaultButtonPressed();
 | 
|---|
| 121 |     void helpButtonPressed();
 | 
|---|
| 122 | 
 | 
|---|
| 123 |     void currentChanged( QWidget * );
 | 
|---|
| 124 |     void selected( const QString& ); // obsolete
 | 
|---|
| 125 | 
 | 
|---|
| 126 | private slots:
 | 
|---|
| 127 |     void showTab( int i );
 | 
|---|
| 128 | 
 | 
|---|
| 129 | private:
 | 
|---|
| 130 |     void setSizes();
 | 
|---|
| 131 |     void setUpLayout();
 | 
|---|
| 132 | 
 | 
|---|
| 133 |     QTabDialogPrivate *d;
 | 
|---|
| 134 | private:        // Disabled copy constructor and operator=
 | 
|---|
| 135 | #if defined(Q_DISABLE_COPY)
 | 
|---|
| 136 |     QTabDialog( const QTabDialog & );
 | 
|---|
| 137 |     QTabDialog& operator=( const QTabDialog & );
 | 
|---|
| 138 | #endif
 | 
|---|
| 139 | };
 | 
|---|
| 140 | 
 | 
|---|
| 141 | #endif // QT_NO_TABDIALOG
 | 
|---|
| 142 | 
 | 
|---|
| 143 | #endif // QTABDIALOG_H
 | 
|---|