00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Kaj Wallin - kaj.wallin@ixonos.com 00006 Pekka Nissinen - pekka.nissinen@ixonos.com 00007 00008 Situare is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 version 2 as published by the Free Software Foundation. 00011 00012 Situare is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Situare; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 USA. 00021 */ 00022 00023 #ifndef TABBEDPANEL_H 00024 #define TABBEDPANEL_H 00025 00026 #include <QWidget> 00027 00028 #include "panelcommon.h" 00029 00030 class QPropertyAnimation; 00031 class QSignalTransition; 00032 class QState; 00033 class QStateMachine; 00034 00035 class PanelBar; 00036 class PanelContentStack; 00037 class PanelContextButtonBar; 00038 class PanelTabBar; 00039 00046 class TabbedPanel : public QWidget 00047 { 00048 Q_OBJECT 00049 00050 public: 00056 TabbedPanel(QWidget *parent = 0); 00057 00058 /******************************************************************************* 00059 * MEMBER FUNCTIONS AND SLOTS 00060 ******************************************************************************/ 00061 public: 00071 int addTab(QWidget *widget, const QIcon& icon); 00072 00086 int insertTab(int index, QWidget *widget, const QIcon& icon); 00087 00096 void removeTab(int index); 00097 00105 void setTabsEnabled(const QList<int> &tabIndexes, bool enabled); 00106 00107 public slots: 00111 void closePanel(); 00112 00120 void openPanel(QWidget *widget = 0); 00121 00127 void resizePanel(const QSize &size); 00128 00129 private slots: 00135 void calculateMask(); 00136 00140 void repositionContextButtonBar(); 00141 00147 void setCurrentIndex(int index); 00148 00152 void stateChanged(); 00153 00154 /******************************************************************************* 00155 * SIGNALS 00156 ******************************************************************************/ 00157 signals: 00163 void currentChanged(int index); 00164 00171 void panelClosed(); 00172 00179 void panelOpened(); 00180 00187 void toggleState(); 00188 00189 /******************************************************************************* 00190 * DATA MEMBERS 00191 ******************************************************************************/ 00192 private: 00193 bool m_open; 00194 bool m_closeRequestPending; 00195 00196 QState *m_stateClosed; 00197 QState *m_stateOpened; 00198 00199 PanelBar *m_panelBar; 00200 PanelContentStack *m_panelContentStack; 00201 PanelContextButtonBar * m_panelContextButtonBar; 00202 PanelTabBar *m_panelTabBar; 00203 }; 00204 00205 #endif // TABBEDPANEL_H