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 TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #ifndef TABWIDGET_H
00026 #define TABWIDGET_H
00027 
00028 #include <tqptrlist.h>
00029 #include <ktabwidget.h>
00030 
00031 class TQString;
00032 
00033 namespace Akregator
00034 {
00035 
00036 class Frame;
00037 
00038 class TabWidget : public KTabWidget
00039 {
00040     Q_OBJECT
00041   TQ_OBJECT
00042 
00043     public:
00044         TabWidget(TQWidget * parent = 0, const char *name = 0);
00045         virtual ~TabWidget();
00046 
00047         void addFrame(Frame *f);
00048         Frame* currentFrame();
00049         void removeFrame(Frame *f);
00050         TQPtrList<Frame> frames() const;
00051 
00052     public slots:
00053 
00054         void slotSetTitle(Frame* frame, const TQString& title);
00055         void slotSettingsChanged();
00056         void slotNextTab();
00057         void slotPreviousTab();
00058         void slotRemoveCurrentFrame();
00059 
00060     signals:
00061         
00062         void currentFrameChanged(Frame *);
00063         
00064     protected slots:
00065 
00066         virtual void initiateDrag(int tab);
00067         
00068     private: // methods
00069         
00070         uint tabBarWidthForMaxChars( uint maxLength );
00071         void setTitle( const TQString &title , TQWidget* sender);
00072 
00073 
00074     private slots:
00075         
00076         void slotDetachTab();
00077         void slotCopyLinkAddress();
00078         void slotCloseTab();
00079         void slotCloseRequest(TQWidget* widget);
00080         void contextMenu (int item, const TQPoint &p);
00081         void slotTabChanged(TQWidget *w);
00082         
00083    private:
00084 
00085        class TabWidgetPrivate;
00086        TabWidgetPrivate* d;
00087 };
00088 
00089 }
00090 
00091 #endif