00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Kaj Wallin - kaj.wallin@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 #ifndef SIDEPANEL_H 00023 #define SIDEPANEL_H 00024 00025 #include <QWidget> 00026 #include <QtGui> 00027 #include "panelcommon.h" 00028 00029 class PanelSliderBar; 00030 00037 class SidePanel : public QWidget 00038 { 00039 Q_OBJECT 00040 00041 public: 00047 SidePanel(QWidget *parent = 0); 00048 00055 enum PanelType {UserPanel, FriendPanel, None}; 00056 /****************************************************************************** 00057 * MEMBER FUNCTIONS AND SLOTS 00058 ******************************************************************************/ 00059 public slots: 00063 void openPanel(); 00064 00068 void closePanel(); 00069 00075 void screenResized(const QSize &size); 00076 00088 void setType(SidePanel::PanelType type); 00089 00090 00091 private slots: 00095 void stateChangedToClosed(); 00099 void stateChangedToOpen(); 00100 00101 /****************************************************************************** 00102 * SIGNALS 00103 ******************************************************************************/ 00104 signals: 00111 void toggleState(); 00112 00119 void panelClosed(); 00120 00127 void panelOpened(); 00128 00129 /******************************************************************************* 00130 * DATA MEMBERS 00131 *******************************************************************************/ 00132 protected: 00133 QVBoxLayout *m_panelVBox; 00134 00135 private: 00136 bool m_isOpen; 00137 QSignalTransition *m_panelTransitionClose; 00138 QSignalTransition *m_panelTransitionOpen; 00139 QState *m_panelStateClosed; 00140 QState *m_panelStateOpened; 00141 QStateMachine *m_panelStateMachine; 00142 QWidget *m_panelBase; 00143 00144 PanelType currentType; 00145 PanelSliderBar *m_panelSlidingBar; 00146 }; 00147 00148 #endif // SIDEPANEL_H