KTextTemplate

rendercontext.h
1/*
2 This file is part of the KTextTemplate library
3
4 SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com>
5
6 SPDX-License-Identifier: LGPL-2.1-or-later
7
8*/
9
10#ifndef KTEXTTEMPLATE_RENDERCONTEXT_H
11#define KTEXTTEMPLATE_RENDERCONTEXT_H
12
13#include "ktexttemplate_export.h"
14
15#include <QVariantHash>
16
17/// @headerfile rendercontext.h <KTextTemplate/RenderContext>
18
19namespace KTextTemplate
20{
21
22class ContextPrivate;
23class TemplateImpl;
24class Node;
25
26class RenderContextPrivate;
27
28/**
29 @brief Provides storage facility for state while rendering a template.
30
31 This class can not be instatiated by users of it. An instance
32 of **%RenderContext** is available through Context::renderContext() for use
33 with implementations of re-entrant template tags.
34 */
35class KTEXTTEMPLATE_EXPORT RenderContext
36{
37public:
38 /**
39 Returns the data for the node @p scopeNode.
40 */
41 QVariant &data(const Node *const scopeNode);
42
43 /**
44 Returns whether the **%RenderContext** contains data for @p scopeNode.
45 */
46 bool contains(Node *const scopeNode) const;
47
48 /**
49 Destructor
50 */
52
53#ifndef K_DOXYGEN
54private:
56
57 void push();
58
59 void pop();
60
61private:
62 friend class ContextPrivate;
63 friend class TemplateImpl;
64
65 Q_DISABLE_COPY(RenderContext)
66 Q_DECLARE_PRIVATE(RenderContext)
67 RenderContextPrivate *const d_ptr;
68#endif
69};
70}
71
72#endif
Base class for all nodes.
Definition node.h:72
Provides storage facility for state while rendering a template.
The KTextTemplate namespace holds all public KTextTemplate API.
Definition Mainpage.dox:8
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.