-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtemplates.h
39 lines (32 loc) · 1.02 KB
/
templates.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef EXAMPLES_H
#define EXAMPLES_H
#include <QList>
#include <QHash>
class Template
{
public:
Template() : Template("", "", "") { }
Template(const QString &name, const QString &text, const QString &url)
: m_name(name), m_logo(""), m_yaml(""), m_text(text), m_url(url)
{
}
QString name() const { return m_name; }
QString logo() const { return m_logo.isEmpty() ? m_name + ".png" : m_logo; }
void setLogo(QString logo) { m_logo = logo; }
QString yaml() const { return m_yaml.isEmpty() ? m_name + ".yaml" : m_yaml; }
void setYaml(QString yaml) { m_yaml = yaml; }
QString text() const { return m_text; }
void setText(QString text) { m_text = text; }
QString url() const { return m_url; }
void setUrl(QString url) { m_url = url; }
private:
QString m_name;
QString m_logo;
QString m_yaml;
QString m_text;
QString m_url;
};
typedef QList<Template> TemplateList;
typedef QHash<QString, Template> TemplateHash;
extern TemplateHash &getTemplates();
#endif // EXAMPLES_H