diff options
author | Javier <dev.git@javispedro.com> | 2015-06-13 04:24:21 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-06-13 04:24:21 +0200 |
commit | 41f9a9b0563c3bd523bd534b854e50161a2626b3 (patch) | |
tree | 8c30aacdb80e26fd4202d345b30cab84ba437437 /paperreplay.h | |
parent | 6cb50e66f3c196a2a4bcc95a419260d6b8c2461f (diff) | |
download | scribiu-41f9a9b0563c3bd523bd534b854e50161a2626b3.tar.gz scribiu-41f9a9b0563c3bd523bd534b854e50161a2626b3.zip |
continue with paperreplay loading changes
Diffstat (limited to 'paperreplay.h')
-rw-r--r-- | paperreplay.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/paperreplay.h b/paperreplay.h new file mode 100644 index 0000000..8ad7331 --- /dev/null +++ b/paperreplay.h @@ -0,0 +1,47 @@ +#ifndef PAPERREPLAY_H +#define PAPERREPLAY_H + +#include <QtCore/QDateTime> +#include <QtCore/QDir> +#include <QtCore/QHash> +#include <QtCore/QMultiMap> +#include <QtCore/QVector> + +#define PAPER_REPLAY "Paper Replay" + +class PaperReplay : public QObject +{ + Q_OBJECT + +public: + explicit PaperReplay(QObject *parent = 0); + + bool open(const QString &path, const QString &penSerial, quint64 notebookGuid); + void close(); + + struct Session { + QDateTime start, end; + QString name; + QVector<quint64> pages; + QString file; + }; + + QList<Session> sessions(); + QList<Session> sessions(quint64 pageAddress); + +private: + static bool parseSessionInfo(Session &session, const QString &path); + static bool parseSessionInfo(Session &session, QIODevice *dev); + static bool parseSessionInfoV3(Session &session, QIODevice *dev); + + static bool parseSessionPages(Session &session, const QString &path); + static bool parseSessionPages(Session &session, QIODevice *dev); + static bool parseSessionPagesV1(Session &session, QIODevice *dev); + +private: + QDir _dir; + QHash<quint64, Session> _sessions; + QMultiMap<quint64, quint64> _byPage; +}; + +#endif // PAPERREPLAY_H |