Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

IpeStyleSheet Class Reference
[Ipe Document]

A style sheet maps symbolic names to absolute values. More...

List of all members.

Public Methods

Static Public Methods


Detailed Description

A style sheet maps symbolic names to absolute values.

Ipe documents can use symbolic attributes, such as 'normal', 'fat', or 'thin' for line thickness, or 'red', 'navy', 'turquoise' for color. The mapping to an absolute pen thickness or RGB value is performed by an IpeStyleSheet.

IpeStyleSheet's cascade in the sense that a document can refer to several style sheets, which are arranged on a stack. The document owns the 'top-level stylesheet', which in turn owns the stack below it. A lookup is done from top to bottom, and returns as soon as a match is found. Ipe always appends the built-in "standard" style sheet at the bottom of the cascade.

Style sheets are always included when the document is saved, so that an Ipe document is self-contained.

The built-in style sheet is guaranteed not to change in ways that would change the meaning of existing Ipe files. In other words, new symbolic names may be defined, but no existing ones will be removed or mapped differently.

Note that the style sheet depends (and includes a pointer to) the IpeRepository of the document. You cannot attach a style sheet to another document---the IpeRepository wouldn't make sense. To transfer a style sheet, it has to be externalized and internalized again with the new repository. For this reason, copying and assigning IpeStyleSheet is illegal.


Constructor & Destructor Documentation

IpeStyleSheet::IpeStyleSheet IpeRepository   rep
 

The default constructor creates an empty style sheet.

IpeStyleSheet::~IpeStyleSheet  
 

Destructor.


Member Function Documentation

IpeStyleSheet * IpeStyleSheet::Standard IpeRepository   rep [static]
 

Create standard built-in style sheet.

void IpeStyleSheet::AddTemplate IpeAttribute    name,
const IpeObject   obj
 

Add a template object.

const IpeObject * IpeStyleSheet::FindTemplate IpeAttribute    sym const
 

Find a template object with given name.

void IpeStyleSheet::Add IpeAttribute    name,
IpeAttribute    value
 

Add an attribute.

IpeAttribute IpeStyleSheet::Find IpeAttribute    sym const
 

Find a symbolic attribute.

Returns null attribute if sym is null or cannot be found in the style sheet. In all other cases, returns an absolute attribute (one for which IsAbsolute() returns true).

void IpeStyleSheet::SaveAsXml IpeStream   stream const
 

Save style sheet in XML format.

void IpeStyleSheet::SaveCascadeAsXml IpeStream   stream const
 

Save whole style sheet cascade in XML format.

void IpeStyleSheet::AllNames IpeKind    kind,
IpeAttributeSeq   seq
const
 

Return all symbolic names in the style sheet cascade.

Names are simply appended from top to bottom of the cascade. Names are inserted only once.

bool IpeStyleSheet::IsStandard   const [inline]
 

Return whether this is the standard style sheet built into Ipe.

const IpeStyleSheet * IpeStyleSheet::Cascade   [inline]
 

Return next sheet in cascade (const version).

IpeStyleSheet * IpeStyleSheet::Cascade   [inline]
 

Return the next level style sheet.

void IpeStyleSheet::SetCascade IpeStyleSheet *    sheet
 

Set the next level of the style sheet cascade. Takes ownership.

The previous contents is not destroyed. You have to take care of that.

IpeString IpeStyleSheet::Name   const [inline]
 

Return name of style sheet.

void IpeStyleSheet::SetName IpeString    name [inline]
 

Set name of style sheet.

IpeRepository* IpeStyleSheet::Repository   [inline]
 

Return attribute repository.

const IpeRepository* IpeStyleSheet::Repository   const [inline]
 

Return attribute repository (const version).


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