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,
22 #ifndef PANELCONTEXTBUTTONBAR_H
23 #define PANELCONTEXTBUTTONBAR_H
30 * @brief Base class for panel context button bar
32 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
34 class PanelContextButtonBar : public QWidget
42 * @param parent Parent
44 PanelContextButtonBar(QWidget *parent = 0);
46 /*******************************************************************************
47 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
48 ******************************************************************************/
51 * @brief Draws the bar
53 * @param event Paint event
55 void paintEvent(QPaintEvent *event);
57 /*******************************************************************************
58 * MEMBER FUNCTIONS AND SLOTS
59 ******************************************************************************/
62 * @brief Hides the context button bar
64 void hideContextButtonBar();
67 * @brief Returns the current state of the context button bar
69 * @return Current state
71 bool isBarVisible() const;
74 * @brief Moves the context button bar to desired position
76 * @param x Horizontal position
77 * @param y Vertical position
79 void move(int x, int y);
82 * @brief Sets the context buttons to the context button bar
84 * @param contextButtons Pointer to context buttons
86 void setContextButtons(QWidget *contextButtons);
89 * @brief Shows the context button bar
91 void showContextButtonBar();
95 * @brief Internal slot used to set the context button bar state
97 void contextButtonBarStateChanged();
99 /*******************************************************************************
101 ******************************************************************************/
104 * @brief Signal that is sent when context button bar is hidden
109 * @brief Signal that is sent when context button bar is visible
114 * @brief This signal is called when context button bar needs to be repositioned
116 void positionChangeRequested();
119 * @brief Signal that is sent when the context button bar state must be changed
123 /*******************************************************************************
125 ******************************************************************************/
127 bool m_visible; ///< Current state of the context button bar
129 QPixmap m_barTile; ///< Pixmap for button bar
130 QPixmap m_barTop; ///< Pixmap for button bar top
132 QRect m_barRect; ///< Rect for the button bar
134 QState *m_stateHidden; ///< State of the hidden context button bar
135 QState *m_stateVisible; ///< State of the visible context button bar
137 QWidget *m_contextButtons; ///< Widget for context buttons
140 #endif // PANELCONTEXTBUTTONBAR_H