- Main Page
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

# IpeStyleSheet Class Reference
[Ipe Document]

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

List of all members.

## Public Member Functions

- IpeStyleSheet (IpeRepository *rep)
- ~IpeStyleSheet ()
- void AddTemplate (IpeAttribute name, const IpeObject *obj)
- const IpeObject * FindTemplate (IpeAttribute sym) const
- void Add (IpeAttribute name, IpeAttribute value)
- IpeAttribute Find (IpeAttribute sym) const
- void SaveAsXml (IpeStream &stream, bool saveBitmaps=false) const
- void SaveCascadeAsXml (IpeStream &stream) const
- void AllNames (IpeKind kind, IpeAttributeSeq &seq) const
- void AllNames (IpeAttributeSeq *attr) const
- bool IsStandard () const
- IpeString Preamble () const
- IpeString TotalPreamble () const
- void SetPreamble (const IpeString &str)
- void setLayout (const IpeLayout &margins)
- IpeLayout findLayout () const
- void setTitleStyle (const STitleStyle &ts)
- STitleStyle findTitleStyle () const
- void SetShading (const IpeShading &s)
- IpeShading FindShading () const
- void AddCMap (IpeString s)
- void AllCMaps (std::vector< IpeString > &seq) const
- void SetStrokeStyle (IpeStrokeStyle s)
- IpeAttribute LineCap () const
- IpeAttribute LineJoin () const
- IpeAttribute WindRule () const
- const IpeStyleSheet * Cascade () const
- IpeStyleSheet * Cascade ()
- void SetCascade (IpeStyleSheet *sheet)
- IpeString Name () const
- void SetName (const IpeString &name)
- IpeRepository * Repository ()
- const IpeRepository * Repository () const

## Static Public Member Functions

- static IpeStyleSheet * Standard (IpeRepository *rep)

## Classes

- struct STitleStyle
    Style of the title on a page. More...

## 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 | attr | ) | const

Find a template object with given name.

If attr is null, returns 0.

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,
|  | bool | saveBitmaps = `false` |
| ) |  |  | 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.

IpeString IpeStyleSheet::Preamble | ( |  | ) | const`[inline]`

Return preamble of this style sheet (not including the cascade).

IpeString IpeStyleSheet::TotalPreamble | ( |  | ) | const

Return total LaTeX preamble (of the whole cascade).

void IpeStyleSheet::SetPreamble | ( | const IpeString & | str | ) | `[inline]`

Set LaTeX preamble.

void IpeStyleSheet::setLayout | ( | const IpeLayout & | margins | ) |

Set page layout.

IpeLayout IpeStyleSheet::findLayout | ( |  | ) | const

Find text margins in style sheet cascade.

void IpeStyleSheet::setTitleStyle | ( | const STitleStyle & | ts | ) |

Set style of page titles.

IpeStyleSheet::STitleStyle IpeStyleSheet::findTitleStyle | ( |  | ) | const

Get style of page titles.

void IpeStyleSheet::SetShading | ( | const IpeShading & | s | ) |

Set the shading in this style sheet.

IpeShading IpeStyleSheet::FindShading | ( |  | ) | const

Find shading in style sheet cascade.

void IpeStyleSheet::AddCMap | ( | IpeString | s | ) |

Add font s to list of fonts with cmap generation.

void IpeStyleSheet::SetStrokeStyle | ( | IpeStrokeStyle | s | ) |

Set line cap, line join, and wind rule.

const IpeStyleSheet * IpeStyleSheet::Cascade | ( |  | ) | const`[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 | ( | const 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:

- ipestyle.h
- ipestdstyles.cpp
- ipestyle.cpp