EpubearSdk class

Main SDK class Create epuBear SDK instance with EpubearSdk.create call.

Properties

bookmarkListener BookmarkListener?
Setter for the bookmark event listener.
no getter
cfiListener CfiListener?
Setter for the cfi event listener.
no getter
config EpubConfig
final
eventsListener EventsListener?
Setter for the general event listener.
no getter
hashCode int
The hash code for this object.
no setterinherited
imageListener ImageListener?
Setter for the image event listener.
no getter
mediaListener MediaListener?
Setter for the media event listener.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchListener SearchListener?
Setter for the search event listener.
no getter
textureId int
getter/setter pair

Methods

closeDocumentFile() → void
Closes the currently opened book.
createBookmark() String
Creates the bookmark for the current page in CFI format. Use openBookmark to open this page.
createCfiSelectedText(List<int> borderPositions) String
Returns the CFI for the region, specified by borderPositions. borderPositions is an array of int in LTRB format. Two points should be specified. Use getTextSymbols to receive symbol coordinates.
decreaseFont(int step) → void
Decreases current font size by the specified step and forces the core to redraw.
deleteBookmark(String bookmarkId) String?
Deletes the bookmarkId bookmark from the storage.
enableUrls(bool enable) → void
Uses enable param to set URL handling.
enableUserFonts(bool enable) → void
Sets the mode of font use. Pass "true" to enable argument to use custom.
fetchImageBasedOnCfies(List<String> cfies) → void
Fetches images by CFI paths specified by cfies argument.
freeSdk() → void
Deinitialiser of the SDK. Call it to release native SDK.
getCfiHighlightRects(String cfi) List
Gets the highlighted area for the specifies cfi path. See HighlightBox for more information.
getChapterTitleByIndex(int index) String
Returns the title of the chapter, indexed by the index argument. Returns an empty string is the core is not initialised or the title is empty.
getCurrentChapterIndex() int
Returns the current chapter's index. Returns 0, if the core is not initialised yet. Returns -1, if the curretn chapter is not ready yet.
getCurrentChapterPage() int
Returns the current page in the chapter. Returns 0, if the core is not initialised yet. Returns -1, if the curretn chapter is not ready yet.
getCurrentChapterTitle() String
Returns the title of the current chapter. Returns an empty string is the core is not initialised or the title is empty.
getCurrentFontSize() int
Returns the current font size.
getCustomLineSpacing() double
Returns current line spacing koefficient. See setCustomLineSpacing for more details.
getDocumentLanguage() String
Returns the language of the opened book. Returns an empty string is the core is not initialised or the title is empty.
getDocumentTitle() String
Returns the title of the opened book. Returns an empty string is the core is not initialised or the title is empty.
getEntity() int
Returns the local address to the native SDK instance.
getFileMeta(int type) String
Gets the metadata attribute of the book. Returns an emptry string, if the core is not initialised.
getIgnoreFixedFonts() bool
Returns current behaviour of font scaling. See setIgnoreFixedFonts for more details.
getMetadata(dynamic type) String
Gets the metadata attribute of the book. Returns an emptry string, if the core is not initialised.
getOpfData() String
Returns the contents of the .OPF file of the book. Returns an empty string, if the core is not initialised yet.
getPage() int
Returns the current page.
getPerformanceReport() → void
Asks the core to get an HTML-formatted performance report. Flutter SDK specific: the report is received via dedicated callback. See EventsListener, onPerformanceReportCompleted(String report).
getText(int chapter) String
Returns the text contents of the current page. Returns an emptry string, if the core is not initialised.
getTextSymbols() List
Returns an array of SymbolRect, representing the current page. If the core is not initialised or the page is not ready, returns an empty array.
getToCTree() → dynamic
Returns the table of context in tree-like structure (if there is any)
getTotalPageCount() int
Returns the total page count of the book (for the current font size). Returns 0, if the core is not initialised yet.
importCfi(List<String> cfies) → void
Imports specified cfies to use in reader.
increaseFont(int step) → void
Increases current font size by the specified step and forces the core to redraw.
isTextRtl() bool
Returns wether the current book is considered an RTL book (right-to-left language).
nextPage() → void
Opens the next page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTouchDown(double x, double y) bool
Sends the informating aboute touch down event on x, y coordinates (coordinates are absolute). Returns false when the page rendering is not initialised, true otherwise.
onTouchMove(double x, double y) bool
Sends the informating aboute touch move event on x, y coordinates (coordinates are absolute). Returns false when the page rendering is not initialised, true otherwise.
onTouchUp(double x, double y) bool
Sends the informating aboute touch up event on x, y coordinates (coordinates are absolute). Returns false when the page rendering is not initialised, true otherwise.
openBookmark(String bookmarkId) → void
Follows the bookmark, opening the page, specified by bookmarkId. Use createBookmark to create a bookmark.
openDocumentData(Pointer fileData) bool
Opend the book from the memory. It is recommended to use openDocumentFile.
openDocumentFile(String fileName) bool
Opens the book from the specified fileName.
openToC(String url) → void
Follows the url from the table of context. See getToCTree.
previousPage() → void
Opens the prvioues page.
removeAllReceivedCfi() → void
Removes all the CFI-s from memory.
removeCfi(List<String> cfies) → void
Removes the CFI-s specifies by cfies argument from the reader.
searchAllChapters(String searchText) → void
Starts the search of the searchText in all book chapters. Register SearchListener to receive result via callback.
searchCancel() → void
Cancels the current search.
searchCurrentChapter(String searchText) → void
Starts the search of the searchText in the current chapter. Register SearchListener to receive result via callback.
setBackgroundColor(int red, int green, int blue) → void
Sets the background colour and forces the core to redraw. Treats red, green and blue as 1 byte channels. Sets alpha to 255.
setCachePath(String path) → void
Specifies the directory path to be used for book unpacking.
setCurrentFontSize(int size, bool reload) → void
Sets the current font size and forces the core to redraw.
setCustomLineSpacing(double lineSpacing, {bool reload = false}) → void
This parameter overrides the default behaviour of placing the lines on the screen. Can be used to change the gaps between lines. lineSpacing argument specifies the koefficient (1 is default). reload argument specifies wether the native core should redraw the pages. Pass "false" if this method is called before the book is opened.
setDefaultBackgroundColor() → void
Sets the default background colour.
setDefaultFontColor() → void
Sets the default fon colour.
setDefaultStyles(String masterCss, {bool reload = true}) → void
Overrides the "master.css" file contents with the contents of masterCss. reload specifies the necessity of reloading book's chapters (provided the book is opened). Pass "false" if the book is not opened yet.
setFontColor(int red, int green, int blue, int alpha) → void
Sets the font colour and forces the core to redraw. Treats red, green, blue and alpha as 1 byte channels.
setIgnoreFixedFonts(bool ignoreFixedFonts, {bool reload = false}) → void
This parameter overrides the default behaviour of font scaling. ignoreFixedFonts argument specifies the rule. reload argument specifies wether the native core should redraw the pages. Pass "false" if this method is called before the book is opened.
setPage(int page) → void
Opens the specified page.
setPreprocessingEnabled(bool enabled) → void
Sets the opening mode of the book (preprocessing enables speeds up)
toString() String
A string representation of this object.
inherited
unpackCover(String fileName, String targetPath) String
updateDisplays(int chapter, double koef) → void
updateImageCallback() → void
Legacy method for initialisation pipeline.
updateViewSize(int width, int height, bool doublePage) → void
Asks the native core to set the view size to width, height. Use doublePage arguments to render two pages in landscape mode.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

createdSdks List<EpubearSdk>
getter/setter pair

Static Methods

create(EpubConfig config) Future<EpubearSdk>
Method used to create an instance of epuBear SDK using config.
getSdkEntity() Pointer
Sets the local address to the native SDK instance.