-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHelpers.h
66 lines (37 loc) · 2.25 KB
/
Helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef HELPERS_H
#define HELPERS_H
#include "Mml.h"
#include "MmlNode.h"
#include "MmlNodeSpec.h"
#include "MmlOperSpec.h"
#include "MmlEntityTable.h"
#include "Device.h"
#include <QDomDocument>
class Helpers
{
public:
static double mmlQstringToQreal( const QString &string, bool *ok );
static QString mmlInterpretListAttr(const QString &value_list, int idx, const QString &def );
static Mml::FrameType mmlInterpretFrameType(const QString &value_list, int idx, bool *ok );
static double mmlInterpretSpacing( QString value, double em, double ex, bool *ok );
static Mml::FrameSpacing mmlInterpretFrameSpacing(const QString &value_list, qreal em, qreal ex, bool *ok );
static double mmlInterpretPercentSpacing(QString value, double base, bool *ok );
static double mmlInterpretPointSize( QString value, bool *ok );
static const MmlNodeSpec *mmlFindNodeSpec( Mml::NodeType type );
static const MmlNodeSpec *mmlFindNodeSpec( const QString &tag );
static bool mmlCheckChildType( Mml::NodeType parent_type, Mml::NodeType child_type, QString *error_str );
static bool mmlCheckAttributes( Mml::NodeType child_type, const MmlAttributeMap &attr, QString *error_str );
static int attributeIndex( const QString &name );
static QString mmlDictAttribute( const QString &name, const MmlOperSpec *spec );
static int mmlInterpretMathVariant( const QString &value, bool *ok );
static MmlAttributeMap collectFontAttributes( const MmlNode *node );
static QFont mmlInterpretMathSize( const QString &value, QFont &fn, double em, double ex, bool *ok );
static void updateFontAttr( MmlAttributeMap &font_attr, const MmlNode *n, const QString &name, const QString &preferred_name = QString() );
static QFont mmlInterpretDepreciatedFontAttr(const MmlAttributeMap &font_attr, QFont &fn, double em, double ex );
static Mml::NodeType domToMmlNodeType( const QDomNode &dom_node );
static QString rectToStr( const QRectF &rect );
static Mml::ColAlign mmlInterpretColAlign(const QString &value_list, int colnum, bool *ok );
static Mml::RowAlign mmlInterpretRowAlign(const QString &value_list, int rownum, bool *ok );
static Mml::FormType mmlInterpretForm( const QString &value, bool *ok );
};
#endif // HELPERS_H