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;
46 * @brief Class for tabbed panels
48 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
49 * @author Pekka Nissinen - pekka.nissinen@ixonos.com
51 * @class TabbedPanel tabbedpanel.h "ui/tabbedpanel.h"
53 class TabbedPanel : public QWidget
61 * @param parent Parent
63 TabbedPanel(QWidget *parent = 0);
65 /*******************************************************************************
66 * MEMBER FUNCTIONS AND SLOTS
67 ******************************************************************************/
70 * @brief Adds a tab to the panel
72 * Adds a tab with the given widget and icon into the tabbed panel and returns the index of the
75 * @param widget Widget to be added into the tab
76 * @param icon Icon of the tab
78 int addTab(QWidget *widget, const QIcon& icon);
81 * @brief Inserts a tab to the panel
83 * Inserts a tab with the given widget and icon into the tabbed panel at the specified index,
84 * and returns the index of the inserted tab.
86 * If index is out of range, the tab is simply appended. Otherwise it is inserted at the
89 * @param index Index of the tab
90 * @param widget Widget to be inserted into the tab
91 * @param icon Icon of the tab
93 int insertTab(int index, QWidget *widget, const QIcon& icon);
96 * @brief Removes a tab from the panel
98 * Removes a tab and its widget from the panel at index position. The widget itself is not
101 * TODO: Fix tab drawing order
103 * @param index Index of the tab
105 void removeTab(int index);
109 * @brief Public slot that will close the panel unless already closed
114 * @brief Public slot that will open the panel unless already open
119 * @brief Sets the tab at given index active
121 * @param index Index of the tab
123 void setActiveTab(int index);
126 * @brief Slot to redraw the panel after window resize event
128 * @param size Size of the new window
130 void resizePanel(const QSize &size);
134 * @brief Internal slot used to track statemachine state
138 /*******************************************************************************
140 ******************************************************************************/
143 * @brief Signal that is sent when panel is closed
151 * @brief Signal that is sent when panel is opened
159 * @brief Signal that is sent to state machine when state must be changed
166 /*******************************************************************************
168 ******************************************************************************/
170 bool m_isOpen; ///< Boolean used to track the current state of the statemachine
172 int m_activeTab; ///< Index of a active tab
174 QButtonGroup *m_tabButtonGroup; ///< Button groub for tab buttons
176 QPropertyAnimation *m_panelAnimation; ///< Animation for panel state changes
178 QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
179 QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
181 QStackedWidget *m_panelWidgetStack; ///< Stack for panel widgets
183 QState *m_panelStateClosed; ///< State of the closed panel
184 QState *m_panelStateOpened; ///< State of the opened panel
186 QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
188 PanelBar *m_panelBar; ///< Widget for panel bar
189 PanelContent *m_panelContent; ///< Widget for panel content
192 #endif // TABBEDPANEL_H