summaryrefslogtreecommitdiff
path: root/src/backend/managers/cdisplaytemplatemgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/managers/cdisplaytemplatemgr.h')
-rw-r--r--src/backend/managers/cdisplaytemplatemgr.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/backend/managers/cdisplaytemplatemgr.h b/src/backend/managers/cdisplaytemplatemgr.h
index 9b96e8b..a7b49e5 100644
--- a/src/backend/managers/cdisplaytemplatemgr.h
+++ b/src/backend/managers/cdisplaytemplatemgr.h
@@ -22,12 +22,15 @@ class CSwordModuleInfo;
\note This is a singleton.
*/
class CDisplayTemplateMgr {
+
public: /* Types: */
+
/**
Settings which are used to fill the content into the template.
*/
struct Settings {
- Settings() : pageDirection("ltr") {}
+
+ inline Settings() : pageDirection("ltr") {}
/** The list of modules */
QList<const CSwordModuleInfo*> modules;
@@ -43,6 +46,7 @@ class CDisplayTemplateMgr {
/** The CSS ID which is used in the content part of the page */
QString pageCSS_ID;
+
};
public: /* Methods: */
@@ -57,7 +61,7 @@ class CDisplayTemplateMgr {
\returns the list of available templates.
*/
inline const QStringList availableTemplates() const {
- return m_templateMap.keys();
+ return m_cssMap.keys();
}
/**
@@ -72,12 +76,18 @@ class CDisplayTemplateMgr {
\returns The full HTML template HTML code including the CSS data.
*/
- const QString fillTemplate( const QString& name, const QString& content, Settings& settings);
+ QString fillTemplate(const QString &name, const QString &content,
+ const Settings &settings);
/**
\returns the name of the default template.
*/
- inline static const char *defaultTemplate() { return "Blue.tmpl"; }
+ static inline const char * defaultTemplateName() { return "Blue.css"; }
+
+ /**
+ \returns the name of the active template.
+ */
+ static QString activeTemplateName();
/**
\returns The singleton instance of the instance of this class.
@@ -85,15 +95,20 @@ class CDisplayTemplateMgr {
static inline CDisplayTemplateMgr *instance() {
Q_ASSERT(m_instance != 0);
return m_instance;
- };
+ }
private: /* Methods: */
+
/** Preloads a single template from disk: */
void loadTemplate(const QString &filename);
+ void loadCSSTemplate(const QString &filename);
private: /* Fields: */
+
QMap<QString, QString> m_templateMap;
+ QMap<QString, QString> m_cssMap;
static CDisplayTemplateMgr *m_instance;
+
};
#endif