File indexing completed on 2024-10-06 13:19:04

0001 /*
0002    SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #ifndef HOTKEYS_WIDGET_BASE_H
0007 #define HOTKEYS_WIDGET_BASE_H
0008 
0009 #include "ui_hotkeys_widget_base.h"
0010 
0011 #include "hotkeys_widget_iface.h"
0012 #include "libkhotkeysfwd.h"
0013 
0014 class HotkeysWidgetBasePrivate;
0015 
0016 /**
0017  * @author Michael Jansen <kde@michael-jansen.biz>
0018  */
0019 class HotkeysWidgetBase : public HotkeysWidgetIFace
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     /**
0025      * Default constructor
0026      */
0027     HotkeysWidgetBase(QWidget *parent = nullptr);
0028 
0029     /**
0030      * Destructor
0031      */
0032     ~HotkeysWidgetBase() override;
0033 
0034     void apply() override;
0035 
0036     /**
0037      * The associated action.
0038      */
0039     KHotKeys::ActionDataBase *data()
0040     {
0041         return _data;
0042     }
0043 
0044     const KHotKeys::ActionDataBase *data() const
0045     {
0046         return _data;
0047     }
0048 
0049     bool isChanged() const override;
0050 
0051     using HotkeysWidgetIFace::changed;
0052 
0053 Q_SIGNALS:
0054 
0055     void changed(KHotKeys::ActionDataBase *);
0056 
0057 protected:
0058 #if 0
0059     /**
0060      * Append the QLayoutItems from QGridLayout \from to QGridLayout \to.
0061      */
0062     void mergeLayouts( QGridLayout *to, QGridLayout *from );
0063 #endif
0064 
0065 protected:
0066     void extend(QWidget *, const QString &);
0067 
0068     void doCopyFromObject() override;
0069     void doCopyToObject() override;
0070 
0071     Ui::HotkeysWidgetBase ui;
0072 
0073     KHotKeys::ActionDataBase *_data;
0074 };
0075 
0076 #endif /* #ifndef HOTKEYS_WIDGET_BASE_H */