Updated SWH plugins and added missing hermes_filter plugin
[lmms/mlankhorst.git] / include / tab_bar.h
blobdd60410526232aba4256d2be441160639a66f0ee
1 /*
2 * tab_bar.h - class tabBar
4 * Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
26 #ifndef _TAB_BAR_H
27 #define _TAB_BAR_H
29 #include <QtCore/QMap>
30 #include <QtGui/QLayout>
31 #include <QtGui/QWidget>
33 #include "export.h"
36 class tabButton;
39 class EXPORT tabBar : public QWidget
41 Q_OBJECT
42 public:
43 tabBar( QWidget * _parent,
44 QBoxLayout::Direction _dir = QBoxLayout::LeftToRight );
45 virtual ~tabBar();
47 tabButton * addTab( QWidget * _w, const QString & _text,
48 int _id, bool _add_stretch = false,
49 bool _text_is_tooltip = false );
50 void removeTab( int _id );
52 inline void setExclusive( bool _on )
54 m_exclusive = _on;
57 int activeTab();
60 public slots:
61 void setActiveTab( int _id );
64 protected:
65 bool tabState( int _id );
66 void setTabState( int _id, bool _checked );
67 bool allHidden();
70 protected slots:
71 void hideAll( int _exception = -1 );
72 void tabClicked( int _id );
75 private:
76 QMap<int, QPair<tabButton *, QWidget *> > m_tabs;
77 QBoxLayout * m_layout;
78 bool m_exclusive;
81 signals:
82 void allWidgetsHidden();
83 void widgetShown();
85 } ;
88 #endif