00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Pekka Nissinen - pekka.nissinen@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 MAPZOOMPANEL_H 00023 #define MAPZOOMPANEL_H 00024 00025 #include <QRectF> 00026 #include <QWidget> 00027 #include <QPainter> 00028 #include <QGraphicsItem> 00029 #include <QStyleOptionGraphicsItem> 00030 #include <QGraphicsSceneMouseEvent> 00031 00032 #include "mapbutton.h" 00033 00039 class MapZoomPanel : public QObject, public QGraphicsItem 00040 { 00041 Q_OBJECT 00042 00043 public: 00051 MapZoomPanel(QGraphicsItem *parent = 0, int x = 0, int y = 0); 00052 00056 ~MapZoomPanel(); 00057 00058 /******************************************************************************* 00059 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00060 ******************************************************************************/ 00061 public: 00065 QRectF boundingRect() const; 00066 00074 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 00075 00076 protected: 00082 void mousePressEvent(QGraphicsSceneMouseEvent *event); 00083 00089 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 00090 00091 /******************************************************************************* 00092 * SIGNALS 00093 ******************************************************************************/ 00094 signals: 00098 void zoomInPressed(); 00099 00103 void zoomOutPressed(); 00104 00105 /******************************************************************************* 00106 * DATA MEMBERS 00107 ******************************************************************************/ 00108 private: 00109 MapButton *m_zoomInBtn; 00110 MapButton *m_zoomOutBtn; 00111 qreal m_x; 00112 qreal m_y; 00113 qreal m_width; 00114 qreal m_height; 00115 }; 00116 00117 #endif // MAPZOOMPANEL_H