libopie API Documentation

otabwidget.h

00001 /*
00002                             This file is part of the Opie Project
00003 
00004                              Copyright (c)  2002 Dan Williams <williamsdr@acm.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022  :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
00029 
00030 */
00031 
00032 #ifndef OTABWIDGET_H
00033 #define OTABWIDGET_H
00034 
00035 #include "otabinfo.h"
00036 
00037 #include <qwidget.h>
00038 #include <qlist.h>
00039 
00040 class OTabBar;
00041 class QComboBox;
00042 class QPixmap;
00043 class QTabBar;
00044 class QWidgetStack;
00045 
00061 class OTabWidget : public QWidget
00062 {
00063     Q_OBJECT
00064 public:
00065 
00078     enum TabStyle { Global, TextTab, IconTab, TextList, IconList };
00079 
00088     enum TabPosition { Top, Bottom };
00089 
00102  // FIXME WFlags? -zecke
00103     OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top );
00104 
00109     ~OTabWidget();
00110 
00119     void addTab( QWidget *, const QString &, const QString & );
00120 
00127     /* ### Page vs. Tab.. yes the widget is a Page but then is addTab wrong -zecke */
00128     void removePage( QWidget * );
00129 
00138     void changeTab( QWidget *, const QString &, const QString & );
00139 
00144     TabStyle tabStyle() const;
00145 
00152     void setTabStyle( TabStyle );
00153 
00158     TabPosition tabPosition() const;
00159 
00166     void setTabPosition( TabPosition );
00167 
00174     void setCurrentTab( QWidget * );
00175 
00182     void setCurrentTab( const QString & );
00183 
00190     void setCurrentTab(int);
00191 
00196     QSize sizeHint() const;
00197 
00202     // ### make const
00203     int currentTab()/* const */;
00209     QWidget* currentWidget()const;
00210 
00211 protected:
00212 
00217     void resizeEvent( QResizeEvent * );
00218 
00219 private:
00220     OTabInfoList  tabs;
00221     OTabInfo     *currTab;
00222 
00223     TabStyle    tabBarStyle;
00224     TabPosition tabBarPosition;
00225 
00226     QWidgetStack *tabBarStack;
00227     OTabBar      *tabBar;
00228     QComboBox    *tabList;
00229 
00230     QWidgetStack *widgetStack;
00231     class Private;
00232     Private* d;
00233 
00240     QPixmap loadSmooth( const QString & );
00241 
00248     void    selectTab( OTabInfo * );
00249 
00254     void    setUpLayout();
00255 
00256 
00257 signals:
00264     void currentChanged( QWidget * );
00265 
00266 private slots:
00267 
00274     void slotTabBarSelected( int );
00275 
00282     void slotTabListSelected( int );
00283 };
00284 
00285 #endif
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:45 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001