1
/***************************************************************************
2
* Copyright (C) 2009 by Joris Guisson *
3
* joris.guisson@gmail.com *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19
***************************************************************************/
21
#ifndef TABBARWIDGET_H
22
#define TABBARWIDGET_H
26
#include <QStackedWidget>
27
#include <kmultitabbar.h>
28
#include <ksharedconfig.h>
29
#include "ktcore_export.h"
33
class KTCORE_EXPORT TabBarWidget : public QWidget
45
typedef QList<Tab>::iterator TabItr;
47
TabBarWidget(QSplitter* splitter,QWidget* parent);
48
virtual ~TabBarWidget();
50
/// Add a tab to the TabBarWidget
51
void addTab(QWidget* w,const QString & text,const QString & icon,const QString & tooltip);
53
/// Remove a tab from the TabBarWidget
54
void removeTab(QWidget* w);
56
/// Save current status of sidebar, called at exit
57
void saveState(KSharedConfigPtr cfg,const QString & group);
59
/// Restore status from config, called at startup
60
void loadState(KSharedConfigPtr cfg,const QString & group);
62
/// Change the text of a tab
63
void changeTabText(QWidget* w,const QString & text);
65
/// Change the icon of a tab
66
void changeTabIcon(QWidget* w,const QString & icon);
69
void onTabClicked(int id);
74
TabItr findByWidget(QWidget* w);
75
TabItr findById(int id);
76
TabItr findByText(const QString & text);
79
KMultiTabBar* tab_bar;
80
QStackedWidget* widget_stack;
87
#endif // TABBARWIDGET_H