#ifndef PQTEXTCHARFORMAT_H
#define PQTEXTCHARFORMAT_H

#include "classes/pqobject.h"
#include <QTextCharFormat>

class PQTextCharFormat;
class PQTextCharFormat : public QObject, public QTextCharFormat {
    Q_OBJECT
    PQ_OBJECT_EX(QObject)

    Q_PROPERTY(QString foreground READ foreground WRITE setForeground)
    Q_PROPERTY(QString background READ background WRITE setBackground)
    Q_PROPERTY(int fontWeight READ fontWeight WRITE setFontWeight)
    Q_PROPERTY(bool fontItalic READ fontItalic WRITE setFontItalic)
    Q_PROPERTY(bool fontUnderline READ fontUnderline WRITE setFontUnderline)
    Q_PROPERTY(bool fontKerning READ fontKerning WRITE setFontKerning)
    Q_PROPERTY(QString fontFamily READ fontFamily WRITE setFontFamily)

public:
    Q_INVOKABLE explicit PQTextCharFormat(QObject *parent = 0);
    Q_INVOKABLE void setForeground(const QString &color);
    Q_INVOKABLE void setBackground(const QString &color);
    Q_INVOKABLE void setFontWeight(int weight);
    Q_INVOKABLE void setFontItalic(bool italic);
    Q_INVOKABLE void setFontUnderline(bool underline);
    Q_INVOKABLE void setFontKerning(bool kerning);
    Q_INVOKABLE void setFontFamily(const QString &fontFamily);

    Q_INVOKABLE QString foreground();
    Q_INVOKABLE QString background();
    Q_INVOKABLE int fontWeight();
    Q_INVOKABLE bool fontItalic();
    Q_INVOKABLE bool fontUnderline();
    Q_INVOKABLE bool fontKerning();
    Q_INVOKABLE QString fontFamily();

    QTextCharFormat format;

    PQ_ON_SIGNAL_DECL_START {
    } PQ_ON_SIGNAL_DECL_END

};

#endif // PQTEXTCHARFORMAT_H
