MythTV  master
xmlparsebase.h
Go to the documentation of this file.
1 #ifndef XMLPARSEBASE_H_
2 #define XMLPARSEBASE_H_
3 
4 #include <QString>
5 #include <QMap>
6 
7 #include "mythrect.h"
8 
9 class MythUIType;
10 class MythScreenType;
11 class QDomElement;
12 class QBrush;
13 
14 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
15 #define VERBOSE_XML(type, level, filename, element, msg) \
16  LOG(type, level, LOC + QString("%1\n\t\t\t" \
17  "Location: %2 @ %3\n\t\t\t" \
18  "Name: '%4'\tType: '%5'") \
19  .arg(msg, filename, QString::number((element).lineNumber()), \
20  (element).attribute("name", ""), (element).tagName()))
21 
22 
24 {
25  public:
26  static QString getFirstText(QDomElement &element);
27  static bool parseBool(const QString &text);
28  static bool parseBool(QDomElement &element);
29  static MythPoint parsePoint(const QString &text, bool normalize = true);
30  static MythPoint parsePoint(QDomElement &element, bool normalize = true);
31  static QSize parseSize(const QString &text, bool normalize = true);
32  static QSize parseSize(QDomElement &element, bool normalize = true);
33  static MythRect parseRect(const QString &text, bool normalize = true);
34  static MythRect parseRect(QDomElement &element, bool normalize = true);
35  static int parseAlignment(const QString &text);
36  static int parseAlignment(QDomElement &element);
37  static QBrush parseGradient(const QDomElement &element);
38  static QString parseText(QDomElement &element);
39  static MythUIType *GetGlobalObjectStore(void);
40  static void ClearGlobalObjectStore(void);
41 
42  static void ParseChildren(
43  const QString &filename, QDomElement &element,
44  MythUIType *parent, bool showWarnings);
45 
46  // parse one and return it.
47  static MythUIType *ParseUIType(
48  const QString &filename,
49  QDomElement &element, const QString &type,
50  MythUIType *parent, MythScreenType *screen,
51  bool showWarnings,
52  QMap<QString, QString> &parentDependsMap);
53 
54  static bool WindowExists(const QString &xmlfile, const QString &windowname);
55  static bool LoadWindowFromXML(const QString &xmlfile,
56  const QString &windowname,
57  MythUIType *parent);
58 
59  static bool LoadBaseTheme(void);
60  static bool LoadBaseTheme(const QString &baseTheme);
61 
62  static bool CopyWindowFromBase(const QString &windowname,
63  MythScreenType *win);
64 
65  private:
66  static bool doLoad(const QString &windowname, MythUIType *parent,
67  const QString &filename,
68  bool onlyLoadWindows, bool showWarnings);
69  static void ConnectDependants(MythUIType * parent,
70  QMap<QString, QString> &dependsMap);
71 
72 };
73 
74 #endif
mythrect.h
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
XMLParseBase
Definition: xmlparsebase.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
build_compdb.filename
filename
Definition: build_compdb.py:21
MythPoint
Wrapper around QPoint allowing us to handle percentage and other relative values for positioning in m...
Definition: mythrect.h:88