KTextTemplate
templateloader.cpp
28 FileSystemTemplateLoaderPrivate(FileSystemTemplateLoader *loader, QSharedPointer<AbstractLocalizer> localizer)
105 file.setFileName(d->m_templateDirs.at(i) + QLatin1Char('/') + d->m_themeName + QLatin1Char('/') + name);
116Template FileSystemTemplateLoader::loadByName(const QString &fileName, Engine const *engine) const
126 file.setFileName(d->m_templateDirs.at(i) + QLatin1Char('/') + d->m_themeName + QLatin1Char('/') + fileName);
129 if (file.exists() && !fi.canonicalFilePath().contains(QDir(d->m_templateDirs.at(i)).canonicalPath()))
154 file.setFileName(d->m_templateDirs.at(i) + QLatin1Char('/') + d->m_themeName + QLatin1Char('/') + fileName);
188 throw KTextTemplate::Exception(TagSyntaxError, QStringLiteral("Couldn't load template %1. Template does not exist.").arg(name));
Interface for implementing an internationalization system.
Definition abstractlocalizer.h:35
An retrieval interface to a storage location for Template objects.
Definition templateloader.h:38
virtual ~AbstractTemplateLoader()
Destructor.
KTextTemplate::Engine is the main entry point for creating KTextTemplate Templates.
Definition engine.h:110
Template newTemplate(const QString &content, const QString &name) const
Create a new Template with the content content identified by name.
Definition engine.cpp:332
An exception for use when implementing template tags.
Definition exception.h:74
The FileSystemTemplateLoader loads Templates from the file system.
Definition templateloader.h:125
Template loadByName(const QString &name, Engine const *engine) const override
Load a Template called name.
Definition templateloader.cpp:116
FileSystemTemplateLoader(const QSharedPointer< AbstractLocalizer > localizer={})
Constructor.
Definition templateloader.cpp:42
void setTheme(const QString &themeName)
Sets the theme of this loader to themeName.
Definition templateloader.cpp:62
bool canLoadTemplate(const QString &name) const override
Return true if a Template identified by name exists and can be loaded.
Definition templateloader.cpp:95
QStringList templateDirs() const
The directories this TemplateLoader looks in for template files.
Definition templateloader.cpp:89
void setTemplateDirs(const QStringList &dirs)
Sets the directories to look for template files to dirs.
Definition templateloader.cpp:78
std::pair< QString, QString > getMediaUri(const QString &fileName) const override
Return a complete URI for media identified by fileName.
Definition templateloader.cpp:145
bool canLoadTemplate(const QString &name) const override
Return true if a Template identified by name exists and can be loaded.
Definition templateloader.cpp:177
void setTemplate(const QString &name, const QString &content)
Add a template content to this Loader.
Definition templateloader.cpp:172
std::pair< QString, QString > getMediaUri(const QString &fileName) const override
Return a complete URI for media identified by fileName.
Definition templateloader.cpp:191
Template loadByName(const QString &name, Engine const *engine) const override
Load a Template called name.
Definition templateloader.cpp:182
The Template class is a tree of nodes which may be rendered.
Definition template.h:85
The KTextTemplate namespace holds all public KTextTemplate API.
Definition Mainpage.dox:8
QString canonicalPath() const const
bool exists(const QString &fileName)
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
void setFileName(const QString &name)
virtual void close() override
QString absoluteFilePath() const const
QString canonicalFilePath() const const
const_iterator constEnd() const const
const_iterator constFind(const Key &key) const const
bool contains(const Key &key) const const
iterator insert(const Key &key, const T &value)
ReadOnly
void chop(qsizetype n)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
qsizetype size() const const
QString readAll()
void setEncoding(QStringConverter::Encoding encoding)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.