xref: /glogg/src/tabbedcrawlerwidget.h (revision 045bfe08ca98f6c980126a984e7f90156172a17a) !
1093a1bf6SNicolas Bonnefon /*
2093a1bf6SNicolas Bonnefon  * Copyright (C) 2014 Nicolas Bonnefon and other contributors
3093a1bf6SNicolas Bonnefon  *
4093a1bf6SNicolas Bonnefon  * This file is part of glogg.
5093a1bf6SNicolas Bonnefon  *
6093a1bf6SNicolas Bonnefon  * glogg is free software: you can redistribute it and/or modify
7093a1bf6SNicolas Bonnefon  * it under the terms of the GNU General Public License as published by
8093a1bf6SNicolas Bonnefon  * the Free Software Foundation, either version 3 of the License, or
9093a1bf6SNicolas Bonnefon  * (at your option) any later version.
10093a1bf6SNicolas Bonnefon  *
11093a1bf6SNicolas Bonnefon  * glogg is distributed in the hope that it will be useful,
12093a1bf6SNicolas Bonnefon  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13093a1bf6SNicolas Bonnefon  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14093a1bf6SNicolas Bonnefon  * GNU General Public License for more details.
15093a1bf6SNicolas Bonnefon  *
16093a1bf6SNicolas Bonnefon  * You should have received a copy of the GNU General Public License
17093a1bf6SNicolas Bonnefon  * along with glogg.  If not, see <http://www.gnu.org/licenses/>.
18093a1bf6SNicolas Bonnefon  */
19093a1bf6SNicolas Bonnefon 
20093a1bf6SNicolas Bonnefon #ifndef TABBEDCRAWLERWIDGET_H
21093a1bf6SNicolas Bonnefon #define TABBEDCRAWLERWIDGET_H
22093a1bf6SNicolas Bonnefon 
23093a1bf6SNicolas Bonnefon #include <QTabWidget>
24093a1bf6SNicolas Bonnefon #include <QTabBar>
25093a1bf6SNicolas Bonnefon 
26093a1bf6SNicolas Bonnefon // This class represents glogg's main widget, a tabbed
27093a1bf6SNicolas Bonnefon // group of CrawlerWidgets.
28093a1bf6SNicolas Bonnefon // This is a very slightly customised QTabWidget, with
29333b2889SNicolas Bonnefon // a particular style.
30093a1bf6SNicolas Bonnefon class TabbedCrawlerWidget : public QTabWidget
31093a1bf6SNicolas Bonnefon {
32093a1bf6SNicolas Bonnefon   Q_OBJECT
33093a1bf6SNicolas Bonnefon     public:
34333b2889SNicolas Bonnefon       TabbedCrawlerWidget();
35093a1bf6SNicolas Bonnefon       virtual ~TabbedCrawlerWidget() {}
36333b2889SNicolas Bonnefon 
37333b2889SNicolas Bonnefon       // "Overridden" addTab/removeTab that automatically
38333b2889SNicolas Bonnefon       // show/hide the tab bar
39333b2889SNicolas Bonnefon       int addTab( QWidget* page, const QString& label );
40333b2889SNicolas Bonnefon       void removeTab( int index );
41333b2889SNicolas Bonnefon 
42f88e59a4SNicolas Bonnefon     protected:
43f88e59a4SNicolas Bonnefon       void keyPressEvent( QKeyEvent* event );
44*045bfe08SGustav Andersson       void mouseReleaseEvent( QMouseEvent *event);
45f88e59a4SNicolas Bonnefon 
46093a1bf6SNicolas Bonnefon     private:
47093a1bf6SNicolas Bonnefon       QTabBar myTabBar_;
48093a1bf6SNicolas Bonnefon };
49093a1bf6SNicolas Bonnefon 
50093a1bf6SNicolas Bonnefon #endif
51