This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-03-13 11:32:07 +01:00

46 lines
1020 B
C++

#ifndef NYMEADSERVICE_H
#define NYMEADSERVICE_H
#include <QObject>
#include <QDBusInterface>
#include <QDBusConnection>
#include <QDBusServiceWatcher>
#include "pushbuttonagent.h"
class NymeadService : public QObject
{
Q_OBJECT
public:
explicit NymeadService(bool pushbuttonEnabled, QObject *parent = nullptr);
bool available() const;
void enableBluetooth(const bool &enable);
void pushButtonPressed();
private:
QDBusServiceWatcher *m_serviceWatcher = nullptr;
PushButtonAgent *m_pushButtonAgent = nullptr;
QDBusInterface *m_nymeadHardwareInterface = nullptr;
QDBusInterface *m_nymeadHardwareBluetoothInterface = nullptr;
bool m_pushbuttonEnabled = false;
bool m_available = false;
void setAvailable(const bool &available);
bool init();
signals:
void availableChanged(const bool &available);
private slots:
void serviceRegistered(const QString &serviceName);
void serviceUnregistered(const QString &serviceName);
};
#endif // NYMEADSERVICE_H