Cutelee 6.1.0
engine.h
1/*
2 This file is part of the Cutelee template system.
3
4 Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either version
9 2.1 of the Licence, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef CUTELEE_ENGINE_H
22#define CUTELEE_ENGINE_H
23
24#include "template.h"
25#include "templateloader.h"
26
27namespace Cutelee
28{
30
31class EnginePrivate;
32
34
120class CUTELEE_TEMPLATES_EXPORT Engine : public QObject
121{
123public:
127 Engine(QObject *parent = nullptr);
128
132 ~Engine() override;
133
138
143 void addTemplateLoader(std::shared_ptr<AbstractTemplateLoader> loader);
144
153 void setPluginPaths(const QStringList &dirs);
154
158 void addPluginPath(const QString &dir);
159
163 void removePluginPath(const QString &dir);
164
168 QStringList pluginPaths() const;
169
182 std::pair<QString, QString> mediaUri(const QString &fileName) const;
183
190 Template loadByName(const QString &name) const;
191
198 Template newTemplate(const QString &content, const QString &name) const;
199
204
209 void addDefaultLibrary(const QString &libName);
210
215 void removeDefaultLibrary(const QString &libName);
216
225 bool smartTrimEnabled() const;
226
232 void setSmartTrimEnabled(bool enabled);
233
242 void insertLibrary(const QString &name, TagLibraryInterface *lib);
243
250 void insertDefaultLibrary(const QString &name, TagLibraryInterface *lib);
251
252#ifndef Q_QDOC
258 void loadDefaultLibraries();
259
268 TagLibraryInterface *loadLibrary(const QString &name);
269#endif
270
271private:
272 Q_DECLARE_PRIVATE(Engine)
273 EnginePrivate *const d_ptr;
274};
275}
276
277#endif
QList< std::shared_ptr< AbstractTemplateLoader > > templateLoaders()
Definition engine.cpp:62
QStringList pluginPaths() const
Definition engine.cpp:108
std::pair< QString, QString > mediaUri(const QString &fileName) const
Definition engine.cpp:74
void insertDefaultLibrary(const QString &name, TagLibraryInterface *lib)
Definition engine.cpp:231
Engine(QObject *parent=nullptr)
Definition engine.cpp:42
Template loadByName(const QString &name) const
Definition engine.cpp:370
void setPluginPaths(const QStringList &dirs)
Definition engine.cpp:87
void addPluginPath(const QString &dir)
Definition engine.cpp:93
void setSmartTrimEnabled(bool enabled)
Definition engine.cpp:400
void removeDefaultLibrary(const QString &libName)
Definition engine.cpp:126
QStringList defaultLibraries() const
Definition engine.cpp:114
Template newTemplate(const QString &content, const QString &name) const
Definition engine.cpp:391
bool smartTrimEnabled() const
Definition engine.cpp:406
void removePluginPath(const QString &dir)
Definition engine.cpp:102
void addTemplateLoader(std::shared_ptr< AbstractTemplateLoader > loader)
Definition engine.cpp:68
void insertLibrary(const QString &name, TagLibraryInterface *lib)
Definition engine.cpp:224
void addDefaultLibrary(const QString &libName)
Definition engine.cpp:120
The TagLibraryInterface returns available tags and filters from libraries.
The Template class is a tree of nodes which may be rendered.
Definition template.h:95
The Cutelee namespace holds all public Cutelee API.
Definition Mainpage.dox:8
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const