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,
28 #include "panelcommon.h"
30 class QPropertyAnimation;
31 class QSignalTransition;
36 class PanelContentStack;
40 * @brief Class for tabbed panels
42 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
43 * @author Pekka Nissinen - pekka.nissinen@ixonos.com
45 class TabbedPanel : public QWidget
53 * @param parent Parent
55 TabbedPanel(QWidget *parent = 0);
57 /*******************************************************************************
58 * MEMBER FUNCTIONS AND SLOTS
59 ******************************************************************************/
62 * @brief Adds a tab to the panel
64 * Adds a tab with the given widget and icon into the tabbed panel and returns the index of the
67 * @param widget Widget to be added into the tab
68 * @param icon Icon of the tab
70 int addTab(QWidget *widget, const QIcon& icon);
73 * @brief Inserts a tab to the panel
75 * Inserts a tab with the given widget and icon into the tabbed panel at the specified index,
76 * and returns the index of the inserted tab.
78 * If index is out of range, the tab is simply appended. Otherwise it is inserted at the
81 * @param index Index of the tab
82 * @param widget Widget to be inserted into the tab
83 * @param icon Icon of the tab
85 int insertTab(int index, QWidget *widget, const QIcon& icon);
88 * @brief Removes a tab from the panel
90 * Removes a tab and its widget from the panel at index position. The widget itself is not
93 * @param index Index of the tab
95 void removeTab(int index);
99 * @brief Slot that closes the panel
104 * @brief Slot that shows the tab (and opens it if closed) with the desired widget
106 * @param widget Widget
108 void showPanel(QWidget *widget);
111 * @brief Slot to redraw the panel after window resize event
113 * @param size Size of the new window
115 void resizePanel(const QSize &size);
119 * @brief Sets the panel at current index active
121 * @param index Index of the panel
123 void setCurrentIndex(int index);
126 * @brief Internal slot used to track statemachine state
130 /*******************************************************************************
132 ******************************************************************************/
135 * @brief This signal is emitted whenever the current page index changes
137 void currentChanged(int index);
140 * @brief Signal that is sent when panel is closed
148 * @brief Signal that is sent when panel is opened
156 * @brief Signal that is sent to state machine when panel state must be changed
163 /*******************************************************************************
165 ******************************************************************************/
167 bool m_isOpen; ///< Boolean used to track the current state of the statemachine
169 QPropertyAnimation *m_panelAnimation; ///< Animation for panel state changes
171 QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
172 QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
174 QState *m_panelStateClosed; ///< State of the closed panel
175 QState *m_panelStateOpened; ///< State of the opened panel
177 QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
179 PanelBar *m_panelBar; ///< Widget for panel bar
180 PanelContentStack *m_panelContentStack; ///< Stack for panel widgets
181 PanelTabBar *m_panelTabBar; ///< Widget for panel tab bar
184 #endif // TABBEDPANEL_H