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 enum ThemeType {
15  THEME_UNKN = 0x00,
16  THEME_UI = 0x01,
17  THEME_OSD = 0x02,
18  THEME_MENU = 0x04
19 };
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  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
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
ThemeInfo::m_themeurl
QString m_themeurl
Definition: themeinfo.h:50
ThemeInfo::m_name
QString m_name
Definition: themeinfo.h:56
ThemeInfo::GetErrata
QString GetErrata() const
Definition: themeinfo.h:33
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
ThemeInfo::GetAspect
QString GetAspect() const
Definition: themeinfo.h:28
THEME_OSD
@ THEME_OSD
Definition: themeinfo.h:17
XMLParseBase
Definition: xmlparsebase.h:23
ThemeInfo::m_errata
QString m_errata
Definition: themeinfo.h:59
ThemeInfo::GetMinorVersion
int GetMinorVersion() const
Definition: themeinfo.h:37
ThemeInfo::~ThemeInfo
~ThemeInfo()=default
ThemeInfo::GetDownloadURL
QString GetDownloadURL() const
Definition: themeinfo.h:39
THEME_UNKN
@ THEME_UNKN
Definition: themeinfo.h:15
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
ThemeInfo::GetDescription
QString GetDescription() const
Definition: themeinfo.h:32
ThemeInfo::GetName
QString GetName() const
Definition: themeinfo.h:30
ThemeInfo::GetLocalURL
QString GetLocalURL() const
Definition: themeinfo.h:42
ThemeInfo::m_previewpath
QString m_previewpath
Definition: themeinfo.h:57
mythtypes.h
ThemeInfo::GetPreviewPath
QString GetPreviewPath() const
Definition: themeinfo.h:34
ThemeInfo::GetBaseTheme
QString GetBaseTheme() const
Definition: themeinfo.h:31
ThemeInfo
Definition: themeinfo.h:22
xmlparsebase.h
ThemeType
ThemeType
Definition: themeinfo.h:14
ThemeInfo::GetBaseRes
QSize GetBaseRes() const
Definition: themeinfo.h:29
ThemeInfo::m_authorName
QString m_authorName
Definition: themeinfo.h:63
m_name
const char * m_name
Definition: ParseText.cpp:329
ThemeInfo::GetType
int GetType() const
Definition: themeinfo.h:35
THEME_MENU
@ THEME_MENU
Definition: themeinfo.h:18
ThemeInfo::m_aspect
QString m_aspect
Definition: themeinfo.h:54
ThemeInfo::GetMajorVersion
int GetMajorVersion() const
Definition: themeinfo.h:36
ThemeInfo::m_authorEmail
QString m_authorEmail
Definition: themeinfo.h:64
ThemeInfo::m_description
QString m_description
Definition: themeinfo.h:58
ThemeInfo::GetThemeWebSite
QString GetThemeWebSite() const
Definition: themeinfo.h:40
ThemeInfo::m_downloadurl
QString m_downloadurl
Definition: themeinfo.h:66
THEME_UI
@ THEME_UI
Definition: themeinfo.h:16
ThemeInfo::GetDirectoryName
QString GetDirectoryName() const
Definition: themeinfo.h:43
ThemeInfo::m_themesite
QString m_themesite
Definition: themeinfo.h:67
mythuiexp.h
ThemeInfo::m_baseTheme
QString m_baseTheme
Definition: themeinfo.h:52
ThemeInfo::m_theme
QFileInfo m_theme
Definition: themeinfo.h:51