libetonyek::IWORKStyleStack Class Reference documentation

Public Member Functions | Private Types | Private Attributes | List of all members
libetonyek::IWORKStyleStack Class Reference

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

`#include <IWORKStyleStack.h>`

## Public Member Functions
| IWORKStyleStack ()
| Construct an empty context.
| ~IWORKStyleStack ()
void | push ()
| Push a style onto the active styles stack.
void | push (const IWORKStylePtr_t &style)
| Push a style onto the active styles stack.
void | pop ()
| Pop a style from the active styles stack.
void | set (const IWORKStylePtr_t &style)
template<class Property >
bool | has (const bool lookInParent=true) const
template<class Property >
const IWORKPropertyInfo< Property >::ValueType & | get (const bool lookInParent=true) const

## Private Types
typedef std::deque< IWORKStylePtr_t > | Stack_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 `IWORKStyle` should take a pointer to a `IWORKStyleStack`.

## Member Typedef Documentation

## ◆ Stack_t

typedef std::deque<IWORKStylePtr_t> libetonyek::IWORKStyleStack::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

## ◆ IWORKStyleStack()

libetonyek::IWORKStyleStack::IWORKStyleStack | ( |  | ) |

Construct an empty context.

## ◆ ~IWORKStyleStack()

libetonyek::IWORKStyleStack::~IWORKStyleStack | ( |  | ) |

## Member Function Documentation

## ◆ get()

template<class Property >

const IWORKPropertyInfo< Property >::ValueType & libetonyek::IWORKStyleStack::get | ( | const bool | lookInParent = true | ) | const
| inline

Referenced by libetonyek::KEYCollector::collectTextPlaceholder(), libetonyek::IWORKText::fillParaPropList(), and libetonyek::IWORKTable::insertCell().

## ◆ has()

template<class Property >

bool libetonyek::IWORKStyleStack::has | ( | const bool | lookInParent = true | ) | const
| inline

Referenced by libetonyek::KEYCollector::collectTextPlaceholder(), libetonyek::IWORKText::fillParaPropList(), and libetonyek::IWORKTable::insertCell().

## ◆ pop()

void libetonyek::IWORKStyleStack::pop | ( |  | ) |

Pop a style from the active styles stack.

Referenced by libetonyek::KEYCollector::collectTextPlaceholder(), libetonyek::IWORKText::fillParaPropList(), libetonyek::IWORKText::openSpan(), and libetonyek::IWORKCollector::popStyle().

## ◆ push() [1/2]

void libetonyek::IWORKStyleStack::push | ( |  | ) |

Push a style onto the active styles stack.

The previous top style becomes a dynamic parent `style`.

Referenced by libetonyek::KEYCollector::collectTextPlaceholder(), libetonyek::IWORKTable::draw(), libetonyek::IWORKText::fillParaPropList(), libetonyek::IWORKText::handleListLevelChange(), libetonyek::IWORKTable::insertCell(), libetonyek::IWORKText::needsSection(), libetonyek::IWORKText::openSpan(), libetonyek::IWORKText::pushBaseLayoutStyle(), libetonyek::IWORKText::pushBaseParagraphStyle(), and libetonyek::IWORKCollector::pushStyle().

## ◆ push() [2/2]

void libetonyek::IWORKStyleStack::push | ( | const IWORKStylePtr_t & | style | ) |

Push a style onto the active styles stack.

The previous top style becomes a dynamic parent `style`.

## ◆ set()

void libetonyek::IWORKStyleStack::set | ( | const IWORKStylePtr_t & | style | ) |

Referenced by libetonyek::KEYCollector::collectTextPlaceholder(), and libetonyek::IWORKCollector::setGraphicStyle().

## Member Data Documentation

## ◆ m_stack

Stack_t libetonyek::IWORKStyleStack::m_stack
| private

Referenced by get(), has(), pop(), push(), push(), and set().

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

- IWORKStyleStack.h
- IWORKStyleStack.cpp