MD::Block Class

template <typename Trait> class MD::Block

Abstract block (storage of child items). More...

Header: #include <md4qt/doc.h>
CMake: find_package(md4qt REQUIRED COMPONENTS md4qt)
target_link_libraries(mytarget PRIVATE md4qt::md4qt)
Inherits: MD::Item
Inherited By:

MD::Blockquote, MD::Document, MD::Footnote, MD::List, MD::ListItem, MD::Paragraph, and MD::TableCell

Public Types

Public Functions

void appendItem(MD::Block<Trait>::ItemSharedPointer i)
void applyBlock(const MD::Block<Trait> &other, MD::Document<Trait> *doc = nullptr)
MD::Block<Trait>::ItemSharedPointer getItemAt(long long idx) const
void insertItem(long long idx, MD::Block<Trait>::ItemSharedPointer i)
bool isEmpty() const
const MD::Block<Trait>::Items &items() const
void removeItemAt(long long idx)

Detailed Description

Member Type Documentation

[alias] Block::ItemSharedPointer

Type of pointer to child item.

[alias] Block::Items

Type of list of children.

Member Function Documentation

void Block::appendItem(MD::Block<Trait>::ItemSharedPointer i)

Append child item.

i Item to append.

void Block::applyBlock(const MD::Block<Trait> &other, MD::Document<Trait> *doc = nullptr)

Apply other block to this.

other Value to apply.

doc Parent of new item.

MD::Block<Trait>::ItemSharedPointer Block::getItemAt(long long idx) const

Returns child item at the given position.

idx Index.

void Block::insertItem(long long idx, MD::Block<Trait>::ItemSharedPointer i)

Insert child item at given position.

idx Index where insert.

i Item to insert.

bool Block::isEmpty() const

Returns whether there are no children.

const MD::Block<Trait>::Items &Block::items() const

Returns list of child items.

void Block::removeItemAt(long long idx)

Remove child item at the given position.

idx Index where to remove.