File indexing completed on 2024-05-26 05:37:15

0001 /*
0002     SPDX-FileCopyrightText: 2017 Roman Gilg <subdiff@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KCModule>
0010 #include <KPluginMetaData>
0011 
0012 #include <QQuickWidget>
0013 
0014 #include "touchpadbackend.h"
0015 
0016 class TouchpadConfigPlugin;
0017 class TouchpadConfigLibinput;
0018 
0019 class TouchpadConfig : public KCModule
0020 {
0021     Q_OBJECT
0022 
0023     friend TouchpadConfigLibinput;
0024 
0025 public:
0026     explicit TouchpadConfig(QObject *parent, const KPluginMetaData &data);
0027 
0028     static void kcmInit();
0029 
0030     void load() override;
0031     void save() override;
0032     void defaults() override;
0033 
0034 Q_SIGNALS:
0035     void showMessage(const QString message, int type = 3 /*Kirigami.MessageType.Error*/);
0036 
0037 private Q_SLOTS:
0038     void onChange();
0039     void onTouchpadAdded(bool success);
0040     void onTouchpadRemoved(int index);
0041 
0042 private:
0043     void hideErrorMessage();
0044 
0045     QQuickWidget *m_view;
0046     TouchpadBackend *m_backend;
0047     bool m_initError;
0048 };