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