Added method for setting the context buttons
[situare] / src / ui / panelcontextbuttonbar.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 PANELCONTEXTBUTTONBAR_H
23 #define PANELCONTEXTBUTTONBAR_H
24
25 #include <QWidget>
26
27 class ImageButton;
28
29 class PanelContextButtonBar : public QWidget
30 {
31     Q_OBJECT
32
33 public:
34     /**
35      * @brief Constructor
36      *
37      * @param parent Parent
38      */
39     PanelContextButtonBar(QWidget *parent = 0);
40
41 /*******************************************************************************
42  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
43  ******************************************************************************/
44 protected:
45     /**
46      * @brief Draws the bar
47      *
48      * @param event Paint event
49      */
50     void paintEvent(QPaintEvent *event);
51
52 /*******************************************************************************
53  * MEMBER FUNCTIONS AND SLOTS
54  ******************************************************************************/
55 public:
56     /**
57      * @brief Sets the context buttons to the context button bar
58      *
59      * @param contextButtonList List of context buttons
60      */
61     void setContextButtons(const QList<ImageButton *> &contextButtonList);
62
63 /*******************************************************************************
64  * SIGNALS
65  ******************************************************************************/
66 signals:
67     /**
68      * @brief This signal is called when context button bar needs to be repositioned
69      */
70     void positionChangeRequested();
71
72 /*******************************************************************************
73  * DATA MEMBERS
74  ******************************************************************************/
75 private:
76     QList<ImageButton *> m_contextButtonList;
77
78     QPixmap m_barTile;  ///< Pixmap for button bar
79     QPixmap m_barTop;   ///< Pixmap for button bar top
80
81     QRect m_barRect;    ///< Rect for the button bar
82 };
83
84 #endif // PANELCONTEXTBUTTONBAR_H