Grantlee 0.2.0
|
00001 /* 00002 This file is part of the Grantlee template system. 00003 00004 Copyright (c) 2010 Stephen Kelly <steveire@gmail.com> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either version 00009 2.1 of the Licence, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 #ifndef GRANTLEE_RENDERCONTEXT_H 00022 #define GRANTLEE_RENDERCONTEXT_H 00023 00024 #include "grantlee_core_export.h" 00025 00026 #include <QtCore/QVariantHash> 00027 00029 00030 namespace Grantlee 00031 { 00032 00033 class ContextPrivate; 00034 class TemplateImpl; 00035 class Node; 00036 00037 class RenderContextPrivate; 00038 00039 // ### BIC Rewrite this and Context in terms of a common base class. 00040 00047 class GRANTLEE_CORE_EXPORT RenderContext 00048 { 00049 public: 00053 QVariant& data( Node * const scopeNode ); 00054 00058 bool contains( Node * const scopeNode ) const; 00059 00063 ~RenderContext(); 00064 00065 #ifndef Q_QDOC 00066 private: 00067 RenderContext(); 00068 00069 void push(); 00070 00071 void pop(); 00072 00073 private: 00074 friend class ContextPrivate; 00075 friend class TemplateImpl; 00076 00077 Q_DISABLE_COPY( RenderContext ) 00078 Q_DECLARE_PRIVATE( RenderContext ) 00079 RenderContextPrivate * const d_ptr; 00080 #endif 00081 }; 00082 00083 } 00084 00085 #endif