Don't show progress on MouseButtonRelease on Symbian.
[dorian] / model / book.h
index 07259a9..7d9ed84 100644 (file)
@@ -4,10 +4,13 @@
 #include <QString>
 #include <QStringList>
 #include <QHash>
-#include <QIcon>
+#include <QImage>
 #include <QMetaType>
 #include <QObject>
 #include <QTemporaryFile>
+#include <QDateTime>
+
+class QPixmap;
 
 /** A book. */
 class Book: public QObject
@@ -34,7 +37,7 @@ public:
         qreal pos;
         QString note;
         bool operator<(const Bookmark &other) const {
-            return (part == other.part)? (pos < other.pos): (part < other.part);
+            return (part == other.part)? (pos<other.pos): (part<other.part);
         }
     };
 
@@ -81,7 +84,7 @@ public:
     bool clearDir(const QString &directory);
 
     /** Set last bookmark. */
-    void setLastBookmark(int part, qreal position);
+    void setLastBookmark(int part, qreal position, bool fast = false);
 
     /** Get last bookmark. */
     Bookmark lastBookmark();
@@ -89,6 +92,9 @@ public:
     /** Add bookmark. */
     void addBookmark(int part, qreal position, const QString &note);
 
+    /** Change a given bookmark's note text */
+    void setBookmarkNote(int index, const QString &note);
+
     /** Delete bookmark. */
     void deleteBookmark(int index);
 
@@ -129,8 +135,10 @@ public:
     QString rights;                         //< Rights.
     QString tocPath;                        //< Path to toc NCX file.
     QString coverPath;                      //< Path to cover HTML file.
-    QStringList chapters;                   //< Main navigation items from EPUB.
+    QStringList chapters;                   //< Main navigation items.
     qint64 size;                            //< Size of all parts.
+    QDateTime dateAdded;                    //< Date book added to library.
+    QDateTime dateOpened;                   //< Date book was last read.
 
 signals:
     /** Emitted if @see open() succeeds. */
@@ -152,6 +160,12 @@ protected:
     /** Get location of OPS file in EPUB archive. */
     QString opsPath();
 
+    /** Make a cover image from a file. */
+    QImage makeCover(const QString &fileName);
+
+    /** Make a cover image from an pixmap. */
+    QImage makeCover(const QPixmap &pixmap);
+
     QString mPath;                          //< Path to EPUB file.
     Bookmark mLastBookmark;                 //< Last position read.
     QList<Bookmark> mBookmarks;             //< List of bookmarks.