C# Class nl.siegmann.epublib.domain.Book

Show file Open project: lanfengqi/EpubLib-Sharp Class Usage Examples

Public Methods

Method Description
addResource ( Resource resource ) : Resource
addSection ( TOCReference parentSection, string sectionTitle, Resource resource ) : TOCReference

Adds the resource to the table of contents of the book as a child section of the given parentSection

addSection ( string title, Resource resource ) : TOCReference

Adds a resource to the book's set of resources, table of contents and if there is no resource with the id in the spine also adds it to the spine.

generateSpineFromTableOfContents ( ) : void
getContents ( ) : List

All Resources of the Book that can be reached via the Spine, the TableOfContents or the Guide.

Consists of a list of "reachable" resources:

  • The coverpage
  • The resources of the Spine that are not already in the result
  • The resources of the Table of Contents that are not already in the result
  • The resources of the Guide that are not already in the result
To get all html files that make up the epub file use

getCoverImage ( ) : Resource

The book's cover image.

getCoverPage ( ) : Resource

The book's cover page. An XHTML document containing a link to the cover image.

getGuide ( ) : Guide

The guide; contains references to special sections of the book like colophon, glossary, etc.

getMetadata ( ) : Metadata

The Book's metadata (titles, authors, etc)

getNcxResource ( ) : Resource
getOpfResource ( ) : Resource
getResources ( ) : Resources

The collection of all images, chapters, sections, xhtml files, stylesheets, etc that make up the book.

getSpine ( ) : Spine

The sections of the book that should be shown if a user reads the book from start to finish.

getTableOfContents ( ) : TableOfContents

The Table of Contents of the book.

getTitle ( ) : string

Gets the first non-blank title from the book's metadata.

setCoverImage ( Resource coverImage ) : void
setCoverPage ( Resource coverPage ) : void
setMetadata ( Metadata metadata ) : void
setNcxResource ( Resource ncxResource ) : void
setOpfResource ( Resource opfResource ) : void
setResources ( Resources resources ) : void
setSpine ( Spine spine ) : void
setTableOfContents ( TableOfContents tableOfContents ) : void

Private Methods

Method Description
addToContentsResult ( Resource resource, Resource>.Dictionary allReachableResources ) : void

Method Details

addResource() public method

public addResource ( Resource resource ) : Resource
resource Resource
return Resource

addSection() public method

Adds the resource to the table of contents of the book as a child section of the given parentSection
public addSection ( TOCReference parentSection, string sectionTitle, Resource resource ) : TOCReference
parentSection TOCReference
sectionTitle string
resource Resource
return TOCReference

addSection() public method

Adds a resource to the book's set of resources, table of contents and if there is no resource with the id in the spine also adds it to the spine.
public addSection ( string title, Resource resource ) : TOCReference
title string
resource Resource
return TOCReference

generateSpineFromTableOfContents() public method

public generateSpineFromTableOfContents ( ) : void
return void

getContents() public method

All Resources of the Book that can be reached via the Spine, the TableOfContents or the Guide.

Consists of a list of "reachable" resources:

  • The coverpage
  • The resources of the Spine that are not already in the result
  • The resources of the Table of Contents that are not already in the result
  • The resources of the Guide that are not already in the result
To get all html files that make up the epub file use
public getContents ( ) : List
return List

getCoverImage() public method

The book's cover image.
public getCoverImage ( ) : Resource
return Resource

getCoverPage() public method

The book's cover page. An XHTML document containing a link to the cover image.
public getCoverPage ( ) : Resource
return Resource

getGuide() public method

The guide; contains references to special sections of the book like colophon, glossary, etc.
public getGuide ( ) : Guide
return Guide

getMetadata() public method

The Book's metadata (titles, authors, etc)
public getMetadata ( ) : Metadata
return Metadata

getNcxResource() public method

public getNcxResource ( ) : Resource
return Resource

getOpfResource() public method

public getOpfResource ( ) : Resource
return Resource

getResources() public method

The collection of all images, chapters, sections, xhtml files, stylesheets, etc that make up the book.
public getResources ( ) : Resources
return Resources

getSpine() public method

The sections of the book that should be shown if a user reads the book from start to finish.
public getSpine ( ) : Spine
return Spine

getTableOfContents() public method

The Table of Contents of the book.
public getTableOfContents ( ) : TableOfContents
return TableOfContents

getTitle() public method

Gets the first non-blank title from the book's metadata.
public getTitle ( ) : string
return string

setCoverImage() public method

public setCoverImage ( Resource coverImage ) : void
coverImage Resource
return void

setCoverPage() public method

public setCoverPage ( Resource coverPage ) : void
coverPage Resource
return void

setMetadata() public method

public setMetadata ( Metadata metadata ) : void
metadata Metadata
return void

setNcxResource() public method

public setNcxResource ( Resource ncxResource ) : void
ncxResource Resource
return void

setOpfResource() public method

public setOpfResource ( Resource opfResource ) : void
opfResource Resource
return void

setResources() public method

public setResources ( Resources resources ) : void
resources Resources
return void

setSpine() public method

public setSpine ( Spine spine ) : void
spine Spine
return void

setTableOfContents() public method

public setTableOfContents ( TableOfContents tableOfContents ) : void
tableOfContents TableOfContents
return void