File indexing completed on 2024-04-28 16:44:49
0001 #ifndef SHORTCUT_TRIGGER_WIDGET_H 0002 #define SHORTCUT_TRIGGER_WIDGET_H 0003 /* 0004 SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #include <QAction> 0010 0011 #include "trigger_widget_base.h" 0012 #include "ui_shortcut_trigger_widget.h" 0013 0014 class QKeySequence; 0015 0016 /** 0017 * @author Michael Jansen <kde@michael-jansen.biz> 0018 */ 0019 class ShortcutTriggerWidget : public TriggerWidgetBase 0020 { 0021 Q_OBJECT 0022 0023 typedef TriggerWidgetBase Base; 0024 0025 public: 0026 /** 0027 * Default constructor 0028 */ 0029 ShortcutTriggerWidget(KHotKeys::ShortcutTrigger *trigger, QWidget *parent = nullptr); 0030 0031 /** 0032 * Destructor 0033 */ 0034 ~ShortcutTriggerWidget() override; 0035 0036 KHotKeys::ShortcutTrigger *trigger() override; 0037 const KHotKeys::ShortcutTrigger *trigger() const override; 0038 0039 bool isChanged() const override; 0040 0041 private Q_SLOTS: 0042 0043 //! Invoked if the global shortcut is changed for the corresponding 0044 // shortcut trigger 0045 void _k_globalShortcutChanged(QAction *action, const QKeySequence &seq); 0046 0047 private: 0048 void doCopyFromObject() override; 0049 void doCopyToObject() override; 0050 0051 Ui::ShortcutTriggerWidget shortcut_trigger_ui; 0052 }; 0053 0054 #endif /* #ifndef SHORTCUT_TRIGGER_WIDGET_H */