Remember reading progress in scrolling mode. Basic nightmode.
[mebook:mebook.git] / core / library.h
1 #ifndef LIBRARY_H
2 #define LIBRARY_H
3
4 class QObject;
5 #include <QSqlDatabase>
6 #include <QSqlQuery>
7 #include <QStringList>
8 #include <QDir>
9 #include "book.h"
10
11 class Library : public QObject{
12     Q_OBJECT
13 public:
14     Library(const QString &libraryDirectory, const QString &databasename, QObject *parent = 0);
15     ~Library();
16
17     void scanDirectory(const QString&);
18
19 //    void loadBooksfromdb();
20 //    void saveBooktodb(Book*);
21     QList<Book*> getBooks();
22
23 private:
24     QStringList filenames;
25     void connectdb(const QString&);
26     void saveBookProgress(Book*);
27     void loadBookProgress(Book*);
28 //    bool checkForChanges();
29
30     QSqlDatabase database;
31
32     QList<Book*> books;
33 };
34
35 #endif