summaryrefslogtreecommitdiffstats
path: root/src/bus.h
blob: f98ee653cb03d7c2c7805ff9397602bcc9050080 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef BUS_H
#define BUS_H

#include <QObject>

class Bus : public QObject
{
    Q_OBJECT
public:
    bool registerListener();
    bool registerService();
    inline static Bus* inst() {
        if (_instance == nullptr) _instance = new Bus();
        return _instance;
    }

signals:
    void serviceConnected();

private:
    explicit Bus(QObject *parent = nullptr);
    bool _hasListener;
    static Bus *_instance;
};

#endif // BUS_H