libetonyek::KEYStyleContext Class Reference

Representation of a dynamic inheritance of styles. More...

#include <KEYStyleContext.h>

List of all members.

Public Member Functions

 KEYStyleContext ()
 Construct an empty context.
void push (const KEYStylePtr_t &style)
 Push a style onto the active styles stack.
void pop ()
 Pop a style from the active styles stack.
boost::any find (const std::string &property, bool lookInParent=false) const
 Find the current value of property property.

Private Types

typedef std::deque< KEYStylePtr_tStack_t
 The internal type of style stack.

Private Attributes

Stack_t m_stack

Detailed Description

Representation of a dynamic inheritance of styles.

A static inheritance of styles is represented by the "parent" relation of styles. A dynamic inheritance is defined by the way styles are applied on elements. One or more styles may be active at any given moment (e.g., a character style of a text span and a paragraph style of the paragraph) and a property can be inherited from the enclosing style.

The property getters in specific implementations of KEYStyle should take a pointer to a KEYStyleContext.


Member Typedef Documentation

typedef std::deque<KEYStylePtr_t> libetonyek::KEYStyleContext::Stack_t [private]

The internal type of style stack.

std::deque is used instead of std::stack because std::stack does not allow iteration through the elements.


Constructor & Destructor Documentation

Construct an empty context.


Member Function Documentation

boost::any libetonyek::KEYStyleContext::find ( const std::string &  property,
bool  lookInParent = false 
) const

Find the current value of property property.

The search traverses the stack of active styles from top to bottom. The search ends if property is found or if bottom is reached.

  • [in] property the property to look for
  • [in] lookInParent should the parent styles of the active styles be included in the search too?
    Returns:
    the found value or empty value
    KEYPropertyMap::get

Referenced by libetonyek::KEYStyleBase::lookup().

Pop a style from the active styles stack.

Referenced by libetonyek::KEYOutput::~KEYOutput().

Push a style onto the active styles stack.

The previous top style becomes a dynamic parent style.

  • [in] style the style to push

Referenced by libetonyek::KEYOutput::KEYOutput().


Member Data Documentation


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