epuBear SDK (MAUI)
 
Loading...
Searching...
No Matches
epuBear.SDK.IEpuBearSDK Interface Reference

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< SymbolRectGetPageSymbols (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]
 

Detailed Description

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.

Member Function Documentation

◆ ClearCache()

bool epuBear.SDK.IEpuBearSDK.ClearCache ( string  epubPath)

This method deletes internal cache used by epubear core (chapter index, fonts, etc).

Parameters
epubPathPath to the cache
Returns

◆ CreateBookmark() [1/2]

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.

Returns

◆ CreateBookmark() [2/2]

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.

Parameters
chapterIndexChapter index, starting from 0.
pagePage number, starting from 1.
Returns

◆ CreateCfiSelectedText()

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

Parameters
firstRectCharacter and coordinates of the first symbol.
lastRectCharacter and coordinates of the left symbol.
Returns

◆ DeleteBookmark()

void epuBear.SDK.IEpuBearSDK.DeleteBookmark ( string  bookmarkId)

Same as DeleteCfi.

Ths method deletes the CFI bookmark from the cache. See CreateBookmark.

Parameters
bookmarkIdBookmark text in CFI form.

◆ EnableCustomFonts()

void epuBear.SDK.IEpuBearSDK.EnableCustomFonts ( bool  enable)

This method enabled the use of custom fonts.

Parameters
enableFlag the sets the use of custom font in the SDK.

◆ EnableOpeningURLs()

void epuBear.SDK.IEpuBearSDK.EnableOpeningURLs ( bool  enable)

This method.

Parameters
enable

◆ FetchImageBasedOnCfies()

void epuBear.SDK.IEpuBearSDK.FetchImageBasedOnCfies ( params string[]  cfies)

This method fetches image tage in the book with CFI paths.

Parameters
cfiesBookmarks in CFI form.

◆ GetBookmarkChapterPage()

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.

Parameters
bookmarkIDBookmark text in CFI form.
Returns

◆ GetBookmarks()

string[] epuBear.SDK.IEpuBearSDK.GetBookmarks ( )

this methods returns the list of all stored bookmarks for this book.

Returns

◆ GetChapterIndexByPage()

int epuBear.SDK.IEpuBearSDK.GetChapterIndexByPage ( int  page)

This method returns chapter index (starting from 0) of the specified page in the book.

Parameters
pagePAge number (starting from 1).
Returns

◆ GetChapterPageCount()

int epuBear.SDK.IEpuBearSDK.GetChapterPageCount ( int  index)

This method returns the page counf of the specified chapter in the loaded book.

Parameters
indexChapter index, starting from 0.
Returns

◆ GetChapterTextByIndex()

string epuBear.SDK.IEpuBearSDK.GetChapterTextByIndex ( int  index)

This method returns a Unicode string with the text of the whole chapter.

Parameters
indexChapter index, starting from 0.
Returns

◆ GetChapterTitleByIndex()

string epuBear.SDK.IEpuBearSDK.GetChapterTitleByIndex ( int  index)

This method returns a string with a chapter name (file name within the EPUB book).

Parameters
indexChapter index, starting from 0.
Returns

◆ GetCurrentChapterIndex()

int epuBear.SDK.IEpuBearSDK.GetCurrentChapterIndex ( )

This method returns the current chapter index, starting from 0.

Returns

◆ GetCustomLineSpacing()

float epuBear.SDK.IEpuBearSDK.GetCustomLineSpacing ( )

The method returns the current line spacing value.

Returns

◆ GetDataMeta()

string epuBear.SDK.IEpuBearSDK.GetDataMeta ( EPUBMetadata  type)

This method returns varios metadata entries from thee book.

Parameters
typeMetadata category to read.
Returns

◆ GetOpfData()

string epuBear.SDK.IEpuBearSDK.GetOpfData ( )

This method returns the OPF contens of the EPUB book.

Returns

◆ GetPageSymbols()

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.

Parameters
withControlCharsFlag that enables control special characters.
Returns

◆ GetPageText()

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.

Parameters
positionThe page to query the text.
withControlCharsFlag that allows the inclusion of special characters.
Returns

◆ GetPerformanceReport()

string epuBear.SDK.IEpuBearSDK.GetPerformanceReport ( )

This method returns an SDK performance report in HTML form.

Returns

◆ ImportCfi()

void epuBear.SDK.IEpuBearSDK.ImportCfi ( params string[]  cfies)

This method imports CFI bookmarks into SDK bookmark cache.

See BookmarkFoundOnPage.

Parameters
cfies

◆ OpenBookmark()

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.

Parameters
bookmarkIDBookmark text in CFI form.

◆ OpenCfi()

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.

Parameters
cfiBookmark text in CFI form.

◆ OpenChapter() [1/2]

void epuBear.SDK.IEpuBearSDK.OpenChapter ( int  chapter)

This method opends the chapter of the book by index.

Parameters
chapterChapter index, starting from 0.

◆ OpenChapter() [2/2]

void epuBear.SDK.IEpuBearSDK.OpenChapter ( string  chapterPath)

This method opens chapter by the chapter file name.

Parameters
chapterPath

◆ OpenDocument() [1/4]

void epuBear.SDK.IEpuBearSDK.OpenDocument ( string  name,
byte[]  data 
)

This method opens a new book.

If there is an opened book, it is closed.

Parameters
nameBook name
dataEPUB file contents

◆ OpenDocument() [2/4]

void epuBear.SDK.IEpuBearSDK.OpenDocument ( string  name,
Stream  stream 
)

This method opens a new book.

If there is an opened book, it is closed.

