Dekko
FormattingOptions.h
1 #ifndef FORMATTINGOPTIONS_H
2 #define FORMATTINGOPTIONS_H
3 
4 #include <QObject>
5 #include <QColor>
6 #include <QFont>
7 #include <QQmlAutoPropertyHelpers.h>
8 
9 class FormattingOptions : public QObject
10 {
11  Q_OBJECT
12  QML_WRITABLE_AUTO_PROPERTY(int, fontSize)
13  QML_WRITABLE_AUTO_PROPERTY(QColor, textColor)
14  QML_WRITABLE_AUTO_PROPERTY(QColor, backgroundColor)
15  QML_WRITABLE_AUTO_PROPERTY(QColor, markupColor)
16  QML_WRITABLE_AUTO_PROPERTY(QColor, linkColor)
17  QML_WRITABLE_AUTO_PROPERTY(QString, fontFamily)
18  QML_WRITABLE_AUTO_PROPERTY(QFont::Weight, fontWeight)
19  QML_WRITABLE_AUTO_PROPERTY(bool, autoMatchEnabled)
20  QML_WRITABLE_AUTO_PROPERTY(bool, cycleBulletMarker)
21  QML_WRITABLE_AUTO_PROPERTY(bool, enableLargeHeadingSizes)
22  QML_WRITABLE_AUTO_PROPERTY(bool, useUnderlineForEmp)
23  QML_WRITABLE_AUTO_PROPERTY(bool, spacesForTabs)
24  QML_WRITABLE_AUTO_PROPERTY(int, tabWidth)
25  QML_WRITABLE_AUTO_PROPERTY(int, paperMargins)
26 
27 public:
28 
29  explicit FormattingOptions(QObject *parent = Q_NULLPTR) :
30  QObject(parent),
31  m_fontSize(12),
32  m_textColor(Qt::darkGray),
33  m_backgroundColor(Qt::white),
34  m_markupColor(Qt::lightGray),
35  m_linkColor(Qt::blue),
36  m_fontFamily(QStringLiteral("Ubuntu")),
37  m_fontWeight(QFont::Light),
38  m_autoMatchEnabled(false),
39  m_cycleBulletMarker(true),
40  m_enableLargeHeadingSizes(false),
41  m_useUnderlineForEmp(false),
42  m_spacesForTabs(false),
43  m_tabWidth(0),
44  m_paperMargins(0)
45  {
46  }
47 
48 };
49 
50 #endif // FORMATTINGOPTIONS_H
FormattingOptions
Definition: FormattingOptions.h:9