21 #ifndef CUTELEE_NODE_H
22 #define CUTELEE_NODE_H
27 #include "filterexpression.h"
28 #include "cutelee_templates_export.h"
29 #include "outputstream.h"
30 #include "safestring.h"
32 #include <QtCore/QStringList>
77 class CUTELEE_TEMPLATES_EXPORT
Node :
public QObject
86 explicit Node(QObject *parent = {});
104 virtual bool mustBeFirst()
123 TemplateImpl *containerTemplate()
const;
126 Q_DECLARE_PRIVATE(
Node)
147 class CUTELEE_TEMPLATES_EXPORT
NodeList :
public QList<Cutelee::Node *>
165 NodeList(
const QList<Cutelee::Node *> &list);
180 void append(
const QList<Cutelee::Node *> &nodeList);
185 bool containsNonText()
const;
193 QList<Cutelee::Node *>::const_iterator it;
194 const QList<Cutelee::Node *>::const_iterator first = constBegin();
195 const QList<Cutelee::Node *>::const_iterator last = constEnd();
196 for (it = first; it != last; ++it) {
197 T
object = qobject_cast<T>(*it);
201 children << (*it)->findChildren<T>();
212 bool m_containsNonText;
215 class AbstractNodeFactoryPrivate;
338 virtual void setEngine(
Engine *) {}
357 Q_INVOKABLE QStringList smartSplit(
const QString &str)
const;
366 QList<FilterExpression> getFilterExpressionList(
const QStringList &list,
Base class for all NodeFactories.
virtual Node * getNode(const QString &tagContent, Parser *p) const =0
The Context class holds the context to render a Template with.
Cutelee::Engine is the main entry point for creating Cutelee Templates.
A list of Nodes with some convenience API for rendering them.
QList< T > findChildren()
Base class for all nodes.
virtual void render(OutputStream *stream, Context *c) const =0
The OutputStream class is used to render templates to a QTextStream.
The Parser class processes a string template into a tree of nodes.
The Cutelee namespace holds all public Cutelee API.