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,
28 #include "panelcommon.h"
34 * @brief Base class for sliding side panels
36 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
37 * @class SidePanel sidepanel.h "ui/sidepanel.h"
39 class SidePanel : public QWidget
48 SidePanel(QWidget *parent);
51 * @brief Enumerator for the panel type
52 * Defines values: UserPanel, FriendPanel
56 enum PanelType {UserPanel, FriendPanel};
57 /******************************************************************************
58 * MEMBER FUNCTIONS AND SLOTS
59 ******************************************************************************/
62 * @brief Public slot that will open the panel unless already open
67 * @brief Public slot that will close the panel unless already closed
72 * @brief Slot to redraw the panel after window resize event
74 * @param size Size of the new screen
76 void screenResized(const QSize &size);
79 * @brief Type setter for the panel. Also sets panel visible
81 * Use to set panel type as UserPanel or FriendPanel. Panel type determines
82 * which side the panel will be rendered. UserPanel will always be rendered
83 * on the left side of the screen and FriendPanel on the right side.
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
113 /*******************************************************************************
115 *******************************************************************************/
117 QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
120 bool isOpen; ///< Boolean used to tranch the current state of the statemachine
121 QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
122 QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
123 QState *m_panelStateClosed; ///< State of the closed panel
124 QState *m_panelStateOpened; ///< State of the opened panel
125 QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
126 QWidget *m_panelBase; ///< Widget for panel base
128 PanelType currentType; ///< Holder for the type of this panel
129 PanelSideBar *userPanelSidebar; ///< Overlaying widget for sidebar
130 PanelSliderBar *m_panelSlidingBar; ///< Widget for sidebar tab item
133 #endif // SIDEPANEL_H