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

Exibir arquivo Open project: lanfengqi/EpubLib-Sharp Class Usage Examples

Public Methods

Method Description
Spine ( ) : System
Spine ( List spineReferences ) : System
Spine ( TableOfContents tableOfContents ) : System

Creates a spine out of all the resources in the table of contents.

addResource ( Resource resource ) : SpineReference

Adds the given resource to the spine references and returns it.

addSpineReference ( SpineReference spineReference ) : SpineReference

Adds the given spineReference to the spine references and returns it.

createSpineReferences ( List resources ) : List
findFirstResourceById ( string resourceId ) : int

Finds the first resource that has the given resourceId. Null if not found.

getResource ( int index ) : Resource

Gets the resource at the given index. Null if not found.

getResourceIndex ( Resource currentResource ) : int

The position within the spine of the given resource.

getResourceIndex ( string resourceHref ) : int

The first position within the spine of a resource with the given href.

getSpineReferences ( ) : List
getTocResource ( ) : Resource

The resource containing the XML for the tableOfContents. When saving an epub file this resource needs to be in this place.

isEmpty ( ) : bool
setSpineReferences ( List spineReferences ) : void
setTocResource ( Resource tocResource ) : void

As per the epub file format the spine officially maintains a reference to the Table of Contents. The epubwriter will look for it here first, followed by some clever tricks to find it elsewhere if not found. Put it here to be sure of the expected behaviours.

size ( ) : int

The number of elements in the spine.

Method Details

Spine() public method

public Spine ( ) : System
return System

Spine() public method

public Spine ( List spineReferences ) : System
spineReferences List
return System

Spine() public method

Creates a spine out of all the resources in the table of contents.
public Spine ( TableOfContents tableOfContents ) : System
tableOfContents TableOfContents tableOfContents
return System

addResource() public method

Adds the given resource to the spine references and returns it.
public addResource ( Resource resource ) : SpineReference
resource Resource
return SpineReference

addSpineReference() public method

Adds the given spineReference to the spine references and returns it.
public addSpineReference ( SpineReference spineReference ) : SpineReference
spineReference SpineReference
return SpineReference

createSpineReferences() public static method

public static createSpineReferences ( List resources ) : List
resources List
return List

findFirstResourceById() public method

Finds the first resource that has the given resourceId. Null if not found.
public findFirstResourceById ( string resourceId ) : int
resourceId string
return int

getResource() public method

Gets the resource at the given index. Null if not found.
public getResource ( int index ) : Resource
index int
return Resource

getResourceIndex() public method

The position within the spine of the given resource.
public getResourceIndex ( Resource currentResource ) : int
currentResource Resource
return int

getResourceIndex() public method

The first position within the spine of a resource with the given href.
public getResourceIndex ( string resourceHref ) : int
resourceHref string
return int

getSpineReferences() public method

public getSpineReferences ( ) : List
return List

getTocResource() public method

The resource containing the XML for the tableOfContents. When saving an epub file this resource needs to be in this place.
public getTocResource ( ) : Resource
return Resource

isEmpty() public method

public isEmpty ( ) : bool
return bool

setSpineReferences() public method

public setSpineReferences ( List spineReferences ) : void
spineReferences List
return void

setTocResource() public method

As per the epub file format the spine officially maintains a reference to the Table of Contents. The epubwriter will look for it here first, followed by some clever tricks to find it elsewhere if not found. Put it here to be sure of the expected behaviours.
public setTocResource ( Resource tocResource ) : void
tocResource Resource tocResource
return void

size() public method

The number of elements in the spine.
public size ( ) : int
return int