2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Pekka Nissinen - pekka.nissinen@ixonos.com
6 Kaj Wallin - kaj.wallin@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
23 #ifndef ZOOMBUTTONPANEL_H
24 #define ZOOMBUTTONPANEL_H
27 #include <QPaintEvent>
28 #include <QGridLayout>
29 #include <QGraphicsItem>
31 #include "imagebutton.h"
34 * @brief Panel for zoom buttons
36 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
37 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
39 class ZoomButtonPanel : public QWidget
47 * @param parent Parent
48 * @param x Panel x coordinate
49 * @param y Panel y coordinate
51 ZoomButtonPanel(QWidget *parent = 0, int x = 0, int y = 0);
53 /*******************************************************************************
54 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
55 ******************************************************************************/
58 * @brief Move event for the zoom button panel
62 void mouseMoveEvent(QMouseEvent *event);
65 * @brief Press event for the zoom button panel
69 void mousePressEvent(QMouseEvent *event);
72 * @brief Event handler for mouse release events
74 * @param event Mouse event
76 void mouseReleaseEvent(QMouseEvent *event);
78 /*******************************************************************************
79 * MEMBER FUNCTIONS AND SLOTS
80 ******************************************************************************/
83 * @brief Disables the Zoom In button
85 void disableZoomInButton();
88 * @brief Disables the Zoom Out button
90 void disableZoomOutButton();
93 * @brief Reset Zoom button states to normal
98 * @brief Toggle zoom panel draggability
100 void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0));
102 void screenResized(const QSize &size);
106 * @brief Slot to emit signal to zoom button panel to start drag mode after timer timeout
110 /*******************************************************************************
112 ******************************************************************************/
114 ImageButton *m_zoomInButton; ///< Button for zoom in
115 ImageButton *m_zoomOutButton; ///< Button for zoom out
118 bool m_isDraggable; ///< Boolean for tracking the draggability state
120 int m_x; ///< Panel x coordinate
121 int m_y; ///< Panel y coordinate
123 QGridLayout m_panelLayout; ///< Panel layout
125 QPoint m_dragPosition; ///< Location from where the widget is grabbed
127 QIcon::Mode m_zoomInMode; ///< Store for zoom in button mode before dragging
128 QIcon::Mode m_zoomOutMode; ///< Store for zoom out button mode before dragging
130 QSize m_screenSize; ///< Store for the screen size
132 QTimer *m_dragStartTimer; ///< Timer to init draggability of the zoom panel
134 QWidget *m_eventBlocker; ///< Overlaying widget that catches the mouse events
137 #endif // ZOOMBUTTONPANEL_H