MD::StyleDelim Class

class MD::StyleDelim

Emphasis in the Markdown document. More...

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

Public Functions

StyleDelim(int s, qsizetype startColumn, qsizetype startLine, qsizetype endColumn, qsizetype endLine, MD::EmphasisSymbol symbol = EmphasisSymbol::Unknown)
void setStyle(int t)
void setSymbol(MD::EmphasisSymbol s)
int style() const
MD::EmphasisSymbol symbol() const
virtual void write(QTextStream &stream) const
bool operator==(const MD::StyleDelim &l, const MD::StyleDelim &r)

Detailed Description

Information about where empasises start and end is needed for syntax highlighters. Any item in MD::Paragraph is MD::ItemWithOpts that stores information about openers and closer of emphasises if they are presented before/after the given item in paragraph. A developer may just check MD::ItemWithOpts::openStyles and MD::ItemWithOpts::closeStyles for data in them, and he will know all information about delimiters that started or ended style of the item.

Such information may be needed for developing additional styles (plugins), superscripts, subscripts, for example.

See also MD::ItemWithOpts.

Member Function Documentation

StyleDelim::StyleDelim(int s, qsizetype startColumn, qsizetype startLine, qsizetype endColumn, qsizetype endLine, MD::EmphasisSymbol symbol = EmphasisSymbol::Unknown)

Initializing constructor.

s Style. Actualy it's an ORed combination of MD::TextOption.

startColumn Start column.

startLine Start line.

endColumn End column.

endLine End line.

symbol Symbol.

void StyleDelim::setStyle(int t)

Set style.

t New value.

See also style().

void StyleDelim::setSymbol(MD::EmphasisSymbol s)

Set emphasis symbol.

s Symbol.

See also symbol().

int StyleDelim::style() const

Returns style.

See also setStyle().

MD::EmphasisSymbol StyleDelim::symbol() const

Returns emphasis sybol.

See also setSymbol().

[virtual] void StyleDelim::write(QTextStream &stream) const

Serialise style into Markdown.

stream Stream.

Related Non-Members

bool operator==(const MD::StyleDelim &l, const MD::StyleDelim &r)

Returns whether both are equal.

l Left operand.

r Right operand.