MythTV  master
themeinfo.h
Go to the documentation of this file.
1 #ifndef THEMEINFO_H
2 #define THEMEINFO_H
3 
4 #include <QString>
5 #include <QSize>
6 #include <QMetaType>
7 #include <QFileInfo>
8 
9 #include "mythuiexp.h"
10 #include "mythtypes.h"
11 
12 #include "xmlparsebase.h" // for VERBOSE_XML && Xml Parsing helpers
13 
14 typedef enum {
15  THEME_UNKN = 0x00,
16  THEME_UI = 0x01,
17  THEME_OSD = 0x02,
18  THEME_MENU = 0x04
19 } ThemeType;
20 
22 {
23  public:
24  explicit ThemeInfo(const QString& theme);
25  ~ThemeInfo() = default;
26 
27  bool IsWide() const;
28  QString GetAspect() const { return m_aspect; }
29  const QSize *GetBaseRes() const { return &m_baseres; }
30  QString GetName() const { return m_name; }
31  QString GetBaseTheme() const { return m_baseTheme; }
32  QString GetDescription() const { return m_description; }
33  QString GetErrata() const { return m_errata; }
34  QString GetPreviewPath() const { return m_previewpath; }
35  int GetType() const { return m_type; }
36  int GetMajorVersion() const { return m_majorver; }
37  int GetMinorVersion() const { return m_minorver; }
38 
39  QString GetDownloadURL() const { return m_downloadurl; }
40  QString GetThemeWebSite() const { return m_themesite; }
41 
42  QString GetLocalURL() const { return m_themeurl; }
43  QString GetDirectoryName() const { return m_theme.fileName(); }
44 
45  void ToMap(InfoMap &infoMap) const;
46 
47  private:
48  bool parseThemeInfo();
49 
50  QString m_themeurl;
51  QFileInfo m_theme;
52  QString m_baseTheme;
53  int m_type {THEME_UNKN};
54  QString m_aspect;
55  QSize m_baseres {800,600};
56  QString m_name;
57  QString m_previewpath;
58  QString m_description;
59  QString m_errata;
60  int m_majorver {0};
61  int m_minorver {0};
62 
63  QString m_authorName;
64  QString m_authorEmail;
65 
66  QString m_downloadurl; // URL to download theme package from
67  QString m_themesite; // Theme's website
68 };
69 
71 
72 #endif
int GetMajorVersion() const
Definition: themeinfo.h:36
QString m_baseTheme
Definition: themeinfo.h:52
QString GetAspect() const
Definition: themeinfo.h:28
QString m_errata
Definition: themeinfo.h:59
QString GetThemeWebSite() const
Definition: themeinfo.h:40
QString m_name
Definition: themeinfo.h:56
QFileInfo m_theme
Definition: themeinfo.h:51
Q_DECLARE_METATYPE(GrabberScript *)
QString GetBaseTheme() const
Definition: themeinfo.h:31
QString GetName() const
Definition: themeinfo.h:30
QString m_themeurl
Definition: themeinfo.h:50
QString GetDescription() const
Definition: themeinfo.h:32
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
QString m_downloadurl
Definition: themeinfo.h:66
int GetMinorVersion() const
Definition: themeinfo.h:37
QString m_authorName
Definition: themeinfo.h:63
QString m_authorEmail
Definition: themeinfo.h:64
ThemeType
Definition: themeinfo.h:14
int GetType() const
Definition: themeinfo.h:35
QString GetDownloadURL() const
Definition: themeinfo.h:39
QString m_themesite
Definition: themeinfo.h:67
#define MUI_PUBLIC
Definition: mythuiexp.h:9
QString m_aspect
Definition: themeinfo.h:54
QString m_description
Definition: themeinfo.h:58
QString GetErrata() const
Definition: themeinfo.h:33
QString GetDirectoryName() const
Definition: themeinfo.h:43
const QSize * GetBaseRes() const
Definition: themeinfo.h:29
QString m_previewpath
Definition: themeinfo.h:57
QString GetLocalURL() const
Definition: themeinfo.h:42
QString GetPreviewPath() const
Definition: themeinfo.h:34