2 * tab_bar.h - class tabBar
4 * Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
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.
29 #include <QtCore/QMap>
30 #include <QtGui/QLayout>
31 #include <QtGui/QWidget>
39 class EXPORT tabBar
: public QWidget
43 tabBar( QWidget
* _parent
,
44 QBoxLayout::Direction _dir
= QBoxLayout::LeftToRight
);
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
)
61 void setActiveTab( int _id
);
65 bool tabState( int _id
);
66 void setTabState( int _id
, bool _checked
);
71 void hideAll( int _exception
= -1 );
72 void tabClicked( int _id
);
76 QMap
<int, QPair
<tabButton
*, QWidget
*> > m_tabs
;
77 QBoxLayout
* m_layout
;
82 void allWidgetsHidden();