Ipelib
|
The model for an Ipe document. More...
#include <ipedoc.h>
The model for an Ipe document.
The Document class represents the contents of an Ipe document, and all the methods necessary to load, save, and modify it.
anonymous enum |
anonymous enum |
Document::Document | ( | ) |
Construct an empty document for filling by a client.
As constructed, it has no pages, A4 media, and only the standard style sheet.
Document::Document | ( | const Document & | rhs | ) |
Copy constructor.
Document::~Document | ( | ) |
Destructor.
Document::TFormat Document::fileFormat | ( | DataSource & | source | ) | [static] |
Determine format of file in source.
Document::TFormat Document::formatFromFilename | ( | String | fn | ) | [static] |
Determine format of file from filename fn.
Document * Document::load | ( | DataSource & | source, |
TFormat | format, | ||
int & | reason | ||
) | [static] |
Construct a document from an input stream.
Returns 0 if the stream couldn't be parsed, and a reason explaining that in reason. If reason is positive, it is a file (stream) offset where parsing failed. If reason is negative, it is an error code, see Document::LoadErrors.
Document * Document::load | ( | const char * | fname, |
int & | reason | ||
) | [static] |
Document * Document::loadWithErrorReport | ( | const char * | fname | ) | [static] |
bool Document::save | ( | TellStream & | stream, |
TFormat | format, | ||
uint | flags | ||
) | const |
Save in a stream.
Returns true if sucessful.
bool Document::save | ( | const char * | fname, |
TFormat | format, | ||
uint | flags | ||
) | const |
bool Document::exportPages | ( | const char * | fname, |
uint | flags, | ||
int | fromPage, | ||
int | toPage | ||
) | const |
Export a range of pages to PDF.
bool Document::exportView | ( | const char * | fname, |
TFormat | format, | ||
uint | flags, | ||
int | pno, | ||
int | vno | ||
) | const |
Export a single view to PDF or EPS.
void Document::saveAsXml | ( | Stream & | stream, |
bool | usePdfBitmaps = false |
||
) | const |
Save in XML format into an Stream.
int ipe::Document::countPages | ( | ) | const [inline] |
Return number of pages of document.
int Document::countTotalViews | ( | ) | const |
Return total number of views in all pages.
const Page* ipe::Document::page | ( | int | no | ) | const [inline] |
Return page (const version).
The first page is no 0.
Page* ipe::Document::page | ( | int | no | ) | [inline] |
Return page.
The first page is no 0.
void Document::insert | ( | int | no, |
Page * | page | ||
) |
Insert a new page.
The page is inserted at index no.
void Document::push_back | ( | Page * | page | ) |
Append a new page.
Page * Document::remove | ( | int | no | ) |
Remove a page.
Returns the page that has been removed.
SProperties ipe::Document::properties | ( | ) | const [inline] |
Return document properties.
void Document::setProperties | ( | const SProperties & | info | ) |
Set document properties.
Cascade* ipe::Document::cascade | ( | ) | [inline] |
Return stylesheet cascade.
const Cascade* ipe::Document::cascade | ( | ) | const [inline] |
Return stylesheet cascade (const version).
Replace the entire style sheet cascade.
Takes ownership of cascade, and returns the original cascade.
void Document::setFontPool | ( | FontPool * | fontPool | ) |
Update the font pool (after running Pdflatex).
Takes ownership of the font pool.
const FontPool* ipe::Document::fontPool | ( | ) | const [inline] |
Return the current FontPool.
bool Document::hasTrueTypeFonts | ( | ) | const |
Return whether this document uses any Truetype fonts.
bool Document::hasTransparency | ( | ) | const |
Does this document make any use of transparency?
The document is considered to make use of transparency if its style sheets define any opacities whose value is not 1.0.
bool Document::hasTilings | ( | ) | const |
Does this document contain any tiling patterns?
bool Document::hasGradients | ( | ) | const |
Does this document contain any gradients?
void Document::findBitmaps | ( | BitmapFinder & | bm | ) | const |
Create a list of all bitmaps in the document.
bool Document::checkStyle | ( | AttributeSeq & | seq | ) | const |
Check all symbolic attributes in the document.
This function verifies that all symbolic attributes in the document are defined in the style sheet. It appends to seq all symbolic attributes (in no particular order, but without duplicates) that are NOT defined.
Returns true
if there are no undefined symbolic attributes in the document.
int Document::runLatex | ( | String & | logFile | ) |
Run PdfLatex.
int Document::runLatex | ( | ) |
Run Pdflatex (suitable for console applications)
Success/error is reported on stderr.