summaryrefslogtreecommitdiff
path: root/saltoqd/toqmanageradaptor.h
blob: b867591d9346432e643505a073b0f5a45b76e591 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef TOQMANAGERADAPTOR_H
#define TOQMANAGERADAPTOR_H

#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusAbstractAdaptor>
#include <QtDBus/QDBusMessage>

#include "toqmanager.h"

class ToqManagerAdaptor : public QDBusAbstractAdaptor
{
	Q_OBJECT
	Q_CLASSINFO("D-Bus Interface", "com.javispedro.saltoq.ToqManager")

	Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged)

public:
	ToqManagerAdaptor(FmsManager *fms, ToqManager *parent);

	bool isConnected() const;

public slots:
	void PutData(const QByteArray &data, const QString &remoteFile);
	void PutFile(const QString &localFile, const QString &remoteFile, const QDBusMessage &msg);
	void PutImage(const QString &localFile, const QString &remoteFile, const QDBusMessage &msg);

signals:
	void connectedChanged();

private:
	QDBusConnection _conn;
	ToqManager *_toq;
	FmsManager *_fms;
};

inline bool ToqManagerAdaptor::isConnected() const
{
	return _toq->isConnected();
}

#endif // TOQMANAGERADAPTOR_H