2023-11-15 07:13:05 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2025-05-22 15:45:44 +00:00
|
|
|
#include <QList>
|
2023-11-15 07:13:05 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <qqmlregistration.h>
|
|
|
|
|
|
2025-05-22 15:45:44 +00:00
|
|
|
#include "hapticinterface.h"
|
|
|
|
|
#include "vibrationevent.h"
|
|
|
|
|
|
|
|
|
|
#include <QCoroDBusPendingReply>
|
2023-11-15 07:13:05 +00:00
|
|
|
|
|
|
|
|
class VibrationManager : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
QML_ELEMENT
|
|
|
|
|
QML_SINGLETON
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
VibrationManager(QObject *parent = nullptr);
|
|
|
|
|
|
2025-05-22 15:45:44 +00:00
|
|
|
Q_INVOKABLE QCoro::Task<void> vibrate(int durationMs);
|
2023-11-15 07:13:05 +00:00
|
|
|
|
|
|
|
|
private:
|
2025-05-22 15:45:44 +00:00
|
|
|
OrgSigxcpuFeedbackHapticInterface *m_interface{nullptr};
|
|
|
|
|
};
|