Debian Codegraph @

qt6/widgetsaddons/fcitxqtkeysequencewidget_p.h

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