Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

launchertab.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef LAUNCHERTAB_H
00021 #define LAUNCHERTAB_H
00022 
00023 #include <qcolor.h>
00024 #include <qstring.h>
00025 #include <qwidget.h>
00026 #include <qrect.h>
00027 #include <qiconset.h>
00028 #include <qlist.h>
00029 #include <qdict.h>
00030 #include <qtabbar.h>
00031 
00032 class LauncherView;
00033 
00034 class LauncherTab : public QTab
00035 {
00036 public:
00037     LauncherTab( const QString &idStr, LauncherView *viewPtr,
00038                  const QIconSet &iconSet,
00039                  const QString &textStr=QString::null )
00040         : QTab( iconSet, textStr )
00041     {
00042         type = idStr;
00043         view = viewPtr;
00044     }
00045 
00046     QString type;
00047     LauncherView *view;
00048     QColor bgColor;
00049     QColor fgColor;
00050 };
00051 
00052 class LauncherTabBar : public QTabBar
00053 {
00054     Q_OBJECT
00055 public:
00056     LauncherTabBar( QWidget *parent=0, const char *name=0 );
00057     ~LauncherTabBar();
00058 
00059     void insertTab( LauncherTab *, int index = -1 );
00060     void removeTab( QTab * );
00061 
00062     LauncherView *currentView() {
00063         return currentLauncherTab()->view;
00064     }
00065 
00066     LauncherTab *currentLauncherTab() {
00067         return (LauncherTab*) tab( currentTab() );
00068     }
00069 
00070     LauncherTab *launcherTab( const QString &id ) const { return tabs[id]; }
00071 
00072     void nextTab();
00073     void prevTab();
00074 
00075 public slots:
00076     void showTab(const QString&);
00077 
00078 protected slots:
00079     virtual void layoutTabs();
00080 
00081 protected:
00082     virtual void paint( QPainter *p, QTab *t, bool f ) const;
00083     void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const;
00084 
00085 private:
00086     QList<LauncherTab> items;
00087     QDict<LauncherTab> tabs;
00088 };
00089 
00090 #endif

Generated on Sat Nov 5 16:15:30 2005 for OPIE by  doxygen 1.4.2