shift-shell/components/hapticsplugin/vibrationmanager.h
Devin Lin c4b49cf086 hapticsplugin: Only initialize dbus interface if used
Only create dbus interface when needed to avoid wasting resources.
2024-10-31 03:27:36 +00:00

24 lines
No EOL
455 B
C++

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QObject>
#include <qqmlregistration.h>
#include "hfdinterface.h"
class VibrationManager : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
VibrationManager(QObject *parent = nullptr);
Q_INVOKABLE void vibrate(int durationMs);
private:
com::lomiri::hfd::Vibrator *m_interface{nullptr};
};