00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Pekka Nissinen - pekka.nissinen@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 #ifndef PANELTABBAR_H 00023 #define PANELTABBAR_H 00024 00025 #include <QWidget> 00026 00027 class QButtonGroup; 00028 00034 class PanelTabBar : public QWidget 00035 { 00036 Q_OBJECT 00037 00038 public: 00044 PanelTabBar(QWidget *parent = 0); 00045 00046 /******************************************************************************* 00047 * MEMBER FUNCTIONS AND SLOTS 00048 ******************************************************************************/ 00049 public: 00057 int addTab(const QIcon& icon); 00058 00068 int insertTab(int index, const QIcon& icon); 00069 00079 void removeTab(int index); 00080 00086 QButtonGroup * tabs() const; 00087 00088 private: 00092 void setUpTabLayout(); 00093 00094 public slots: 00098 void deselectTabs(); 00099 00105 void selectTab(int index); 00106 00107 private slots: 00113 void setCurrentIndex(int index); 00114 00115 /******************************************************************************* 00116 * SIGNALS 00117 ******************************************************************************/ 00118 signals: 00124 void currentChanged(int index); 00125 00129 void sizeChangeRequested(); 00130 00136 void tabCloseRequested(int index); 00137 00138 /******************************************************************************* 00139 * DATA MEMBERS 00140 ******************************************************************************/ 00141 private: 00142 int m_activeTab; 00143 00144 QButtonGroup *m_tabButtonGroup; 00145 }; 00146 00147 #endif // PANELTABBAR_H