00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Kaj Wallin - kaj.wallin@ixonos.com 00006 Pekka Nissinen - pekka.nissinen@ixonos.com 00007 00008 Situare is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 version 2 as published by the Free Software Foundation. 00011 00012 Situare is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Situare; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 USA. 00021 */ 00022 00023 #ifndef SIDEPANEL_H 00024 #define SIDEPANEL_H 00025 00026 #include <QWidget> 00027 #include <QtGui> 00028 00029 class PanelSliderBar; 00030 class SidePanelBase; 00031 00040 class SidePanel : public QWidget 00041 { 00042 Q_OBJECT 00043 00044 public: 00050 SidePanel(QWidget *parent = 0); 00051 00058 enum PanelType {UserPanel, FriendPanel, None}; 00059 00060 /****************************************************************************** 00061 * MEMBER FUNCTIONS AND SLOTS 00062 ******************************************************************************/ 00063 public: 00075 void setType(SidePanel::PanelType type); 00076 00077 public slots: 00081 void openPanel(); 00082 00086 void closePanel(); 00087 00093 void resizePanel(const QSize &size); 00094 00095 private slots: 00099 void stateChangedToClosed(); 00100 00104 void stateChangedToOpen(); 00105 00106 /****************************************************************************** 00107 * SIGNALS 00108 ******************************************************************************/ 00109 signals: 00116 void toggleState(); 00117 00124 void panelClosed(); 00125 00132 void panelOpened(); 00133 00134 /******************************************************************************* 00135 * DATA MEMBERS 00136 *******************************************************************************/ 00137 protected: 00138 QVBoxLayout *m_panelVBox; 00139 00140 private: 00141 bool m_isOpen; 00142 00143 QSignalTransition *m_panelTransitionClose; 00144 QSignalTransition *m_panelTransitionOpen; 00145 QState *m_panelStateClosed; 00146 QState *m_panelStateOpened; 00147 QStateMachine *m_panelStateMachine; 00148 00149 SidePanelBase *m_panelBase; 00150 PanelType currentType; 00151 PanelSliderBar *m_panelSlidingBar; 00152 }; 00153 00154 #endif // SIDEPANEL_H