Made a few corrections according to Sami's suggestions
[situare] / src / ui / paneltab.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 PANELTAB_H
23 #define PANELTAB_H
24
25 #include <QToolButton>
26
27 class QMouseEvent;
28
29 /**
30  * @brief Class for tab button
31  *
32  * @author Pekka Nissinen - pekka.nissinen@ixonos.com
33  */
34 class PanelTab : public QToolButton
35 {
36     Q_OBJECT
37
38 public:
39     /**
40      * @brief Constructor
41      *
42      * @param parent Parent
43      */
44     PanelTab(QWidget *parent = 0);
45
46 /*******************************************************************************
47  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
48  ******************************************************************************/
49 protected:
50     /**
51      * @brief Move event for the distance indicator button
52      *
53      * @param event Mouse event
54      */
55     void mouseMoveEvent(QMouseEvent *event);
56
57     /**
58      * @brief Event handler for mouse press events
59      *
60      * @param event Mouse event
61      */
62     void mousePressEvent(QMouseEvent *event);
63
64     /**
65      * @brief Event handler for mouse release events
66      *
67      * @param event Mouse event
68      */
69     void mouseReleaseEvent(QMouseEvent *event);
70
71     /**
72      * @brief Draws the tab button
73      *
74      * @param event Paint event
75      */
76     void paintEvent(QPaintEvent *event);
77
78 /*******************************************************************************
79  * DATA MEMBERS
80  ******************************************************************************/
81 private:
82     bool m_tabActive;   ///< Boolean used to track whether the tab button is active or not
83     bool m_tabSelected; ///< Boolean used to track whether the tab button is selected or not
84
85     QPixmap m_tabActiveImage;    ///< Pixmap for active tab button
86     QPixmap m_tabInactiveImage;  ///< Pixmap for inactive tab button
87     QPixmap m_tabInactiveImage2; ///< Pixmap for inactive tab button below active tab button
88
89     QRect m_tabRect;        ///< Rect for the tab button
90 };
91
92 #endif // PANELTAB_H