2
This file is part of the Grantlee template system.
4
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
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.
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.
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/>.
21
#ifndef GRANTLEE_ENGINE_P_H
22
#define GRANTLEE_ENGINE_P_H
26
#include "pluginpointer_p.h"
27
#include "taglibraryinterface.h"
34
class ScriptableTagLibrary;
36
class ScriptableLibraryContainer : public TagLibraryInterface
39
ScriptableLibraryContainer( QHash<QString, AbstractNodeFactory*> factories, QHash<QString, Filter *> filters )
40
: m_nodeFactories( factories ), m_filters( filters ) {
43
void setNodeFactories( const QHash<QString, AbstractNodeFactory*> factories )
45
m_nodeFactories = factories;
48
void setFilters( const QHash<QString, Filter*> filters )
53
// Warning: should only be called by Engine::loadDefaultLibraries
56
qDeleteAll( m_nodeFactories );
57
qDeleteAll( m_filters );
58
m_nodeFactories.clear();
62
QHash<QString, AbstractNodeFactory*> nodeFactories( const QString &name = QString() ) {
64
return m_nodeFactories;
67
QHash<QString, Filter*> filters( const QString &name = QString() ) {
73
QHash<QString, AbstractNodeFactory*> m_nodeFactories;
74
QHash<QString, Filter*> m_filters;
80
EnginePrivate( Engine *engine );
82
TagLibraryInterface* loadLibrary( const QString &name, uint minorVersion );
83
QString getScriptLibraryName( const QString &name, uint minorVersion ) const;
84
ScriptableLibraryContainer* loadScriptableLibrary( const QString &name, uint minorVersion );
85
PluginPointer<TagLibraryInterface> loadCppLibrary( const QString& name, uint minorVersion );
87
Q_DECLARE_PUBLIC( Engine )
90
QHash<QString, PluginPointer<TagLibraryInterface> > m_libraries;
91
QHash<QString, ScriptableLibraryContainer*> m_scriptableLibraries;
93
QList<AbstractTemplateLoader::Ptr> m_loaders;
94
QStringList m_pluginDirs;
95
QStringList m_defaultLibraries;
96
ScriptableTagLibrary *m_scriptableTagLibrary;