#include <QStringList>
#include <QHash>
#include <QIcon>
+#include <QMetaType>
/** A book. */
class Book
struct ContentItem
{
QString href;
- QString type;
+ QString name;
};
/** Bookmark: a volume index and a relative position in volume. */
};
/** 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();
/** 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.
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. */
QString mRootPath; //< Path to root item in EPUB dir.
};
+Q_DECLARE_METATYPE(Book)
+
#endif // BOOK_H