aboutsummaryrefslogtreecommitdiff
path: root/smartpenmanager.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-06-07 21:22:45 +0200
committerJavier <dev.git@javispedro.com>2015-06-07 21:22:45 +0200
commita69e97943539a8abc4d2762638c169dc19c88516 (patch)
treef3516ea29745db65971247cee4c260b49f1067b2 /smartpenmanager.h
downloadscribiu-a69e97943539a8abc4d2762638c169dc19c88516.tar.gz
scribiu-a69e97943539a8abc4d2762638c169dc19c88516.zip
initial import
Diffstat (limited to 'smartpenmanager.h')
-rw-r--r--smartpenmanager.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/smartpenmanager.h b/smartpenmanager.h
new file mode 100644
index 0000000..d1b4800
--- /dev/null
+++ b/smartpenmanager.h
@@ -0,0 +1,42 @@
+#ifndef SMARTPENMANAGER_H
+#define SMARTPENMANAGER_H
+
+#include <QtCore/QObject>
+#include <QtCore/QSocketNotifier>
+#include <QtCore/QMap>
+#include <QtCore/QPair>
+#include "smartpensyncer.h"
+
+struct udev;
+struct udev_monitor;
+struct udev_device;
+
+class SmartpenManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit SmartpenManager(QObject *parent = 0);
+ ~SmartpenManager();
+
+signals:
+ void syncComplete(const QString &penName);
+
+public slots:
+
+private slots:
+ void handleMonitorActivity();
+ void handleSyncerFinished();
+
+private:
+ void processDevice(udev_device *dev);
+
+private:
+ udev *_udev;
+ udev_monitor *_monitor;
+ QSocketNotifier *_notifier;
+ QMap<QPair<int, int>, SmartpenSyncer*> _syncers;
+
+};
+
+#endif // SMARTPENMANAGER_H