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,
33 * @brief Base class for sliding side panels
35 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
36 * @author Pekka Nissinen - pekka.nissinen@ixonos.com
38 * @class SidePanel sidepanel.h "ui/sidepanel.h"
40 class SidePanel : public QWidget
50 SidePanel(QWidget *parent = 0);
53 * @brief Enumerator for the panel type
54 * Defines values: UserPanel, FriendPanel, None
58 enum PanelType {UserPanel, FriendPanel, None};
60 /******************************************************************************
61 * MEMBER FUNCTIONS AND SLOTS
62 ******************************************************************************/
65 * @brief Public slot that will open the panel unless already open
70 * @brief Public slot that will close the panel unless already closed
75 * @brief Slot to redraw the panel after window resize event
77 * @param size Size of the new window
79 void resizePanel(const QSize &size);
82 * @brief Type setter for the panel. Also sets panel visible
84 * Use to set panel type as UserPanel or FriendPanel. Panel type determines
85 * which side the panel will be rendered. UserPanel will always be rendered
86 * on the left side of the screen and FriendPanel on the right side. Type
87 * cannot be set twice.
89 * @param type Type of the panel, either UserPanel or FriendPanel
92 void setType(SidePanel::PanelType type);
96 * @brief Internal slot used to track statemachine state
98 void stateChangedToClosed();
101 * @brief Internal slot used to track statemachine state
103 void stateChangedToOpen();
105 /******************************************************************************
107 ******************************************************************************/
110 * @brief Signal that is sent to state machine when state must be changed
118 * @brief Signal that is sent when panel is closed
126 * @brief Signal that is sent when panel is opened
133 /*******************************************************************************
135 *******************************************************************************/
137 QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
140 bool m_isOpen; ///< Boolean used to track the current state of the statemachine
142 QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
143 QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
144 QState *m_panelStateClosed; ///< State of the closed panel
145 QState *m_panelStateOpened; ///< State of the opened panel
146 QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
148 SidePanelBase *m_panelBase; ///< Widget for panel base
149 PanelType currentType; ///< Holder for the type of this panel
150 PanelSliderBar *m_panelSlidingBar; ///< Widget for panel sliding bar item
153 #endif // SIDEPANEL_H