Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpadx/src/kcm/touchpadconfigcontainer.h
- This file was copied from kcms/touchpad/src/kcm/libinput/touchpadconfiglibinput.h.
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef TOUCHPADCONFIGLIBINPUT_H | 19 | #ifndef TOUCHPADCONFIGCONTAINER_H | ||
20 | #define TOUCHPADCONFIGLIBINPUT_H | 20 | #define TOUCHPADCONFIGCONTAINER_H | ||
21 | 21 | | |||
22 | #include "../touchpadconfigplugin.h" | 22 | #include <KCModule> | ||
23 | 23 | | |||
24 | class TouchpadBackend; | 24 | class TouchpadConfigPlugin; | ||
25 | class QHideEvent; | 25 | class TouchpadConfigXlib; | ||
26 | class QQuickWidget; | | |||
27 | class KMessageWidget; | | |||
28 | 26 | | |||
29 | class TouchpadConfigLibinput : public TouchpadConfigPlugin | 27 | class TouchpadConfigContainer : public KCModule | ||
30 | { | 28 | { | ||
31 | Q_OBJECT | 29 | Q_OBJECT | ||
32 | 30 | | |||
31 | friend TouchpadConfigXlib; | ||||
32 | | ||||
33 | public: | 33 | public: | ||
34 | explicit TouchpadConfigLibinput(TouchpadConfigContainer *parent, | 34 | explicit TouchpadConfigContainer(QWidget *parent, | ||
35 | const QVariantList &args = QVariantList()); | 35 | const QVariantList &args = QVariantList()); | ||
36 | virtual ~TouchpadConfigLibinput() {} | 36 | | ||
37 | QSize minimumSizeHint() const override; | ||||
38 | QSize sizeHint() const override; | ||||
39 | void resizeEvent(QResizeEvent *event) override; | ||||
37 | 40 | | |||
38 | void load() override; | 41 | void load() override; | ||
39 | void save() override; | 42 | void save() override; | ||
40 | void defaults() override; | 43 | void defaults() override; | ||
41 | 44 | | |||
42 | QSize sizeHint() const override; | 45 | void kcmLoad() {KCModule::load();} | ||
43 | QSize minimumSizeHint() const override; | 46 | void kcmSave() {KCModule::save();} | ||
44 | 47 | void kcmDefaults() {KCModule::defaults();} | |||
45 | void hideEvent(QHideEvent *) override {} | | |||
46 | 48 | | |||
47 | private Q_SLOTS: | 49 | protected: | ||
48 | void onChange(); | 50 | void hideEvent(QHideEvent *) override; | ||
49 | void onTouchpadAdded(bool success); | | |||
50 | void onTouchpadRemoved(int index); | | |||
51 | 51 | | |||
52 | private: | 52 | private: | ||
53 | void hideErrorMessage(); | 53 | TouchpadConfigPlugin* m_plugin = nullptr; | ||
54 | | ||||
55 | QQuickWidget *m_view; | | |||
56 | KMessageWidget *m_errorMessage; | | |||
57 | | ||||
58 | bool m_initError; | | |||
59 | }; | 54 | }; | ||
60 | 55 | | |||
61 | #endif // TOUCHPADCONFIGLIBINPUT_H | 56 | #endif // TOUCHPADCONFIGCONTAINER_H |