#include <epubutils/epub_utils.h>
Public Member Functions | |
ebEpubGenerator () | |
ebEpubGenerator (const ebEpubGenerator &gen) | |
ebEpubGenerator (const ebBasicInfo &info, const ebFileLocations &locations, const ebEpubOptions &options) | |
void | Init () |
void | operator= (const ebEpubGenerator &gen) |
void | Copy (const ebEpubGenerator &gen) |
ebFileLocations & | GetFileLocations () |
const ebFileLocations & | GetFileLocations () const |
ebBasicInfo & | GetBasicInfo () |
const ebBasicInfo & | GetBasicInfo () const |
ebEpubOptions & | GetOptions () |
const ebEpubOptions & | GetOptions () const |
const wxString & | GetMobigenCommand () const |
wxString & | GetMobigenCommand () |
void | SetMobigenCommand (const wxString &cmd) |
void | SetVerbosity (int level) |
Set verbosity. | |
int | GetVerbosity () const |
bool | GenerateEpub () |
Generate the .epub. | |
const wxString & | GetLog () const |
Get log. | |
bool | DoGenerate () |
Helper function. | |
void | Log (const wxString &msg, int minLevel=ebEPUB_OUTPUT_ERRORS_ONLY) |
Write a log string. | |
void | ClearLog () |
Clear log. | |
void | Clear () |
Clear all. | |
bool | InitialChecks () |
Do initial checks. | |
bool | CreateMimeTypeFile () |
Create MIME type file mimetype. | |
bool | CreateContainerFile () |
Create container file container.xml. | |
bool | CreateContentFile () |
Create content.opf. | |
bool | CreateNCXFile () |
Create NCX table of contents. | |
bool | CreateHTMLTOCFile () |
Create HTML table of contents. | |
bool | CreateTitlePageFile () |
Create title page file. | |
bool | CreateCoverPageFile () |
Create cover page. | |
bool | CreateCSSFile () |
Create CSS. | |
bool | CreateHtmlFiles () |
Create content HTML files. | |
bool | CopyImageFiles () |
Copy image files. | |
bool | GetImageFiles () |
Get all image files in the project folder. | |
bool | CopyOtherFiles () |
Copy other files that might be relevant. | |
bool | CreateEpubFile () |
Create epub file. | |
bool | CreateMobiPocketFile () |
Create MobiPocket file. | |
wxString | GetContentFolder () const |
Get the location to place content HTML files etc. in. | |
wxString | GetCoverPageFilename () const |
Get the cover page filename (without the path). | |
wxString | AppendPaths (const wxString &path1, const wxString &path2) const |
Append paths. | |
bool | CreateZipArchive (const wxString &zipArchiveName, const wxArrayString &filenames, const wxArrayString &archiveNames, int compressionLevel) |
Create a zip file from actual filenames and corresponding archive names. | |
bool | ConvertTextFilesToHTML (int flags, wxMBConv &conv) |
Save all files that are actually plain text files as HTML. | |
bool | CanGenerateCoverPage () const |
Can we generate a cover page? | |
bool | ConvertFromExistingEbook (const wxString &ebookFilename, const wxString &utilityDir, wxArrayString &msgs) |
Convert from existing e-book, copying files to the project folder. | |
void | SetStringTable (wxStringTable *table) |
Set/get string table to use. | |
wxStringTable * | GetStringTable () const |
wxString | GetStringFromTable (const wxString &name) const |
Get a string from the string table, or return itself. | |
Static Public Member Functions | |
static int | GetTitleHeadingSize () |
Get title heading size (h1, h2...). | |
static wxString | GetHeadingString (int size) |
Get heading string, e.g. h1. | |
static bool | WriteHTMLHead (wxTextOutputStream &textStream, const wxString &title, const wxString &cssFilename=wxEmptyString) |
Write HTML head. | |
static bool | ConvertFromTextToHTML (const wxString &textFile, const wxString &htmlFile, wxString &title, const wxString &cssFile, int flags=ebHTML_CONVERSION_FIRST_LINE_IS_TITLE, wxMBConv &conv=wxConvUTF8) |
static bool | GetTextFileTitle (const wxString &textFile, wxString &title, wxMBConv &conv) |
Get the title from the first line of the file. | |
static wxString | IndentString (const wxString &str, int level, int spacesPerLevel=4) |
Indent string according to level. | |
static bool | CopyFileWithDirCreation (const wxString &file1, const wxString &file2) |
Copy with creation of directories if necessary. | |
static bool | GetFilesUnder (wxArrayString &files, const wxString &dir, const wxString &excludingDir, const wxString &exts) |
Get all files under the given directory, excluding another dir, matching the given extensions. | |
static bool | GetFilesUnder (wxArrayString &files, const wxString &topDir, const wxString &dir, const wxString &excludingDir, const wxString &exts) |
static wxString | MakeIdFromFilename (const wxString &filename) |
Make suitable id from filename. | |
static void | AddCreatorAttributes (ebElement &element, bool onlyResetChoices=false) |
Add standard instances and attributes for creator. | |
static void | AddContributorAttributes (ebElement &element, bool onlyResetChoices=false) |
Add standard instances and attributes for contributor. | |
static void | AddIdentifierAttributes (ebElement &element, bool onlyResetChoices=false) |
Add standard instances and attributes for identifier. | |
static void | AddPublisherAttributes (ebElement &element, bool onlyResetChoices=false) |
Add standard instances and attributes for publisher. | |
static void | AddDateAttributes (ebElement &element, bool onlyResetChoices=false) |
Add standard instances and attributes for date. | |
static void | AddLanguageAttributes (ebElement &element, bool onlyResetChoices=false) |
Add standard instances and attributes for language. |
ebEpubGenerator::ebEpubGenerator | ( | ) | [inline] |
ebEpubGenerator::ebEpubGenerator | ( | const ebEpubGenerator & | gen | ) | [inline] |
ebEpubGenerator::ebEpubGenerator | ( | const ebBasicInfo & | info, | |
const ebFileLocations & | locations, | |||
const ebEpubOptions & | options | |||
) | [inline] |
void ebEpubGenerator::AddContributorAttributes | ( | ebElement & | element, | |
bool | onlyResetChoices = false | |||
) | [static] |
Add standard instances and attributes for contributor.
void ebEpubGenerator::AddCreatorAttributes | ( | ebElement & | element, | |
bool | onlyResetChoices = false | |||
) | [static] |
Add standard instances and attributes for creator.
void ebEpubGenerator::AddDateAttributes | ( | ebElement & | element, | |
bool | onlyResetChoices = false | |||
) | [static] |
Add standard instances and attributes for date.
void ebEpubGenerator::AddIdentifierAttributes | ( | ebElement & | element, | |
bool | onlyResetChoices = false | |||
) | [static] |
Add standard instances and attributes for identifier.
void ebEpubGenerator::AddLanguageAttributes | ( | ebElement & | element, | |
bool | onlyResetChoices = false | |||
) | [static] |
Add standard instances and attributes for language.
static void ebEpubGenerator::AddPublisherAttributes | ( | ebElement & | element, | |
bool | onlyResetChoices = false | |||
) | [static] |
Add standard instances and attributes for publisher.
wxString ebEpubGenerator::AppendPaths | ( | const wxString & | path1, | |
const wxString & | path2 | |||
) | const |
Append paths.
bool ebEpubGenerator::CanGenerateCoverPage | ( | ) | const |
Can we generate a cover page?
void ebEpubGenerator::Clear | ( | ) |
Clear all.
void ebEpubGenerator::ClearLog | ( | ) | [inline] |
Clear log.
bool ebEpubGenerator::ConvertFromExistingEbook | ( | const wxString & | ebookFilename, | |
const wxString & | utilityDir, | |||
wxArrayString & | msgs | |||
) |
Convert from existing e-book, copying files to the project folder.
bool ebEpubGenerator::ConvertFromTextToHTML | ( | const wxString & | textFile, | |
const wxString & | htmlFile, | |||
wxString & | title, | |||
const wxString & | cssFile, | |||
int | flags = ebHTML_CONVERSION_FIRST_LINE_IS_TITLE , |
|||
wxMBConv & | conv = wxConvUTF8 | |||
) | [static] |
bool ebEpubGenerator::ConvertTextFilesToHTML | ( | int | flags, | |
wxMBConv & | conv | |||
) |
Save all files that are actually plain text files as HTML.
void ebEpubGenerator::Copy | ( | const ebEpubGenerator & | gen | ) |
bool ebEpubGenerator::CopyFileWithDirCreation | ( | const wxString & | file1, | |
const wxString & | file2 | |||
) | [static] |
Copy with creation of directories if necessary.
bool ebEpubGenerator::CopyImageFiles | ( | ) |
Copy image files.
bool ebEpubGenerator::CopyOtherFiles | ( | ) |
Copy other files that might be relevant.
bool ebEpubGenerator::CreateContainerFile | ( | ) |
Create container file container.xml.
bool ebEpubGenerator::CreateContentFile | ( | ) |
Create content.opf.
bool ebEpubGenerator::CreateCoverPageFile | ( | ) |
Create cover page.
bool ebEpubGenerator::CreateCSSFile | ( | ) |
Create CSS.
bool ebEpubGenerator::CreateEpubFile | ( | ) |
Create epub file.
bool ebEpubGenerator::CreateHtmlFiles | ( | ) |
Create content HTML files.
bool ebEpubGenerator::CreateHTMLTOCFile | ( | ) |
Create HTML table of contents.
bool ebEpubGenerator::CreateMimeTypeFile | ( | ) |
Create MIME type file mimetype.
bool ebEpubGenerator::CreateMobiPocketFile | ( | ) |
Create MobiPocket file.
bool ebEpubGenerator::CreateNCXFile | ( | ) |
Create NCX table of contents.
bool ebEpubGenerator::CreateTitlePageFile | ( | ) |
Create title page file.
bool ebEpubGenerator::CreateZipArchive | ( | const wxString & | zipArchiveName, | |
const wxArrayString & | filenames, | |||
const wxArrayString & | archiveNames, | |||
int | compressionLevel | |||
) |
Create a zip file from actual filenames and corresponding archive names.
bool ebEpubGenerator::DoGenerate | ( | ) |
Helper function.
bool ebEpubGenerator::GenerateEpub | ( | ) |
Generate the .epub.
const ebBasicInfo& ebEpubGenerator::GetBasicInfo | ( | ) | const [inline] |
ebBasicInfo& ebEpubGenerator::GetBasicInfo | ( | ) | [inline] |
wxString ebEpubGenerator::GetContentFolder | ( | ) | const |
Get the location to place content HTML files etc. in.
wxString ebEpubGenerator::GetCoverPageFilename | ( | ) | const |
Get the cover page filename (without the path).
const ebFileLocations& ebEpubGenerator::GetFileLocations | ( | ) | const [inline] |
ebFileLocations& ebEpubGenerator::GetFileLocations | ( | ) | [inline] |
bool ebEpubGenerator::GetFilesUnder | ( | wxArrayString & | files, | |
const wxString & | topDir, | |||
const wxString & | dir, | |||
const wxString & | excludingDir, | |||
const wxString & | exts | |||
) | [static] |
bool ebEpubGenerator::GetFilesUnder | ( | wxArrayString & | files, | |
const wxString & | dir, | |||
const wxString & | excludingDir, | |||
const wxString & | exts | |||
) | [static] |
Get all files under the given directory, excluding another dir, matching the given extensions.
Pass extensions as ";ext1;ext2;"
wxString ebEpubGenerator::GetHeadingString | ( | int | size | ) | [static] |
Get heading string, e.g. h1.
bool ebEpubGenerator::GetImageFiles | ( | ) |
Get all image files in the project folder.
const wxString& ebEpubGenerator::GetLog | ( | ) | const [inline] |
Get log.
wxString& ebEpubGenerator::GetMobigenCommand | ( | ) | [inline] |
const wxString& ebEpubGenerator::GetMobigenCommand | ( | ) | const [inline] |
const ebEpubOptions& ebEpubGenerator::GetOptions | ( | ) | const [inline] |
ebEpubOptions& ebEpubGenerator::GetOptions | ( | ) | [inline] |
wxString ebEpubGenerator::GetStringFromTable | ( | const wxString & | name | ) | const |
Get a string from the string table, or return itself.
wxStringTable* ebEpubGenerator::GetStringTable | ( | ) | const [inline] |
bool ebEpubGenerator::GetTextFileTitle | ( | const wxString & | textFile, | |
wxString & | title, | |||
wxMBConv & | conv | |||
) | [static] |
Get the title from the first line of the file.
int ebEpubGenerator::GetTitleHeadingSize | ( | ) | [static] |
Get title heading size (h1, h2...).
int ebEpubGenerator::GetVerbosity | ( | ) | const [inline] |
wxString ebEpubGenerator::IndentString | ( | const wxString & | str, | |
int | level, | |||
int | spacesPerLevel = 4 | |||
) | [static] |
Indent string according to level.
void ebEpubGenerator::Init | ( | ) |
bool ebEpubGenerator::InitialChecks | ( | ) |
Do initial checks.
void ebEpubGenerator::Log | ( | const wxString & | msg, | |
int | minLevel = ebEPUB_OUTPUT_ERRORS_ONLY | |||
) |
Write a log string.
wxString ebEpubGenerator::MakeIdFromFilename | ( | const wxString & | filename | ) | [static] |
Make suitable id from filename.
void ebEpubGenerator::operator= | ( | const ebEpubGenerator & | gen | ) | [inline] |
void ebEpubGenerator::SetMobigenCommand | ( | const wxString & | cmd | ) | [inline] |
void ebEpubGenerator::SetStringTable | ( | wxStringTable * | table | ) | [inline] |
Set/get string table to use.
void ebEpubGenerator::SetVerbosity | ( | int | level | ) | [inline] |
Set verbosity.
bool ebEpubGenerator::WriteHTMLHead | ( | wxTextOutputStream & | textStream, | |
const wxString & | title, | |||
const wxString & | cssFilename = wxEmptyString | |||
) | [static] |
Write HTML head.