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 PANELSLIDERBAR_H 00024 #define PANELSLIDERBAR_H 00025 00026 #include <QMouseEvent> 00027 #include <QPaintEvent> 00028 #include <QPixmap> 00029 #include <QRect> 00030 #include <QWidget> 00031 00032 #include "panelcommon.h" 00033 00042 class PanelSliderBar : public QWidget 00043 { 00044 Q_OBJECT 00045 00046 public: 00053 PanelSliderBar(QWidget *parent, Side side); 00054 00061 enum SliderBarState {Open, Closed}; 00062 00063 /******************************************************************************* 00064 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00065 ******************************************************************************/ 00066 protected: 00072 void paintEvent(QPaintEvent *); 00073 00081 void mouseReleaseEvent(QMouseEvent *); 00082 00083 /******************************************************************************* 00084 * MEMBER FUNCTIONS AND SLOTS 00085 ******************************************************************************/ 00086 public slots: 00092 void changeDirection(SliderBarState state); 00093 00099 void resizeSliderBar(const QSize &size); 00100 00101 /******************************************************************************* 00102 * SIGNALS 00103 ******************************************************************************/ 00104 signals: 00110 void clicked(); 00111 00112 /******************************************************************************* 00113 * DATA MEMBERS 00114 ******************************************************************************/ 00115 private: 00116 int m_sliderDirection; 00117 00118 QPixmap m_menuDropShadowTile; 00119 QPixmap m_sliderButton; 00120 QPixmap m_sliderButtonArrows[2]; 00121 QPixmap m_sliderTile; 00122 QRect m_bottomRect; 00123 QRect m_buttonRect; 00124 QRect m_topRect; 00125 QRegion m_sliderRegion; 00126 00127 Side m_sliderSide; 00128 }; 00129 #endif // PANELSLIDERBAR_H