Ipelib

ipe::Document Class Reference

The model for an Ipe document. More...

#include <ipedoc.h>

List of all members.

Classes

Public Types

Public Member Functions

Static Public Member Functions


Detailed Description

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.


Member Enumeration Documentation

There are several Ipe document save formats.

Enumerator:
EXml 

Save as XML.

EPdf 

Save as PDF.

EEps 

Save as Encapsulated Postscript.

EIpe5 

Ancient Ipe format.

EUnknown 

Unknown file format.

anonymous enum

Options for saving Ipe documents (to PDF and Postscript)

Enumerator:
ESaveNormal 

Nothing special.

EExport 

Don't include Ipe markup.

ENoZip 

Do not compress streams.

EMarkedView 

Create marked views only.

ENoColor 

No color commands in EPS output.

Errors that can happen while loading documents.

Enumerator:
EVersionTooOld 

The version of the file is too old.

EVersionTooRecent 

The file version is newer than this Ipelib.

EFileOpenError 

Error opening the file.

anonymous enum

Error codes returned by RunLatex.

Enumerator:
ErrNone 
ErrNoText 
ErrNoDir 
ErrWritingSource 
ErrOldPdfLatex 
ErrRunLatex 
ErrLatex 
ErrLatexOutput 
ErrNoIconv 

Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Page * Document::set ( int  no,
Page page 
)

Replace page.

Returns the original page.

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).

Cascade * Document::replaceCascade ( Cascade sheets)

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.


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