Facelift bookmarks dialog. Add Maemo-friendly dialog box class.
[dorian] / book.h
diff --git a/book.h b/book.h
index 5d3c393..048280c 100644 (file)
--- a/book.h
+++ b/book.h
@@ -5,6 +5,7 @@
 #include <QStringList>
 #include <QHash>
 #include <QIcon>
+#include <QMetaType>
 
 /** A book. */
 class Book
@@ -15,7 +16,7 @@ public:
     struct ContentItem
     {
         QString href;
-        QString type;
+        QString name;
     };
 
     /** Bookmark: a volume index and a relative position in volume. */
@@ -35,7 +36,10 @@ public:
     };
 
     /** Construct a book from an EPUB file in path. */
-    explicit Book(const QString &path);
+    Book(const QString &path);
+
+    /** Default constructor. */
+    Book();
 
     /** Load book from persistent storage. */
     void load();
@@ -73,9 +77,18 @@ public:
     /** Add bookmark. */
     void addBookmark(int chapter, qreal position);
 
+    /** Delete bookmark. */
+    void deleteBookmark(int index);
+
     /** List bookmarks. */
     QList<Bookmark> bookmarks() const;
 
+    /**
+     * Get friendly name.
+     * @return  @see title or path name if title is not available yet.
+     */
+    QString name() const;
+
     QString title;                          //< Book title from EPUB.
     QStringList toc;                        //< Table of contents from EPUB.
     QHash<QString, ContentItem> content;    //< Content items from EPUB.
@@ -87,6 +100,9 @@ public:
     QString subject;                        //< Subject.
     QString source;                         //< Source.
     QString rights;                         //< Rights.
+    QString tocPath;                        //< Path to toc ncx.
+    QString coverPath;                      //< Path to cover html.
+    QString coverImagePath;                 //< Path to cover image.
 
 protected:
     /** Indicate failure by creating a single "error" content item. */
@@ -111,4 +127,6 @@ protected:
     QString mRootPath;                      //< Path to root item in EPUB dir.
 };
 
+Q_DECLARE_METATYPE(Book)
+
 #endif // BOOK_H