diff options
Diffstat (limited to 'paperreplay.h')
-rw-r--r-- | paperreplay.h | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/paperreplay.h b/paperreplay.h index 8ad7331..e771584 100644 --- a/paperreplay.h +++ b/paperreplay.h @@ -13,30 +13,50 @@ class PaperReplay : public QObject { Q_OBJECT + struct SessionData : public QSharedData { + QString name; + QDateTime start, end; + QVector<quint64> pages; + QString file; + }; + public: explicit PaperReplay(QObject *parent = 0); - bool open(const QString &path, const QString &penSerial, quint64 notebookGuid); - void close(); + class Session { + public: + Session(); + ~Session(); - struct Session { - QDateTime start, end; - QString name; - QVector<quint64> pages; - QString file; + QString name() const; + + QDateTime startTime() const; + QDateTime endTime() const; + + QVector<quint64> pages() const; + + QString fileName() const; + + private: + QSharedDataPointer<SessionData> d; + + friend class PaperReplay; }; - QList<Session> sessions(); - QList<Session> sessions(quint64 pageAddress); + bool open(const QString &path, const QString &penSerial, quint64 notebookGuid); + void close(); + + QList<Session> sessions() const; + QList<Session> sessions(quint64 pageAddress) const; 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 parseSessionInfo(SessionData *session, const QString &path); + static bool parseSessionInfo(SessionData *session, QIODevice *dev); + static bool parseSessionInfoV3(SessionData *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); + static bool parseSessionPages(SessionData *session, const QString &path); + static bool parseSessionPages(SessionData *session, QIODevice *dev); + static bool parseSessionPagesV1(SessionData *session, QIODevice *dev); private: QDir _dir; |