2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Kaj Wallin - kaj.wallin@ixonos.com
6 Pekka Nissinen - pekka.nissinen@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
29 #include "panelcommon.h"
35 class QPropertyAnimation;
37 class QSignalTransition;
47 * @brief Class for tabbed panels
49 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
50 * @author Pekka Nissinen - pekka.nissinen@ixonos.com
52 * @class TabbedPanel tabbedpanel.h "ui/tabbedpanel.h"
54 class TabbedPanel : public QWidget
62 * @param parent Parent
64 TabbedPanel(QWidget *parent = 0);
66 /*******************************************************************************
67 * MEMBER FUNCTIONS AND SLOTS
68 ******************************************************************************/
71 * @brief Adds a tab to the panel
73 * Adds a tab with the given widget and icon into the tabbed panel and returns the index of the
76 * @param widget Widget to be added into the tab
77 * @param icon Icon of the tab
79 int addTab(QWidget *widget, const QIcon& icon);
82 * @brief Inserts a tab to the panel
84 * Inserts a tab with the given widget and icon into the tabbed panel at the specified index,
85 * and returns the index of the inserted tab.
87 * If index is out of range, the tab is simply appended. Otherwise it is inserted at the
90 * @param index Index of the tab
91 * @param widget Widget to be inserted into the tab
92 * @param icon Icon of the tab
94 int insertTab(int index, QWidget *widget, const QIcon& icon);
97 * @brief Removes a tab from the panel
99 * Removes a tab and its widget from the panel at index position. The widget itself is not
102 * TODO: Fix tab drawing order
104 * @param index Index of the tab
106 void removeTab(int index);
110 * @brief Public slot that will close the panel unless already closed
115 * @brief Public slot that will open the panel unless already open
120 * @brief Slot to redraw the panel after window resize event
122 * @param size Size of the new window
124 void resizePanel(const QSize &size);
128 * @brief Sets the tab at given index active
130 * @param index Index of the tab
132 void setActiveTab(int index);
135 * @brief Internal slot used to track statemachine state
139 /*******************************************************************************
141 ******************************************************************************/
144 * @brief Signal that is sent when panel is closed
152 * @brief Signal that is sent when panel is opened
160 * @brief Signal that is sent when user has clicked another tab active
165 * @brief Signal that is sent to state machine when state must be changed
172 /*******************************************************************************
174 ******************************************************************************/
176 bool m_isOpen; ///< Boolean used to track the current state of the statemachine
178 int m_activeTab; ///< Index of a active tab
180 QButtonGroup *m_tabButtonGroup; ///< Button groub for tab buttons
182 QPropertyAnimation *m_panelAnimation; ///< Animation for panel state changes
184 QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
185 QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
187 QStackedWidget *m_panelWidgetStack; ///< Stack for panel widgets
189 QState *m_panelStateClosed; ///< State of the closed panel
190 QState *m_panelStateOpened; ///< State of the opened panel
192 QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
194 PanelBar *m_panelBar; ///< Widget for panel bar
195 PanelContent *m_panelContent; ///< Widget for panel content
198 #endif // TABBEDPANEL_H