Scribus Epub Export Plugin
Public Member Functions | List of all members
EpubExportStructure Class Reference

Contains the structure data of the Epub file (metadata, manifest, cover, Xml files, ...) More...

#include <epubexportStructure.h>

Inheritance diagram for EpubExportStructure:
Inheritance graph
[legend]
Collaboration diagram for EpubExportStructure:
Collaboration graph
[legend]

Public Member Functions

 EpubExportStructure ()
 
void readMetadata (ScribusAPIDocumentMetadata metadata)
 Read the metadata, as provided by the ScribusAPI plugin.
 
ScribusAPIDocumentMetadata getMetadata ()
 
void setFilename (QString filename)
 
void addToManifest (EpubExportStructureManifestItem item)
 add an EpubExportStructureManifestItem to the manifest.
 
void addToManifest (QString id, QString path, QString mediatype)
 create an EpubExportStructureManifestItem and it to the manifest. More...
 
void addToToc (QString id, QString path, QString title)
 create an EpubExportStructureManifestItem and it to the table of contents. More...
 
void addToToc (EpubExportStructureManifestItem item)
 add an EpubExportStructureManifestItem to the table of contents.
 
QString getOPF ()
 creates the xml string for the OPF file More...
 
QString getNCX ()
 creates the xml string for the NCX file More...
 
QString getContainer ()
 add META-INF/container.xml to the current epub file More...
 
void setCover (QByteArray cover)
 
bool hasCover ()
 
QByteArray getCover ()
 

Detailed Description

Contains the structure data of the Epub file (metadata, manifest, cover, Xml files, ...)

Constructor & Destructor Documentation

EpubExportStructure::EpubExportStructure ( )

Store information related to the structure of content and return the strings for the "structural" files for the .epub file

Member Function Documentation

void EpubExportStructure::addToManifest ( QString  id,
QString  path,
QString  mediatype 
)

create an EpubExportStructureManifestItem and it to the manifest.

Parameters
mediatypemedia-type as defined by http://www.iana.org/assignments/media-types/media-types.xhtml
void EpubExportStructure::addToToc ( QString  id,
QString  path,
QString  title 
)

create an EpubExportStructureManifestItem and it to the table of contents.

Parameters
mediatypemedia-type as defined by http://www.iana.org/assignments/media-types/media-types.xhtml
QString EpubExportStructure::getContainer ( )

add META-INF/container.xml to the current epub file

1 <?xml version="1.0" encoding="UTF-8" ?>
2 <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
3  <rootfiles>
4  <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
5  </rootfiles>
6 </container>
QString EpubExportStructure::getNCX ( )

creates the xml string for the NCX file

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
3 "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
4 <ncx version="2005-1" xml:lang="en" xmlns="http://www.daisy.org/z3986/2005/ncx/">
5  <head>
6  <meta name="dtb:uid" content="123456789X"/>
7  <meta name="dtb:depth" content="1"/>
8  <meta name="dtb:totalPageCount" content="0"/>
9  <meta name="dtb:maxPageNumber" content="0"/>
10  </head>
11  <docTitle>
12  <text>Pride and Prejudice</text>
13  </docTitle>
14  <docAuthor>
15  <text>Austen, Jane</text>
16  </docAuthor>
17  <navMap>
18  <navPoint class="chapter" id="chapter1" playOrder="1">
19  <navLabel><text>Chapter 1</text></navLabel>
20  <content src="chapter1.xhtml"/>
21  </navPoint>
22  </navMap>
23 </ncx>
QString EpubExportStructure::getOPF ( )

creates the xml string for the OPF file

The OPF file, traditionally named content.opf, houses the EPUB book's metadata, file manifest, and linear reading order.

On the IDPF site you can find the full list of the possible metadata http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2

1 <?xml version="1.0"?>
2 <package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId">
3  <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
4  <dc:title>Pride and Prejudice</dc:title>
5  <dc:language>en</dc:language>
6  <dc:identifier id="BookId" opf:scheme="ISBN">123456789X</dc:identifier>
7  <dc:creator opf:file-as="Austen, Jane" opf:role="aut">Jane Austen</dc:creator>
8  </metadata>
9  <manifest>
10  <item id="chapter1" href="chapter1.xhtml" media-type="application/xhtml+xml"/>
11  <item id="stylesheet" href="style.css" media-type="text/css"/>
12  <item id="ch1-pic" href="ch1-pic.png" media-type="image/png"/>
13  <item id="myfont" href="css/myfont.otf" media-type="application/x-font-opentype"/>
14  <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
15  </manifest>
16  <spine toc="ncx">
17  <itemref idref="chapter1" />
18  </spine>
19  <guide>
20  <reference type="loi" title="List Of Illustrations" href="appendix.html#figures" />
21  </guide>
22 </package>
void EpubExportStructure::setCover ( QByteArray  cover)
inline
Parameters
covercontent of a PNG file as a byte stream

The documentation for this class was generated from the following files: