00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Pekka Nissinen - pekka.nissinen@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 #ifndef PANELCONTEXTBUTTONBAR_H 00023 #define PANELCONTEXTBUTTONBAR_H 00024 00025 #include <QWidget> 00026 00027 class QState; 00028 00034 class PanelContextButtonBar : public QWidget 00035 { 00036 Q_OBJECT 00037 00038 public: 00044 PanelContextButtonBar(QWidget *parent = 0); 00045 00046 /******************************************************************************* 00047 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00048 ******************************************************************************/ 00049 protected: 00055 void paintEvent(QPaintEvent *event); 00056 00057 /******************************************************************************* 00058 * MEMBER FUNCTIONS AND SLOTS 00059 ******************************************************************************/ 00060 public: 00064 void hideContextButtonBar(); 00065 00071 bool isBarVisible() const; 00072 00079 void move(int x, int y); 00080 00086 void setContextButtons(QWidget *contextButtons); 00087 00091 void showContextButtonBar(); 00092 00093 private slots: 00097 void contextButtonBarStateChanged(); 00098 00099 /******************************************************************************* 00100 * SIGNALS 00101 ******************************************************************************/ 00102 signals: 00106 void barHidden(); 00107 00111 void barVisible(); 00112 00116 void positionChangeRequested(); 00117 00121 void toggleState(); 00122 00123 /******************************************************************************* 00124 * DATA MEMBERS 00125 ******************************************************************************/ 00126 private: 00127 bool m_visible; 00128 00129 QPixmap m_barTile; 00130 QPixmap m_barTop; 00131 00132 QRect m_barRect; 00133 00134 QState *m_stateHidden; 00135 QState *m_stateVisible; 00136 00137 QWidget *m_contextButtons; 00138 }; 00139 00140 #endif // PANELCONTEXTBUTTONBAR_H