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 INDICATORBUTTONPANEL_H
24 #define INDICATORBUTTONPANEL_H
26 #include <QGraphicsItem>
27 #include <QGridLayout>
33 #include "indicatorbutton.h"
36 * @brief Panel for zoom buttons
38 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
39 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
41 class IndicatorButtonPanel : public QWidget
49 * @param parent Parent
51 IndicatorButtonPanel(QWidget *parent = 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);
79 * @brief Event handler for paint events
82 * @param event Paint event
84 void paintEvent(QPaintEvent *event);
86 /*******************************************************************************
87 * MEMBER FUNCTIONS AND SLOTS
88 ******************************************************************************/
91 // * @brief Getter for the zoom in button
93 // * @return Pointer to the zoomInButton
95 // const IndicatorButton* IndicatorButtonPanel::indicatorButton();
99 // * @brief Disables the zoom in button
101 // void disableZoomInButton();
104 // * @brief Disables the zoom out button
106 // void disableZoomOutButton();
109 // * @brief Reset zoom button states to normal
111 // void resetButtons();
114 * @brief Toggle zoom panel draggability
116 void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0));
119 * @brief Slot to redraw the panel after window resize event
121 * @param size Size of the new screen
123 void screenResized(const QSize &size);
127 * @brief Safeguard slot to release mouse grab if something goes horribly wrong
129 void forceMouseRelease();
132 * @brief Slot that handles drag initialization once timer has timed out
136 /*******************************************************************************
138 ******************************************************************************/
140 bool m_isDraggable; ///< Boolean for tracking the draggability state
142 QLabel *m_distanceTextLabel; ///< Pointer to locationLabel
144 QPoint m_dragPosition; ///< Location from where the widget is grabbed
146 // QIcon::Mode m_zoomInMode; ///< Store for zoom in button mode before dragging
147 // QIcon::Mode m_zoomOutMode; ///< Store for zoom out button mode before dragging
149 QSize m_screenSize; ///< Store for the screen size
151 QTimer *m_dragStartTimer; ///< Timer to init draggability of the zoom panel
152 QTimer *m_forceReleaseTimer; ///< Timer to run forceMouseRelease;
154 IndicatorButton *m_indicatorButton; ///< Button for zoom in
158 #endif // INDICATORBUTTONPANEL_H