00001 #ifndef XMLPARSE_H_
00002 #define XMLPARSE_H_
00003
00004 #include <QDomDocument>
00005 #include <QString>
00006 #include <QRect>
00007
00008 #include "uitypes.h"
00009
00010 class MythUIHelper;
00011
00012 class XMLParse
00013 {
00014 public:
00015 XMLParse();
00016 ~XMLParse();
00017
00018 protected:
00019 fontProp *GetFont(const QString &, bool checkGlobal = true);
00020 LayerSet *GetSet(const QString &text);
00021 void SetWMult(double wm) { wmult = wm; }
00022 void SetHMult(double hm) { hmult = hm; }
00023
00024 bool LoadTheme(QDomElement &, QString, QString sf = "");
00025
00026 private:
00027 bool doLoadTheme(QDomElement &, QString, QString);
00028 QMap<QString, fontProp> fontMap;
00029 QMap<QString, LayerSet*> layerMap;
00030 vector<LayerSet *> *allTypes;
00031
00032 QString getFirstText(QDomElement &);
00033 void parseFont(QDomElement &);
00034 void normalizeRect(QRect &);
00035 QPoint parsePoint(QString);
00036 QRect parseRect(QString);
00037 void parseContainer(QDomElement &, QString &, int &, QRect &);
00038 void parseKeyboard(LayerSet *, QDomElement &);
00039 void parseKey(LayerSet *, QDomElement &);
00040
00041 double wmult;
00042 double hmult;
00043
00044 QString fontSizeType;
00045
00046 MythUIHelper *ui;
00047
00048 friend class MythThemedDialog;
00049 friend class MythDialog;
00050 };
00051
00052 #endif