]> git.tdb.fi Git - xinema.git/blobdiff - remote/source/discoveryitem.h
Add a remote control program for Sailfish OS
[xinema.git] / remote / source / discoveryitem.h
diff --git a/remote/source/discoveryitem.h b/remote/source/discoveryitem.h
new file mode 100644 (file)
index 0000000..a200b82
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef DISCOVERYITEM_H_
+#define DISCOVERYITEM_H_
+
+#include <QQuickItem>
+#include "discovery.h"
+
+class DiscoveryItem: public QQuickItem
+{
+       Q_OBJECT
+
+       Q_PROPERTY(bool active READ is_active WRITE set_active NOTIFY active_changed)
+       Q_PROPERTY(QString serverName READ get_server_name NOTIFY server_name_changed)
+
+private:
+       Discovery discovery;
+       bool active;
+       QHostAddress server_addr;
+
+public:
+       DiscoveryItem();
+
+       void set_active(bool);
+       bool is_active() const { return active; }
+       QString get_server_name() const { return server_addr.toString(); }
+
+signals:
+       void server_name_changed();
+       void active_changed();
+
+private slots:
+       void server_discovered(const QHostAddress &);
+};
+
+#endif