aboutsummaryrefslogtreecommitdiff
path: root/paperreplay.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-06-13 17:35:15 +0200
committerJavier <dev.git@javispedro.com>2015-06-13 17:35:15 +0200
commit72a71a2003028fc97d74cebecebb1541d66ded86 (patch)
treef9850b0091f50c0dab524bec47445380fed62ef3 /paperreplay.h
parent41f9a9b0563c3bd523bd534b854e50161a2626b3 (diff)
downloadscribiu-72a71a2003028fc97d74cebecebb1541d66ded86.tar.gz
scribiu-72a71a2003028fc97d74cebecebb1541d66ded86.zip
split afdpageaddress into new class
Diffstat (limited to 'paperreplay.h')
-rw-r--r--paperreplay.h50
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;