00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Pekka Nissinen - pekka.nissinen@ixonos.com 00006 Kaj Wallin - kaj.wallin@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 ZOOMBUTTONPANEL_H 00024 #define ZOOMBUTTONPANEL_H 00025 00026 #include <QWidget> 00027 #include <QGridLayout> 00028 #include <QGraphicsItem> 00029 00030 #include "zoombutton.h" 00031 00038 class ZoomButtonPanel : public QWidget 00039 { 00040 Q_OBJECT 00041 00042 public: 00048 ZoomButtonPanel(QWidget *parent = 0); 00049 00050 /******************************************************************************* 00051 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00052 ******************************************************************************/ 00053 protected: 00059 void mouseMoveEvent(QMouseEvent *event); 00060 00066 void mousePressEvent(QMouseEvent *event); 00067 00073 void mouseReleaseEvent(QMouseEvent *event); 00074 00075 /******************************************************************************* 00076 * MEMBER FUNCTIONS AND SLOTS 00077 ******************************************************************************/ 00078 public: 00084 const ZoomButton* zoomInButton(); 00085 00091 const ZoomButton* zoomOutButton(); 00092 00093 public slots: 00097 void disableZoomInButton(); 00098 00102 void disableZoomOutButton(); 00103 00107 void resetButtons(); 00108 00112 void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0)); 00113 00119 void screenResized(const QSize &size); 00120 00121 private slots: 00125 void forceMouseRelease(); 00126 00130 void timerExpired(); 00131 00132 /******************************************************************************* 00133 * DATA MEMBERS 00134 ******************************************************************************/ 00135 private: 00136 bool m_isDraggable; 00137 00138 QGridLayout m_panelLayout; 00139 00140 QPoint m_dragPosition; 00141 00142 QIcon::Mode m_zoomInMode; 00143 QIcon::Mode m_zoomOutMode; 00144 00145 QSize m_screenSize; 00146 00147 QTimer *m_dragStartTimer; 00148 QTimer *m_forceReleaseTimer; 00149 00150 ZoomButton *m_zoomInButton; 00151 ZoomButton *m_zoomOutButton; 00152 }; 00153 00154 #endif // ZOOMBUTTONPANEL_H