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