2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Pekka Nissinen - pekka.nissinen@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
30 * @brief Class for tab bar
32 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
34 class PanelTabBar : public QWidget
42 * @param parent Parent
44 PanelTabBar(QWidget *parent = 0);
46 /*******************************************************************************
47 * MEMBER FUNCTIONS AND SLOTS
48 ******************************************************************************/
53 * Adds a tab with icon and returns the index of the inserted tab
55 * @param icon Icon of the tab
57 int addTab(const QIcon& icon);
60 * @brief Inserts a tab
62 * Inserts a tab with icon at the specified index and returns the index of the inserted tab.
63 * If index is out of range, the tab is appended.
65 * @param index Index of the tab
66 * @param icon Icon of the tab
68 int insertTab(int index, const QIcon& icon);
71 * @brief Removes a tab
73 * Removes a tab at index position
75 * @todo: Fix tab drawing order
77 * @param index Index of the tab
79 void removeTab(int index);
82 * @brief Returns all tabs.
86 QButtonGroup *tabs() const;
90 * @brief Initializes and formats tab buttons layout
92 void setUpTabLayout();
96 * @brief This slot is used to clear tab selections
101 * @brief This slot selects a tab at given index
103 * @param index Index of the tab
105 void selectTab(int index);
109 * @brief Sets the tab at current index active
111 * @param index Index of the tab
113 void setCurrentIndex(int index);
115 /*******************************************************************************
117 ******************************************************************************/
120 * @brief This signal is emitted whenever the current tab changes
122 * @param index Index of the new tab
124 void currentChanged(int index);
127 * @brief This signal is emitted when tabs are added or removed
129 void sizeChangeRequested();
132 * @brief This signal is emitted whenever user wants to close a tab
134 * @param index Index of the currently active tab
136 void tabCloseRequested(int index);
138 /*******************************************************************************
140 ******************************************************************************/
142 int m_activeTab; ///< Index of a active tab
144 QButtonGroup *m_tabButtonGroup; ///< Button groub for tab buttons
147 #endif // PANELTABBAR_H