File indexing completed on 2025-01-26 05:09:00

0001 /*
0002     SPDX-FileCopyrightText: 2009 Aaron Seigo <aseigo@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Plasma5Support/Service>
0010 #include <Plasma5Support/ServiceJob>
0011 
0012 class KModifierKeyInfo;
0013 
0014 class KeyService : public Plasma5Support::Service
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     KeyService(QObject *parent, KModifierKeyInfo *keyInfo, Qt::Key key);
0020     void lock(bool lock);
0021     void latch(bool lock);
0022 
0023 protected:
0024     Plasma5Support::ServiceJob *createJob(const QString &operation, QMap<QString, QVariant> &parameters) override;
0025 
0026 private:
0027     KModifierKeyInfo *m_keyInfo;
0028     Qt::Key m_key;
0029 };
0030 
0031 class LockKeyJob : public Plasma5Support::ServiceJob
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     LockKeyJob(KeyService *service, const QMap<QString, QVariant> &parameters);
0037     void start() override;
0038 
0039 private:
0040     KeyService *m_service;
0041 };
0042 
0043 class LatchKeyJob : public Plasma5Support::ServiceJob
0044 {
0045     Q_OBJECT
0046 
0047 public:
0048     LatchKeyJob(KeyService *service, const QMap<QString, QVariant> &parameters);
0049     void start() override;
0050 
0051 private:
0052     KeyService *m_service;
0053 };