Parameters
nameBook name
streamStream of the EPUB file for continuous loading

◆ OpenDocument() [3/4]

void epuBear.SDK.IEpuBearSDK.OpenDocument ( string  name,
string  filePath 
)

This method opens a new book.

If there is an opened book, it is closed.

Parameters
nameBook name
filePathPath to the EPUB file on the device

◆ OpenDocument() [4/4]

void epuBear.SDK.IEpuBearSDK.OpenDocument ( string  path)

This method opens a new book.

If there is an opened book, it is closed.

Parameters
pathPath to the file on the device

◆ OpenPage()

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.

Parameters
pagePage number, starting from 1.

◆ RemoveCfi()

void epuBear.SDK.IEpuBearSDK.RemoveCfi ( params string[]  cfies)

Same as DeleteBookmark.

Ths method deletes the CFI bookmark from the cache. See CreateBookmark.

Parameters
cfiesBookmarks in CFI form.

◆ SearchText()

void epuBear.SDK.IEpuBearSDK.SearchText ( string  text)

This method searched text within the whole book.

See callbacks for results.

Parameters
textThe text to search.

◆ SearchTextInChapter()

void epuBear.SDK.IEpuBearSDK.SearchTextInChapter ( string  text)

This method searches text within the current chapter.

See callbacks for results.

Parameters
textThe text to search.

◆ SetAppearanceMode()

void epuBear.SDK.IEpuBearSDK.SetAppearanceMode ( EPUBAppearanceMode  mode)

This methods selects the current theme of the view: light or dark.

Parameters
modeThe new mode.

◆ SetBackgroundColor()

void epuBear.SDK.IEpuBearSDK.SetBackgroundColor ( uint  colorARGB)

This method updates the background color.

Parameters
colorARGBBackground color, in ARGB form.

◆ SetCustomFonts()

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.

Parameters
configPlatform-specific font configuration (Android, iOS)
doReloadFlag that specifies weither the SDK should reload the book with the new setting. Set to false, if used before book is loaded.

◆ SetCustomLineSpacing()

void epuBear.SDK.IEpuBearSDK.SetCustomLineSpacing ( float  lineSpacing,
bool  doReload 
)

This method enables the custom line spacing value.

Parameters
lineSpacingLine spacing value.
doReloadFlag, weither the SDK should reload the book immediately. Set to false, if book is not loaded yet.

◆ SetDefaultStyles()

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.

Parameters
masterCsscontents of the default style CSS file
doReloadweither or not SDK should reload the book afterwards

◆ SetFontSize()

void epuBear.SDK.IEpuBearSDK.SetFontSize ( int  size,
bool  reload 
)

This method sets the current font size change fromdefault size.

Parameters
size
reload

◆ SetTextColor()

void epuBear.SDK.IEpuBearSDK.SetTextColor ( uint  colorARGB)

This methods updates the font color.

Parameters
colorARGBFont color, in ARGB form.

◆ TouchDown()

bool epuBear.SDK.IEpuBearSDK.TouchDown ( float  x,
float  y 
)

This method sends the touch down event to the SDK.

See callback for possible reactions.

Parameters
xThe x coordinate of the touch position.
yThe y coordinate of the touch position.
Returns

◆ TouchMove()

bool epuBear.SDK.IEpuBearSDK.TouchMove ( float  x,
float  y 
)

This method sends the touch move event to the SDK.

See callback for possible reactions.

Parameters
xThe x coordinate of the touch position.
yThe y coordinate of the touch position.
Returns

◆ TouchUp()

bool epuBear.SDK.IEpuBearSDK.TouchUp ( float  x,
float  y 
)

This method sends the touch up event to the SDK.

See callback for possible reactions.

Parameters
xThe x coordinate of the touch position.
yThe y coordinate of the touch position.
Returns

◆ UpdateBitmapSize()

void epuBear.SDK.IEpuBearSDK.UpdateBitmapSize ( int  width,
int  height 
)

This methods updates all page bitmaps to the (width, height).

Parameters
widthNew width of all bitmaps
heightNew height os all bitmaps

◆ UsePreprocessing()

void epuBear.SDK.IEpuBearSDK.UsePreprocessing ( bool  used)
Parameters
used

Property Documentation

◆ Callbacks

Callbacks epuBear.SDK.IEpuBearSDK.Callbacks
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).

◆ CenterImageNativeObject

object epuBear.SDK.IEpuBearSDK.CenterImageNativeObject
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.

◆ DocumentLanguage

string epuBear.SDK.IEpuBearSDK.DocumentLanguage
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.

◆ IsBookPageFixedViewport

bool epuBear.SDK.IEpuBearSDK.IsBookPageFixedViewport
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.

◆ LeftImageNativeObject

object epuBear.SDK.IEpuBearSDK.LeftImageNativeObject
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.

◆ MediaCallbacks

MediaCallbacks epuBear.SDK.IEpuBearSDK.MediaCallbacks
get

These callabcks are related to multimedia within the book.

The app can provide multimedia (audio, video) capabilities by implementing players.

◆ RightImageNativeObject

object epuBear.SDK.IEpuBearSDK.RightImageNativeObject
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.

◆ TableOfContents

string [] epuBear.SDK.IEpuBearSDK.TableOfContents
get

This property returns the table of content in an array form.

some books might not have the ToC.

◆ TextRtl

bool epuBear.SDK.IEpuBearSDK.TextRtl
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.

◆ TreeOfContents

ContentsTree epuBear.SDK.IEpuBearSDK.TreeOfContents
get

This property returns the table of content in a tree form.

Some books might not have the ToC.


The documentation for this interface was generated from the following file: