mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
FormatPlugin.readUids(Book &) method (dummy implementations)
This commit is contained in:
parent
0b0a8cabf5
commit
72c85142dd
15 changed files with 36 additions and 1 deletions
|
@ -58,6 +58,7 @@ public:
|
|||
|
||||
virtual const std::string &tryOpen(const ZLFile &file) const;
|
||||
virtual bool readMetaInfo(Book &book) const = 0;
|
||||
virtual bool readUids(Book &book) const = 0;
|
||||
virtual bool readLanguageAndEncoding(Book &book) const = 0;
|
||||
virtual bool readModel(BookModel &model) const = 0;
|
||||
virtual shared_ptr<const ZLImage> coverImage(const ZLFile &file) const;
|
||||
|
|
|
@ -62,6 +62,10 @@ bool DocPlugin::readMetaInfo(Book &book) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DocPlugin::readUids(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DocPlugin::readLanguageAndEncoding(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
const std::string supportedFileType() const;
|
||||
bool acceptsFile(const ZLFile &file) const;
|
||||
bool readMetaInfo(Book &book) const;
|
||||
bool readUids(Book &book) const;
|
||||
bool readLanguageAndEncoding(Book &book) const;
|
||||
bool readModel(BookModel &model) const;
|
||||
};
|
||||
|
|
|
@ -50,7 +50,9 @@ private:
|
|||
READ_AUTHOR_NAME_1,
|
||||
READ_AUTHOR_NAME_2,
|
||||
READ_LANGUAGE,
|
||||
READ_GENRE
|
||||
READ_GENRE,
|
||||
READ_DOCUMENT_INFO,
|
||||
READ_ID
|
||||
} myReadState;
|
||||
|
||||
std::string myAuthorNames[3];
|
||||
|
|
|
@ -33,6 +33,10 @@ bool FB2Plugin::readMetaInfo(Book &book) const {
|
|||
return FB2MetaInfoReader(book).readMetaInfo();
|
||||
}
|
||||
|
||||
bool FB2Plugin::readUids(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FB2Plugin::readModel(BookModel &model) const {
|
||||
return FB2BookReader(model).readBook();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
bool providesMetaInfo() const;
|
||||
const std::string supportedFileType() const;
|
||||
bool readMetaInfo(Book &book) const;
|
||||
bool readUids(Book &book) const;
|
||||
bool readLanguageAndEncoding(Book &book) const;
|
||||
bool readModel(BookModel &model) const;
|
||||
shared_ptr<const ZLImage> coverImage(const ZLFile &file) const;
|
||||
|
|
|
@ -81,6 +81,8 @@ public:
|
|||
_COVERPAGE,
|
||||
_SEQUENCE,
|
||||
_GENRE,
|
||||
_DOCUMENT_INFO,
|
||||
_ID,
|
||||
_UNKNOWN
|
||||
};
|
||||
|
||||
|
|
|
@ -50,6 +50,10 @@ bool HtmlPlugin::readMetaInfo(Book &book) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool HtmlPlugin::readUids(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HtmlPlugin::readModel(BookModel &model) const {
|
||||
const Book& book = *model.book();
|
||||
const ZLFile &file = book.file();
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
bool providesMetaInfo() const;
|
||||
const std::string supportedFileType() const;
|
||||
bool readMetaInfo(Book &book) const;
|
||||
bool readUids(Book &book) const;
|
||||
bool readLanguageAndEncoding(Book &book) const;
|
||||
bool readModel(BookModel &model) const;
|
||||
// FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file);
|
||||
|
|
|
@ -123,6 +123,10 @@ bool OEBPlugin::readMetaInfo(Book &book) const {
|
|||
return OEBMetaInfoReader(book).readMetaInfo(opfFile(file));
|
||||
}
|
||||
|
||||
bool OEBPlugin::readUids(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OEBPlugin::readModel(BookModel &model) const {
|
||||
const ZLFile &file = model.book()->file();
|
||||
return OEBBookReader(model).readBook(opfFile(file));
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
bool providesMetaInfo() const;
|
||||
const std::string supportedFileType() const;
|
||||
bool readMetaInfo(Book &book) const;
|
||||
bool readUids(Book &book) const;
|
||||
bool readLanguageAndEncoding(Book &book) const;
|
||||
bool readModel(BookModel &model) const;
|
||||
shared_ptr<const ZLImage> coverImage(const ZLFile &file) const;
|
||||
|
|
|
@ -54,6 +54,10 @@ bool RtfPlugin::readMetaInfo(Book &book) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool RtfPlugin::readUids(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RtfPlugin::readModel(BookModel &model) const {
|
||||
const Book &book = *model.book();
|
||||
return RtfBookReader(model, book.encoding()).readDocument(book.file());
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
bool providesMetaInfo() const;
|
||||
const std::string supportedFileType() const;
|
||||
bool readMetaInfo(Book &book) const;
|
||||
bool readUids(Book &book) const;
|
||||
bool readLanguageAndEncoding(Book &book) const;
|
||||
bool readModel(BookModel &model) const;
|
||||
};
|
||||
|
|
|
@ -65,6 +65,10 @@ bool TxtPlugin::readModel(BookModel &model) const {
|
|||
// return new PlainTextInfoPage(dialog, file, ZLResourceKey("Text"), true);
|
||||
//}
|
||||
|
||||
bool TxtPlugin::readUids(Book &/*book*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TxtPlugin::readLanguageAndEncoding(Book &book) const {
|
||||
shared_ptr<ZLInputStream> stream = book.file().inputStream();
|
||||
if (stream.isNull()) {
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
bool providesMetaInfo() const;
|
||||
const std::string supportedFileType() const;
|
||||
bool readMetaInfo(Book &book) const;
|
||||
bool readUids(Book &book) const;
|
||||
bool readLanguageAndEncoding(Book &book) const;
|
||||
bool readModel(BookModel &model) const;
|
||||
// FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue