Base interface of the SDK. More...
Public Member Functions | |
| void | SetDefaultStyles (string masterCss, bool doReload=true) |
| This method allows use of a custom .css file. | |
| void | OpenDocument (string path) |
| This method opens a new book. | |
| void | OpenDocument (string name, byte[] data) |
| This method opens a new book. | |
| void | OpenDocument (string name, string filePath) |
| This method opens a new book. | |
| void | OpenDocument (string name, Stream stream) |
| This method opens a new book. | |
| void | CloseDocument () |
| This method closes the book and frees resources. | |
| bool | ClearCache (string epubPath) |
| This method deletes internal cache used by epubear core (chapter index, fonts, etc). | |
| void | UpdateBitmapSize (int width, int height) |
| This methods updates all page bitmaps to the (width, height). | |
| void | UsePreprocessing (bool used) |
| void | OpenNextPage () |
| This methods opens the next page in the book, if there is one. | |
| void | OpenPreviousPage () |
| This methods opens the previous page in the book, if there is one. | |
| void | OpenPage (int page) |
| This methods opens the specific page in the book. | |
| void | OpenChapter (int chapter) |
| This method opends the chapter of the book by index. | |
| void | OpenChapter (string chapterPath) |
| This method opens chapter by the chapter file name. | |
| void | SetCustomLineSpacing (float lineSpacing, bool doReload) |
| This method enables the custom line spacing value. | |
| float | GetCustomLineSpacing () |
| The method returns the current line spacing value. | |
| void | IncreaseFont () |
| This method increases font size by 2 points. | |
| void | DecreaseFont () |
| This method decreases font size by 2 points. | |
| void | SetFontSize (int size, bool reload) |
| This method sets the current font size change fromdefault size. | |
| void | SetCustomFonts (IFontConfig config, bool doReload=true) |
| This method sets the custom font. | |
| void | EnableCustomFonts (bool enable) |
| This method enabled the use of custom fonts. | |
| void | EnableOpeningURLs (bool enable) |
| This method. | |
| int | GetCurrentChapterIndex () |
| This method returns the current chapter index, starting from 0. | |
| int | GetChapterIndexByPage (int page) |
| This method returns chapter index (starting from 0) of the specified page in the book. | |
| string | GetChapterTitleByIndex (int index) |
| This method returns a string with a chapter name (file name within the EPUB book). | |
| string | GetChapterTextByIndex (int index) |
| This method returns a Unicode string with the text of the whole chapter. | |
| int | GetChapterPageCount (int index) |
| This method returns the page counf of the specified chapter in the loaded book. | |
| bool | TouchDown (float x, float y) |
| This method sends the touch down event to the SDK. | |
| bool | TouchMove (float x, float y) |
| This method sends the touch move event to the SDK. | |
| bool | TouchUp (float x, float y) |
| This method sends the touch up event to the SDK. | |
| void | SearchTextInChapter (string text) |
| This method searches text within the current chapter. | |
| void | SearchText (string text) |
| This method searched text within the whole book. | |
| void | CancelSearch () |
| This methods cancels the text search. | |
| void | SetAppearanceMode (EPUBAppearanceMode mode) |
| This methods selects the current theme of the view: light or dark. | |
| void | ResetTextColor () |
| This methods resets the text colors to default value. | |
| void | SetTextColor (uint colorARGB) |
| This methods updates the font color. | |
| void | ResetBackgroundColor () |
| This methods resets the background color to default value. | |
| void | SetBackgroundColor (uint colorARGB) |
| This method updates the background color. | |
| void | UpdateContent () |
| This methods triggers the redraw of the pages. | |
| string | CreateBookmark () |
| This methods creates a bookmark for the current position and returns the string with CFI path to this location. | |
| string | CreateBookmark (int chapterIndex, int page) |
| This method creates a bookmark for the specific page of the specific chapter in the book. | |
| void | OpenBookmark (string bookmarkID) |
| Same as openCfi. | |
| string[] | GetBookmarks () |
| this methods returns the list of all stored bookmarks for this book. | |
| KeyValuePair< int, int > | GetBookmarkChapterPage (string bookmarkID) |
| This method takes a CFI bookmark description and return what chapter and page it refers to. | |
| void | DeleteBookmark (string bookmarkId) |
| Same as DeleteCfi. | |
| void | OpenCfi (string cfi) |
| Same as OpenBookmark. | |
| void | RemoveAllReceivedCfi () |
| This methods removes all CFI bookmarks from the SDK cache. | |
| void | RemoveCfi (params string[] cfies) |
| Same as DeleteBookmark. | |
| string | CreateCfiSelectedText (SymbolRect firstRect, SymbolRect lastRect) |
| This method creates a CFI bookmark for a specific range of HTML elements. | |
| void | ImportCfi (params string[] cfies) |
| This method imports CFI bookmarks into SDK bookmark cache. | |
| void | FetchImageBasedOnCfies (params string[] cfies) |
| This method fetches image tage in the book with CFI paths. | |
| string | GetPerformanceReport () |
| This method returns an SDK performance report in HTML form. | |
| List< SymbolRect > | GetPageSymbols (bool withControlChars) |
| This method returns a list of symbols on the page. | |
| string | GetOpfData () |
| This method returns the OPF contens of the EPUB book. | |
| string | GetDataMeta (EPUBMetadata type) |
| This method returns varios metadata entries from thee book. | |
| string | GetPageText (EPUBBitmapPosition position, bool withControlChars) |
| This method return a string with the contens of the page (left, right or center) from the current reading position. | |
| IntPtr | LockPixels (int index) |
| void | UnlockPixels (int index) |
| SKImageInfo | GetImageInfo (int index) |
Properties | |
| bool | IsDoublePaged [get] |
| This property returns weither the current book orientation is double page. | |
| int | CurrentPageNumber [get] |
| This property returns the current page number in the book (for current font settings). | |
| int | TotalPagesCount [get] |
| This property returns the total page count in the book (for current font settings). | |
| int | FontSize [get] |
| A getter for the current font size change from default size. | |
| ContentsTree | TreeOfContents [get] |
| This property returns the table of content in a tree form. | |
| string[] | TableOfContents [get] |
| This property returns the table of content in an array form. | |
| int | GetCurrentChapterPage [get] |
| This property returns the page number in the current chapter, starting with 1. | |
| string | GetCurrentChapterTitle [get] |
| This property returns a Unicode string with a chapter name, as it's described in the book's metadata. | |
| string | DocumentLanguage [get] |
| This property returns a string with a language name of the book. | |
| bool | TextRtl [get] |
| This property returns weither the book is considered to be RTL (right-to-left text, typically Arabic or Hebrew). | |
| bool | IsBookPageFixedViewport [get] |
| This property returns weither the current book is made for the specific screen and content size. | |
| Callbacks | Callbacks [get] |
| Callbacks are used by the SDK to notify the app about changes. | |
| MediaCallbacks | MediaCallbacks [get] |
| These callabcks are related to multimedia within the book. | |
| object | LeftImageNativeObject [get] |
| This property returns the platform-specific object for the left page's bitmap. | |
| object | CenterImageNativeObject [get] |
| This property returns the platform-specific object for the center page's bitmap. | |
| object | RightImageNativeObject [get] |
| This property returns the platform-specific object for the right page's bitmap. | |
| SKPixmap | LeftImagePixmap [get] |
| This property returns a cross-platform wrapper object for the left page's bitmap. | |
| SKPixmap | CenterImagePixmap [get] |
| This property returns a cross-platform wrapper object for the center page's bitmap. | |
| SKPixmap | RightImagePixmap [get] |
| This property returns a cross-platform wrapper object for the right page's bitmap. | |
| SKPixmap | LeftPixmap [get] |
| SKPixmap | CenterPixmap [get] |
| SKPixmap | RightPixmap [get] |
Base interface of the SDK.
Both Android and iOS implement this interface in their classes. This interface allows to open the EPUB document, open chapters, bookmarks and specific pages. SDK notifies callbacks when a chapter is loaded, pages are counted, a page is drawn, etc. Most of the functionality is the same between the platforms. The only exposed differences are font configurations and image representation. LeftImageNativeObject, CenterImageNativeObject and RightImageNativeObject properties use native platforms types, wrapped into .NET classes. It's Android.Graphics.Bitmap for Android and UIKit.UIImage for iOS. Both native image types can be used for better performance, both are also used in the SkPixmap wrapper. This wrapper is used in the sample project to create the ImageSource, which is used by MAUI.
| bool epuBear.SDK.IEpuBearSDK.ClearCache | ( | string | epubPath | ) |
This method deletes internal cache used by epubear core (chapter index, fonts, etc).
| epubPath | Path to the cache |
| string epuBear.SDK.IEpuBearSDK.CreateBookmark | ( | ) |
This methods creates a bookmark for the current position and returns the string with CFI path to this location.
Pass this string to OpenBookmark in order to return to this position in the book. See BookmarkFoundOnPage.
| string epuBear.SDK.IEpuBearSDK.CreateBookmark | ( | int | chapterIndex, |
| int | page | ||
| ) |
This method creates a bookmark for the specific page of the specific chapter in the book.
See CreateBookmark and OpenBookmark for more information.
| chapterIndex | Chapter index, starting from 0. |
| page | Page number, starting from 1. |
| string epuBear.SDK.IEpuBearSDK.CreateCfiSelectedText | ( | SymbolRect | firstRect, |
| SymbolRect | lastRect | ||
| ) |
This method creates a CFI bookmark for a specific range of HTML elements.
It can be used to create highlighted regions of text. See
| firstRect | Character and coordinates of the first symbol. |
| lastRect | Character and coordinates of the left symbol. |
| void epuBear.SDK.IEpuBearSDK.DeleteBookmark | ( | string | bookmarkId | ) |
Same as DeleteCfi.
Ths method deletes the CFI bookmark from the cache. See CreateBookmark.
| bookmarkId | Bookmark text in CFI form. |
| void epuBear.SDK.IEpuBearSDK.EnableCustomFonts | ( | bool | enable | ) |
This method enabled the use of custom fonts.
| enable | Flag the sets the use of custom font in the SDK. |
| void epuBear.SDK.IEpuBearSDK.EnableOpeningURLs | ( | bool | enable | ) |
This method.
| enable |
| void epuBear.SDK.IEpuBearSDK.FetchImageBasedOnCfies | ( | params string[] | cfies | ) |
This method fetches image tage in the book with CFI paths.
| cfies | Bookmarks in CFI form. |
| KeyValuePair< int, int > epuBear.SDK.IEpuBearSDK.GetBookmarkChapterPage | ( | string | bookmarkID | ) |
This method takes a CFI bookmark description and return what chapter and page it refers to.
| bookmarkID | Bookmark text in CFI form. |
| string[] epuBear.SDK.IEpuBearSDK.GetBookmarks | ( | ) |
this methods returns the list of all stored bookmarks for this book.
| int epuBear.SDK.IEpuBearSDK.GetChapterIndexByPage | ( | int | page | ) |
This method returns chapter index (starting from 0) of the specified page in the book.
| page | PAge number (starting from 1). |
| int epuBear.SDK.IEpuBearSDK.GetChapterPageCount | ( | int | index | ) |
This method returns the page counf of the specified chapter in the loaded book.
| index | Chapter index, starting from 0. |
| string epuBear.SDK.IEpuBearSDK.GetChapterTextByIndex | ( | int | index | ) |
This method returns a Unicode string with the text of the whole chapter.
| index | Chapter index, starting from 0. |
| string epuBear.SDK.IEpuBearSDK.GetChapterTitleByIndex | ( | int | index | ) |
This method returns a string with a chapter name (file name within the EPUB book).
| index | Chapter index, starting from 0. |
| int epuBear.SDK.IEpuBearSDK.GetCurrentChapterIndex | ( | ) |
This method returns the current chapter index, starting from 0.
| float epuBear.SDK.IEpuBearSDK.GetCustomLineSpacing | ( | ) |
The method returns the current line spacing value.
| string epuBear.SDK.IEpuBearSDK.GetDataMeta | ( | EPUBMetadata | type | ) |
This method returns varios metadata entries from thee book.
| type | Metadata category to read. |
| string epuBear.SDK.IEpuBearSDK.GetOpfData | ( | ) |
This method returns the OPF contens of the EPUB book.
| List< SymbolRect > epuBear.SDK.IEpuBearSDK.GetPageSymbols | ( | bool | withControlChars | ) |
This method returns a list of symbols on the page.
Symbols are packed into SymbolRect objects, each containing character number and rectangular coordinates of the symbol in view.
| withControlChars | Flag that enables control special characters. |
| string epuBear.SDK.IEpuBearSDK.GetPageText | ( | EPUBBitmapPosition | position, |
| bool | withControlChars | ||
| ) |
This method return a string with the contens of the page (left, right or center) from the current reading position.
| position | The page to query the text. |
| withControlChars | Flag that allows the inclusion of special characters. |
| string epuBear.SDK.IEpuBearSDK.GetPerformanceReport | ( | ) |
This method returns an SDK performance report in HTML form.
| void epuBear.SDK.IEpuBearSDK.ImportCfi | ( | params string[] | cfies | ) |
This method imports CFI bookmarks into SDK bookmark cache.
See BookmarkFoundOnPage.
| cfies |
| void epuBear.SDK.IEpuBearSDK.OpenBookmark | ( | string | bookmarkID | ) |
Same as openCfi.
This method takes string bookmark description in CFI form, created by CreateBookmark, and then sets the reader position to the coressponding position in the book.
| bookmarkID | Bookmark text in CFI form. |
| void epuBear.SDK.IEpuBearSDK.OpenCfi | ( | string | cfi | ) |
Same as OpenBookmark.
This method takes string bookmark description in CFI form, created by CreateBookmark, and then sets the reader position to the coressponding position in the book.
| cfi | Bookmark text in CFI form. |
| void epuBear.SDK.IEpuBearSDK.OpenChapter | ( | int | chapter | ) |
This method opends the chapter of the book by index.
| chapter | Chapter index, starting from 0. |
| void epuBear.SDK.IEpuBearSDK.OpenChapter | ( | string | chapterPath | ) |
This method opens chapter by the chapter file name.
| chapterPath |
| void epuBear.SDK.IEpuBearSDK.OpenDocument | ( | string | name, |
| byte[] | data | ||
| ) |
This method opens a new book.
If there is an opened book, it is closed.
| name | Book name |
| data | EPUB file contents |
| void epuBear.SDK.IEpuBearSDK.OpenDocument | ( | string | name, |
| Stream | stream | ||
| ) |
This method opens a new book.
If there is an opened book, it is closed.
| name | Book name |
| stream | Stream of the EPUB file for continuous loading |
| void epuBear.SDK.IEpuBearSDK.OpenDocument | ( | string | name, |
| string | filePath | ||
| ) |
This method opens a new book.
If there is an opened book, it is closed.
| name | Book name |
| filePath | Path to the EPUB file on the device |
| void epuBear.SDK.IEpuBearSDK.OpenDocument | ( | string | path | ) |
This method opens a new book.
If there is an opened book, it is closed.
| path | Path to the file on the device |
| void epuBear.SDK.IEpuBearSDK.OpenPage | ( | int | page | ) |
This methods opens the specific page in the book.
Page numbers are determined by the font size. Changing the font size will update page count of app chapters. See Callbacks for more information on page count update.
| page | Page number, starting from 1. |
| void epuBear.SDK.IEpuBearSDK.RemoveCfi | ( | params string[] | cfies | ) |
Same as DeleteBookmark.
Ths method deletes the CFI bookmark from the cache. See CreateBookmark.
| cfies | Bookmarks in CFI form. |
| void epuBear.SDK.IEpuBearSDK.SearchText | ( | string | text | ) |
This method searched text within the whole book.
See callbacks for results.
| text | The text to search. |
| void epuBear.SDK.IEpuBearSDK.SearchTextInChapter | ( | string | text | ) |
This method searches text within the current chapter.
See callbacks for results.
| text | The text to search. |
| void epuBear.SDK.IEpuBearSDK.SetAppearanceMode | ( | EPUBAppearanceMode | mode | ) |
This methods selects the current theme of the view: light or dark.
| mode | The new mode. |
| void epuBear.SDK.IEpuBearSDK.SetBackgroundColor | ( | uint | colorARGB | ) |
This method updates the background color.
| colorARGB | Background color, in ARGB form. |
| void epuBear.SDK.IEpuBearSDK.SetCustomFonts | ( | IFontConfig | config, |
| bool | doReload = true |
||
| ) |
This method sets the custom font.
Control the use of custom fonts with EnableCustomFonts. See IFontConfig for more information for platform-specific features.
| config | Platform-specific font configuration (Android, iOS) |
| doReload | Flag that specifies weither the SDK should reload the book with the new setting. Set to false, if used before book is loaded. |
| void epuBear.SDK.IEpuBearSDK.SetCustomLineSpacing | ( | float | lineSpacing, |
| bool | doReload | ||
| ) |
This method enables the custom line spacing value.
| lineSpacing | Line spacing value. |
| doReload | Flag, weither the SDK should reload the book immediately. Set to false, if book is not loaded yet. |
| void epuBear.SDK.IEpuBearSDK.SetDefaultStyles | ( | string | masterCss, |
| bool | doReload = true |
||
| ) |
This method allows use of a custom .css file.
epubear core uses its own master.css by default, this method allows to override that of change specific styles.
| masterCss | contents of the default style CSS file |
| doReload | weither or not SDK should reload the book afterwards |
| void epuBear.SDK.IEpuBearSDK.SetFontSize | ( | int | size, |
| bool | reload | ||
| ) |
This method sets the current font size change fromdefault size.
| size | |
| reload |
| void epuBear.SDK.IEpuBearSDK.SetTextColor | ( | uint | colorARGB | ) |
This methods updates the font color.
| colorARGB | Font color, in ARGB form. |
| bool epuBear.SDK.IEpuBearSDK.TouchDown | ( | float | x, |
| float | y | ||
| ) |
This method sends the touch down event to the SDK.
See callback for possible reactions.
| x | The x coordinate of the touch position. |
| y | The y coordinate of the touch position. |
| bool epuBear.SDK.IEpuBearSDK.TouchMove | ( | float | x, |
| float | y | ||
| ) |
This method sends the touch move event to the SDK.
See callback for possible reactions.
| x | The x coordinate of the touch position. |
| y | The y coordinate of the touch position. |
| bool epuBear.SDK.IEpuBearSDK.TouchUp | ( | float | x, |
| float | y | ||
| ) |
This method sends the touch up event to the SDK.
See callback for possible reactions.
| x | The x coordinate of the touch position. |
| y | The y coordinate of the touch position. |
| void epuBear.SDK.IEpuBearSDK.UpdateBitmapSize | ( | int | width, |
| int | height | ||
| ) |
This methods updates all page bitmaps to the (width, height).
| width | New width of all bitmaps |
| height | New height os all bitmaps |
| void epuBear.SDK.IEpuBearSDK.UsePreprocessing | ( | bool | used | ) |
| used |
|
get |
Callbacks are used by the SDK to notify the app about changes.
Most important callbacks are PagesCounted and ContentUpdated (when a new page is rendered).
|
get |
This property returns the platform-specific object for the center page's bitmap.
These bitmaps are native to the platforms and should be handled as such. For Android: LeftImageNativeObject returns Android.Graphics.Bitmap. For iOS: LeftImageNativeObject returns UIKit.UIImage.
|
get |
This property returns a string with a language name of the book.
This property is derived from the metadata and may be incorrect. Any book may contain any amount of text in any language.
|
get |
This property returns weither the current book is made for the specific screen and content size.
Books like that typically don't scale and have fixed stylized pages.
|
get |
This property returns the platform-specific object for the left page's bitmap.
These bitmaps are native to the platforms and should be handled as such. For Android: LeftImageNativeObject returns Android.Graphics.Bitmap. For iOS: LeftImageNativeObject returns UIKit.UIImage.
|
get |
These callabcks are related to multimedia within the book.
The app can provide multimedia (audio, video) capabilities by implementing players.
|
get |
This property returns the platform-specific object for the right page's bitmap.
These bitmaps are native to the platforms and should be handled as such. For Android: RightImageNativeObject returns Android.Graphics.Bitmap. For iOS: RightImageNativeObject returns UIKit.UIImage.
|
get |
This property returns the table of content in an array form.
some books might not have the ToC.
|
get |
This property returns weither the book is considered to be RTL (right-to-left text, typically Arabic or Hebrew).
This property is derived from the metadata and could be incorrect. The contents of the book aren't limited to a specific text direction. Any book can contain any amount of left-to-right, right-to-left of bidirectional text. This property is usefull for the page progression direction and/or progress slider direction.
|
get |
This property returns the table of content in a tree form.
Some books might not have the ToC.