akregator/src

tabwidget.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef TABWIDGET_H
00026 #define TABWIDGET_H
00027 
00028 #include <qptrlist.h>
00029 #include <ktabwidget.h>
00030 
00031 class QString;
00032 
00033 namespace Akregator
00034 {
00035 
00036 class Frame;
00037 
00038 class TabWidget : public KTabWidget
00039 {
00040     Q_OBJECT
00041 
00042     public:
00043         TabWidget(QWidget * parent = 0, const char *name = 0);
00044         virtual ~TabWidget();
00045 
00046         void addFrame(Frame *f);
00047         Frame* currentFrame();
00048         void removeFrame(Frame *f);
00049         QPtrList<Frame> frames() const;
00050 
00051     public slots:
00052 
00053         void slotSetTitle(Frame* frame, const QString& title);
00054         void slotSettingsChanged();
00055         void slotNextTab();
00056         void slotPreviousTab();
00057         void slotRemoveCurrentFrame();
00058 
00059     signals:
00060         
00061         void currentFrameChanged(Frame *);
00062         
00063     protected slots:
00064 
00065         virtual void initiateDrag(int tab);
00066         
00067     private: // methods
00068         
00069         uint tabBarWidthForMaxChars( uint maxLength );
00070         void setTitle( const QString &title , QWidget* sender);
00071 
00072 
00073     private slots:
00074         
00075         void slotDetachTab();
00076         void slotCopyLinkAddress();
00077         void slotCloseTab();
00078         void slotCloseRequest(QWidget* widget);
00079         void contextMenu (int item, const QPoint &p);
00080         void slotTabChanged(QWidget *w);
00081         
00082    private:
00083 
00084        class TabWidgetPrivate;
00085        TabWidgetPrivate* d;
00086 };
00087 
00088 }
00089 
00090 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys