00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef OTABWIDGET_H
00032 #define OTABWIDGET_H
00033
00034
00035 #include <opie2/otabinfo.h>
00036
00037
00038 #include <qwidget.h>
00039 #include <qlist.h>
00040
00041
00042 class QComboBox;
00043 class QPixmap;
00044 class QTabBar;
00045 class QWidgetStack;
00046
00047 namespace Opie {
00048 namespace Ui {
00049
00050 class OTabBar;
00051
00067 class OTabWidget : public QWidget
00068 {
00069 Q_OBJECT
00070
00071 public:
00084 enum TabStyle { Global, TextTab, IconTab, TextList, IconList };
00085
00094 enum TabPosition { Top, Bottom };
00095
00108 OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top );
00109
00114 ~OTabWidget();
00115
00124 void addTab( QWidget *, const QString &, const QString & );
00125
00132 void removePage( QWidget * );
00133
00142 void changeTab( QWidget *, const QString &, const QString & );
00143
00148 TabStyle tabStyle() const;
00149
00156 void setTabStyle( TabStyle );
00157
00162 TabPosition tabPosition() const;
00163
00170 void setTabPosition( TabPosition );
00171
00178 void setCurrentTab( QWidget * );
00179
00186 void setCurrentTab( const QString & );
00187
00194 void setCurrentTab(int);
00195
00200
00201 int currentTab();
00207 QWidget* currentWidget()const;
00208
00209 protected:
00210
00215 void resizeEvent( QResizeEvent * );
00216
00217 private:
00218 OTabInfoList m_tabs;
00219 OTabInfo *m_currTab;
00220 TabStyle m_tabBarStyle;
00221 TabPosition m_tabBarPosition;
00222 bool m_usingTabs;
00223
00224
00225
00226 OTabBar *m_tabBar;
00227 QComboBox *m_tabList;
00228 QWidgetStack *m_widgetStack;
00229
00230 class Private;
00231 Private* d;
00232
00239 void selectTab( OTabInfo * );
00240
00245 void setUpLayout();
00246
00247
00248 signals:
00255 void currentChanged( QWidget * );
00256
00257 private slots:
00258
00265 void slotTabBarSelected( int );
00266
00273 void slotTabListSelected( int );
00274 };
00275
00276 }
00277 }
00278
00279 #endif