aboutsummaryrefslogtreecommitdiff
path: root/smartpensyncer.h
diff options
context:
space:
mode:
Diffstat (limited to 'smartpensyncer.h')
-rw-r--r--smartpensyncer.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/smartpensyncer.h b/smartpensyncer.h
new file mode 100644
index 0000000..6279485
--- /dev/null
+++ b/smartpensyncer.h
@@ -0,0 +1,39 @@
+#ifndef SMARTPENSYNCER_H
+#define SMARTPENSYNCER_H
+
+#include <QtCore/QThread>
+#include <QtCore/QDir>
+#include "smartpen.h"
+
+class SmartpenSyncer : public QThread
+{
+ Q_OBJECT
+public:
+ explicit SmartpenSyncer(const Smartpen::Address &addr, QObject *parent = 0);
+ ~SmartpenSyncer();
+
+ Smartpen::Address penAddress() const;
+
+signals:
+
+public slots:
+ void abort();
+
+private:
+ void run();
+ bool syncPen();
+ bool syncNotebook(const Smartpen::ChangeReport &change);
+ bool extractZip(QByteArray &zipData, QDir &dir);
+
+private:
+ Smartpen::Address _addr;
+ Smartpen *_pen;
+ bool _errored;
+ bool _aborted;
+
+ QString _penSerial;
+ QString _penName;
+ QDir _penDataDir;
+};
+
+#endif // SMARTPENSYNCER_H