akregator/src

tabwidget.h
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 
25 #ifndef TABWIDGET_H
26 #define TABWIDGET_H
27 
28 #include <tqptrlist.h>
29 #include <ktabwidget.h>
30 
31 class TQString;
32 
33 namespace Akregator
34 {
35 
36 class Frame;
37 
38 class TabWidget : public KTabWidget
39 {
40  TQ_OBJECT
41 
42 
43  public:
44  TabWidget(TQWidget * parent = 0, const char *name = 0);
45  virtual ~TabWidget();
46 
47  void addFrame(Frame *f);
48  Frame* currentFrame();
49  void removeFrame(Frame *f);
50  TQPtrList<Frame> frames() const;
51 
52  public slots:
53 
54  void slotSetTitle(Frame* frame, const TQString& title);
55  void slotSettingsChanged();
56  void slotNextTab();
57  void slotPreviousTab();
58  void slotRemoveCurrentFrame();
59 
60  signals:
61 
62  void currentFrameChanged(Frame *);
63 
64  protected slots:
65 
66  virtual void initiateDrag(int tab);
67 
68  private: // methods
69 
70  uint tabBarWidthForMaxChars( uint maxLength );
71  void setTitle( const TQString &title , TQWidget* sender);
72 
73 
74  private slots:
75 
76  void slotDetachTab();
77  void slotCopyLinkAddress();
78  void slotCloseTab();
79  void slotCloseRequest(TQWidget* widget);
80  void contextMenu (int item, const TQPoint &p);
81  void slotTabChanged(TQWidget *w);
82 
83  private:
84 
85  class TabWidgetPrivate;
86  TabWidgetPrivate* d;
87 };
88 
89 }
90 
91 #endif