lib Library API Documentation

kotabbar.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Ariya Hidayat <ariya@kde.org>
00003    Copyright (C) 2003 Norbert Andres <nandres@web.de>
00004    Copyright (C) 2002 Laurent Montel <montel@kde.org>
00005    Copyright (C) 1999 David Faure <faure@kde.org>
00006    Copyright (C) 1999 Boris Wedl <boris.wedl@kfunigraz.ac.at>
00007    Copyright (C) 1998-2000 Torben Weis <weis@kde.org>
00008 
00009    This library is free software; you can redistribute it and/or
00010    modify it under the terms of the GNU Library General Public
00011    License as published by the Free Software Foundation; either
00012    version 2 of the License, or (at your option) any later version.
00013 
00014    This library is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017    Library General Public License for more details.
00018 
00019    You should have received a copy of the GNU Library General Public License
00020    along with this library; see the file COPYING.LIB.  If not, write to
00021    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00022    Boston, MA 02111-1307, USA.
00023 */
00024 
00025 #ifndef kotabbar_h
00026 #define kotabbar_h
00027 
00028 #include <qwidget.h>
00029 #include <qstringlist.h>
00030 #include <koffice_export.h>
00031 class KoTabBarPrivate;
00032 
00061 class KOFFICEUI_EXPORT KoTabBar : public QWidget
00062 {
00063     Q_OBJECT
00064     
00065     Q_PROPERTY( QString activeTab READ activeTab WRITE setActiveTab )
00066     Q_PROPERTY( bool readOnly READ readOnly WRITE setReadOnly )
00067     Q_PROPERTY( QStringList tabs READ tabs WRITE setTabs )
00068     Q_PROPERTY( unsigned count READ count )
00069     
00070 public:
00071 
00075     KoTabBar( QWidget* parent = 0, const char *name = 0 );
00076 
00080     virtual ~KoTabBar();
00081 
00085     bool readOnly() const;
00086     
00091     bool reverseLayout() const;
00092     
00093     /*
00094      * Returns all the tab as list of strings.
00095      */
00096     QStringList tabs() const;
00097 
00098     /*
00099      * Returns number of tabs.
00100      * This is the same as KoTabBar::tabs().count()
00101      */
00102     unsigned count() const;
00103 
00104     /*
00105      * Returns the active tab.
00106      */
00107     QString activeTab() const;
00108 
00114     bool canScrollBack() const;
00115 
00121     bool canScrollForward() const;
00122 
00123 public slots:
00124 
00128     void setTabs( const QStringList& list );
00129 
00137     void setReadOnly( bool ro );
00138 
00143     void setReverseLayout( bool reverse );
00144 
00148     void addTab( const QString& text );
00149 
00155     void removeTab( const QString& text );
00156 
00160     void renameTab( const QString& old_name, const QString& new_name );
00161     
00172     void moveTab( unsigned tab, unsigned target );
00173 
00180     void scrollBack();
00181 
00188     void scrollForward();
00189 
00196     void scrollFirst();
00197 
00204     void scrollLast();
00205 
00209     void setActiveTab( const QString& text );
00210 
00214     void clear();
00215     
00216     QSize sizeHint() const;
00217 
00218 signals:
00219 
00223     void tabChanged( const QString& _text );
00224 
00235     void tabMoved( unsigned tab, unsigned target );
00236 
00241     void contextMenu( const QPoint& pos );
00242 
00246     void doubleClicked();
00247 
00248 protected slots:
00249     void autoScrollBack();
00250     void autoScrollForward();
00251 
00252 protected:
00253     virtual void paintEvent ( QPaintEvent* ev );
00254     virtual void resizeEvent( QResizeEvent* ev );
00255     virtual void mousePressEvent ( QMouseEvent* ev );
00256     virtual void mouseReleaseEvent ( QMouseEvent* ev );
00257     virtual void mouseDoubleClickEvent ( QMouseEvent* ev );
00258     virtual void mouseMoveEvent( QMouseEvent* ev );
00259 
00260 private:
00261     KoTabBarPrivate *d;
00262 
00263     // don't allow copy or assignment
00264     KoTabBar( const KoTabBar& );
00265     KoTabBar& operator=( const KoTabBar& );
00266 };
00267 
00268 
00269 #endif // kotabbar_h
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:08 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003