2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Pekka Nissinen - pekka.nissinen@ixonos.com
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.
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.
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,
28 #include <QPushButton>
29 #include <QMouseEvent>
30 #include <QPaintEvent>
33 * @brief A simple class for icon button
35 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
37 class ImageButton : public QPushButton
45 * @param parent Parent
46 * @param normalIconPictureFileName Normal state Icon image file name
47 * @param selectedIconPictureFileName Selected state Icon image file name (optional)
49 ImageButton(QWidget *parent = 0, QString normalIconPictureFileName = "",
50 QString selectedIconPictureFileName = "");
52 /*******************************************************************************
53 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
54 ******************************************************************************/
57 * @brief Event handler for mouse press events
59 * @param event Mouse event
61 void mousePressEvent(QMouseEvent *event);
64 * @brief Event handler for mouse release events
66 * @param event Mouse event
68 void mouseReleaseEvent(QMouseEvent *event);
71 * @brief Event handler for paint events
73 * Paints the button and its icon
74 * @param event Paint event
76 void paintEvent(QPaintEvent *event);
78 /*******************************************************************************
79 * MEMBER FUNCTIONS AND SLOTS
80 ******************************************************************************/
83 * @brief Sets the button icon mode
85 * @param mode Button icon mode
87 void setMode(QIcon::Mode mode);
89 /*******************************************************************************
91 ******************************************************************************/
93 QIcon::Mode m_buttonMode; ///< Button mode (Normal, Selected etc...)
94 QSize m_buttonSize; ///< Button size
97 #endif // IMAGEBUTTON_H