vnote/src/vstyleparser.h
Le Tan fe4a2cdcc8 move peg-markdown-highlight as a lib to avoid warnings
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-11 23:09:42 +08:00

37 lines
951 B
C++

#ifndef VSTYLEPARSER_H
#define VSTYLEPARSER_H
#include <QPalette>
#include <QVector>
#include <QString>
#include "hgmarkdownhighlighter.h"
extern "C" {
#include <pmh_definitions.h>
#include <pmh_styleparser.h>
}
class QColor;
class QBrush;
class VStyleParser
{
public:
VStyleParser();
~VStyleParser();
void parseMarkdownStyle(const QString &styleStr);
QVector<HighlightingStyle> fetchMarkdownStyles(const QFont &baseFont) const;
void fetchMarkdownEditorStyles(QPalette &palette, QFont &font) const;
private:
QColor QColorFromPmhAttr(pmh_attr_argb_color *attr) const;
QBrush QBrushFromPmhAttr(pmh_attr_argb_color *attr) const;
QTextCharFormat QTextCharFormatFromAttrs(pmh_style_attribute *attrs,
const QFont &baseFont) const;
QString filterAvailableFontFamily(const QString &familyList) const;
pmh_style_collection *markdownStyles;
};
#endif // VSTYLEPARSER_H