| 1 |
/*************************************************************************** |
| 2 |
* Copyright (C) 2013~2013 by CSSlayer * |
| 3 |
* * |
| 4 |
* This program is free software; you can redistribute it and/or modify * |
| 5 |
* it under the terms of the GNU General Public License as published by * |
| 6 |
* the Free Software Foundation; either version 2 of the License, or * |
| 7 |
* (at your option) any later version. * |
| 8 |
* * |
| 9 |
* This program is distributed in the hope that it will be useful, * |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 12 |
* GNU General Public License for more details. * |
| 13 |
* * |
| 14 |
* You should have received a copy of the GNU General Public License * |
| 15 |
* along with this program; if not, write to the * |
| 16 |
* Free Software Foundation, Inc., * |
| 17 |
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * |
| 18 |
***************************************************************************/ |
| 19 |
|
| 20 |
/* this is forked from kdelibs/kdeui/kkeysequencewidget_p.h */ |
| 21 |
|
| 22 |
/* |
| 23 |
Original Copyright header |
| 24 |
Copyright (C) 2001, 2002 Ellis Whitehead <[email protected]> |
| 25 |
Copyright (C) 2007 Andreas Hartmetz <[email protected]> |
| 26 |
|
| 27 |
This library is free software; you can redistribute it and/or |
| 28 |
modify it under the terms of the GNU Library General Public |
| 29 |
License as published by the Free Software Foundation; either |
| 30 |
version 2 of the License, or (at your option) any later version. |
| 31 |
|
| 32 |
This library is distributed in the hope that it will be useful, |
| 33 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 34 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 35 |
Library General Public License for more details. |
| 36 |
|
| 37 |
You should have received a copy of the GNU Library General Public License |
| 38 |
along with this library; see the file COPYING.LIB. If not, write to |
| 39 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 40 |
Boston, MA 02110-1301, USA. |
| 41 |
*/ |
| 42 |
#ifndef FCITXQT_KEYSEQUENCEWIDGET_P_H |
| 43 |
#define FCITXQT_KEYSEQUENCEWIDGET_P_H |
| 44 |
|
| 45 |
#include <QHBoxLayout> |
| 46 |
#include <QPushButton> |
| 47 |
#include <QToolButton> |
| 48 |
|
| 49 |
class FcitxQtKeySequenceWidgetPrivate; |
| 50 |
class FcitxQtKeySequenceButton : public QPushButton { |
| 51 |
Q_OBJECT |
| 52 |
|
| 53 |
public: |
| 54 |
explicit FcitxQtKeySequenceButton(FcitxQtKeySequenceWidgetPrivate *d, |
| 55 |
QWidget *parent) |
| 56 |
: QPushButton(parent), d(d) {} |
| 57 |
|
| 58 |
virtual ~FcitxQtKeySequenceButton(); |
| 59 |
|
| 60 |
protected: |
| 61 |
/** |
| 62 |
* Reimplemented for internal reasons. |
| 63 |
*/ |
| 64 |
virtual bool event(QEvent *event); |
| 65 |
virtual void keyPressEvent(QKeyEvent *event); |
| 66 |
virtual void keyReleaseEvent(QKeyEvent *event); |
| 67 |
|
| 68 |
private: |
| 69 |
FcitxQtKeySequenceWidgetPrivate *const d; |
| 70 |
}; |
| 71 |
|
| 72 |
#endif // FCITXQT_KEYSEQUENCEWIDGET_P_H |