21 #ifndef GRANTLEE_ENGINE_H 22 #define GRANTLEE_ENGINE_H 25 #include "templateloader.h" 29 class TagLibraryInterface;
123 class GRANTLEE_TEMPLATES_EXPORT
Engine :
public QObject
130 Engine(QObject *parent = 0);
140 QList<QSharedPointer<AbstractTemplateLoader>> templateLoaders();
145 void addTemplateLoader(QSharedPointer<AbstractTemplateLoader> loader);
155 void setPluginPaths(
const QStringList &dirs);
160 void addPluginPath(
const QString &dir);
165 void removePluginPath(
const QString &dir);
170 QStringList pluginPaths()
const;
185 QPair<QString, QString> mediaUri(
const QString &fileName)
const;
193 Template loadByName(
const QString &name)
const;
202 Template newTemplate(
const QString &content,
const QString &name)
const;
207 QStringList defaultLibraries()
const;
213 void addDefaultLibrary(
const QString &libName);
220 void removeDefaultLibrary(
const QString &libName);
230 bool smartTrimEnabled()
const;
237 void setSmartTrimEnabled(
bool enabled);
245 void loadDefaultLibraries();
260 EnginePrivate *
const d_ptr;
The Template class is a tree of nodes which may be rendered.
The TagLibraryInterface returns available tags and filters from libraries.
The Grantlee namespace holds all public Grantlee API.
Grantlee::Engine is the main entry point for creating Grantlee Templates.