2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Kaj Wallin - kaj.wallin@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,
27 #include "panelcommon.h"
32 * @brief Base class for sliding side panels
34 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
35 * @class SidePanel sidepanel.h "ui/sidepanel.h"
37 class SidePanel : public QWidget
47 SidePanel(QWidget *parent = 0);
50 * @brief Enumerator for the panel type
51 * Defines values: UserPanel, FriendPanel, None
55 enum PanelType {UserPanel, FriendPanel, None};
56 /******************************************************************************
57 * MEMBER FUNCTIONS AND SLOTS
58 ******************************************************************************/
61 * @brief Public slot that will open the panel unless already open
66 * @brief Public slot that will close the panel unless already closed
71 * @brief Slot to redraw the panel after window resize event
73 * @param size Size of the new screen
75 void screenResized(const QSize &size);
78 * @brief Type setter for the panel. Also sets panel visible
80 * Use to set panel type as UserPanel or FriendPanel. Panel type determines
81 * which side the panel will be rendered. UserPanel will always be rendered
82 * on the left side of the screen and FriendPanel on the right side. Type
83 * cannot be set twice.
85 * @param type Type of the panel, either UserPanel or FriendPanel
88 void setType(SidePanel::PanelType type);
93 * @brief Internal slot used to track statemachine state
95 void stateChangedToClosed();
97 * @brief Internal slot used to track statemachine state
99 void stateChangedToOpen();
101 /******************************************************************************
103 ******************************************************************************/
106 * @brief Signal that is sent to state machine when state must be changed
114 * @brief Signal that is sent when panel is closed
122 * @brief Signal that is sent when panel is opened
129 /*******************************************************************************
131 *******************************************************************************/
133 QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
136 bool m_isOpen; ///< Boolean used to track the current state of the statemachine
137 QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
138 QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
139 QState *m_panelStateClosed; ///< State of the closed panel
140 QState *m_panelStateOpened; ///< State of the opened panel
141 QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
142 QWidget *m_panelBase; ///< Widget for panel base
144 PanelType currentType; ///< Holder for the type of this panel
145 PanelSliderBar *m_panelSlidingBar; ///< Widget for sidebar tab item
148 #endif // SIDEPANEL_H