Eneboo - Documentación para desarrolladores
|
00001 #ifndef __SHORTCUT_HANDLER_H__ 00002 #define __SHORTCUT_HANDLER_H__ 00003 00004 /* 00005 QtCurve (C) Craig Drummond, 2007 - 2010 craig.p.drummond@gmail.com 00006 00007 ---- 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public 00011 License version 2 as published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; see the file COPYING. If not, write to 00020 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 Boston, MA 02110-1301, USA. 00022 */ 00023 00024 #include <qobject.h> 00025 #include <qvaluelist.h> 00026 #include <qevent.h> 00027 00028 class QWidget; 00029 00030 class ShortcutHandler : public QObject 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 00036 explicit ShortcutHandler(QObject *parent = 0); 00037 virtual ~ShortcutHandler(); 00038 00039 bool hasSeenAlt(const QWidget *widget) const; 00040 bool isAltDown() const { return itsAltDown; } 00041 bool showShortcut(const QWidget *widget) const; 00042 00043 private slots: 00044 00045 void widgetDestroyed(QObject *o); 00046 00047 protected: 00048 00049 void updateWidget(QWidget *w); 00050 void setSeenAlt(QWidget *w); 00051 bool eventFilter(QObject *watched, QEvent *event); 00052 00053 private: 00054 00055 bool itsAltDown; 00056 QValueList<QWidget *> itsSeenAlt, 00057 itsUpdated, 00058 itsOpenMenus; 00059 00060 }; 00061 00062 #endif