Added the new ZoomButtonPanel class
[situare] / src / ui / zoombuttonpanel.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Pekka Nissinen - pekka.nissinen@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #ifndef ZOOMBUTTONPANEL_H
23 #define ZOOMBUTTONPANEL_H
24
25 #include <QRectF>
26 #include <QWidget>
27 #include <QPainter>
28 #include <QGraphicsItem>
29 #include <QGridLayout>
30 #include <QStyleOptionGraphicsItem>
31 #include <QGraphicsSceneMouseEvent>
32
33 #include "imagebutton.h"
34
35 /**
36 * @brief Panel for zoom buttons
37 *
38 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
39 */
40 class ZoomButtonPanel : public QWidget
41 {
42     Q_OBJECT
43
44 public:
45     /**
46     * @brief Constructor
47     *
48     * @param parent Parent
49     * @param x Panel x coordinate
50     * @param y Panel y coordinate
51     */
52     ZoomButtonPanel(QWidget *parent = 0, int x = 0, int y = 0);
53
54     /**
55     * @brief Destructor
56     */
57     ~ZoomButtonPanel();
58
59 /*******************************************************************************
60  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
61  ******************************************************************************/
62 protected:
63     void paintEvent(QPaintEvent *event);
64
65 /*******************************************************************************
66  * DATA MEMBERS
67  ******************************************************************************/
68 public:
69     ImageButton *m_zoomInBtn;     ///< Button for zoom in
70     ImageButton *m_zoomOutBtn;    ///< Button for zoom out
71
72 private:
73     QGridLayout m_panelLayout;  ///< Panel layout
74     int m_x;                    ///< Panel x coordinate
75     int m_y;                    ///< Panel y coordinate
76 };
77
78 #endif // ZOOMBUTTONPANEL_H