KTextTemplate::FileSystemTemplateLoader
#include <templateloader.h>
Public Member Functions | |
FileSystemTemplateLoader (const QSharedPointer< AbstractLocalizer > localizer={}) | |
~FileSystemTemplateLoader () override | |
bool | canLoadTemplate (const QString &name) const override |
std::pair< QString, QString > | getMediaUri (const QString &fileName) const override |
Template | loadByName (const QString &name, Engine const *engine) const override |
void | setTemplateDirs (const QStringList &dirs) |
void | setTheme (const QString &themeName) |
QStringList | templateDirs () const |
QString | themeName () const |
Public Member Functions inherited from KTextTemplate::AbstractTemplateLoader | |
virtual | ~AbstractTemplateLoader () |
Detailed Description
The FileSystemTemplateLoader loads Templates from the file system.
This template loader works by traversing a list of directories to find templates. Directories are checked in order, and the first match hit is parsed and returned.
Additionally, a themeName may be set on the template loader, which will be appended to search paths before the template name.
Media URIs may be retrieved for media relative to the directories searched queried for templates.
The template files loaded by a %**FileSystemTemplateLoader** must be UTF-8 encoded.
- See also
- Deploying Templates
Definition at line 124 of file templateloader.h.
Constructor & Destructor Documentation
◆ FileSystemTemplateLoader()
FileSystemTemplateLoader::FileSystemTemplateLoader | ( | const QSharedPointer< AbstractLocalizer > | localizer = {} | ) |
Constructor.
Definition at line 42 of file templateloader.cpp.
◆ ~FileSystemTemplateLoader()
|
override |
Destructor.
Definition at line 48 of file templateloader.cpp.
Member Function Documentation
◆ canLoadTemplate()
|
overridevirtual |
Return true if a Template identified by name
exists and can be loaded.
Implements KTextTemplate::AbstractTemplateLoader.
Definition at line 95 of file templateloader.cpp.
◆ getMediaUri()
|
overridevirtual |
Return a complete URI for media identified by fileName.
Implements KTextTemplate::AbstractTemplateLoader.
Definition at line 145 of file templateloader.cpp.
◆ loadByName()
|
overridevirtual |
Load a Template called name
.
Return an invalid Template if no content by that name exists.
Implements KTextTemplate::AbstractTemplateLoader.
Definition at line 116 of file templateloader.cpp.
◆ setTemplateDirs()
void FileSystemTemplateLoader::setTemplateDirs | ( | const QStringList & | dirs | ) |
Sets the directories to look for template files to dirs
.
Definition at line 78 of file templateloader.cpp.
◆ setTheme()
void FileSystemTemplateLoader::setTheme | ( | const QString & | themeName | ) |
Sets the theme of this loader to themeName
.
Definition at line 62 of file templateloader.cpp.
◆ templateDirs()
QStringList FileSystemTemplateLoader::templateDirs | ( | ) | const |
The directories this TemplateLoader looks in for template files.
Definition at line 89 of file templateloader.cpp.
◆ themeName()
QString FileSystemTemplateLoader::themeName | ( | ) | const |
The themeName of this TemplateLoader.
Definition at line 72 of file templateloader.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.