QtWebApp
templateloader.h
Go to the documentation of this file.
1 
6 #ifndef TEMPLATELOADER_H
7 #define TEMPLATELOADER_H
8 
9 #include <QString>
10 #include <QSettings>
11 #include <QTextCodec>
12 #include <QMutex>
13 #include "templateglobal.h"
14 #include "template.h"
15 
16 namespace stefanfrings {
17 
40 class DECLSPEC TemplateLoader : public QObject {
41  Q_OBJECT
42  Q_DISABLE_COPY(TemplateLoader)
43 public:
44 
50  TemplateLoader(const QSettings* settings, QObject* parent=nullptr);
51 
53  virtual ~TemplateLoader();
54 
64  Template getTemplate(const QString templateName, const QString locales=QString());
65 
66 protected:
67 
73  virtual QString tryFile(const QString localizedName);
74 
76  QString templatePath;
77 
79  QString fileNameSuffix;
80 
82  QTextCodec* textCodec;
83 };
84 
85 } // end of namespace
86 
87 #endif // TEMPLATELOADER_H
QString fileNameSuffix
Suffix to the filenames.
QString templatePath
Directory where the templates are searched.
QTextCodec * textCodec
Codec for decoding the files.
Enhanced version of QString for template processing.
Definition: template.h:92
Loads localized versions of template files.