shift-shell/components/hapticsplugin/vibrationmanager.h
Devin Lin 0e09a434ef hapticsplugin: Use QCoro::QmlTask
This avoids the following error for haptic events when used from QML:

```
QVariant: Provided metatype for 'QCoro::Task<void>' does not support destruction and copy construction
```
2025-09-14 14:35:52 -04:00

32 lines
671 B
C++

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QList>
#include <QObject>
#include <qqmlregistration.h>
#include "hapticinterface.h"
#include "vibrationevent.h"
#include <QCoroCore>
#include <QCoroDBusPendingReply>
#include <QCoroQml>
#include <QCoroQmlTask>
class VibrationManager : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
VibrationManager(QObject *parent = nullptr);
QCoro::Task<void> vibrateTask(int durationMs);
Q_INVOKABLE QCoro::QmlTask vibrate(int durationMs);
private:
OrgSigxcpuFeedbackHapticInterface *m_interface{nullptr};
};