|
Grantlee
5.1.0
|
00001 /* 00002 This file is part of the Grantlee template system. 00003 00004 Copyright (c) 2009,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_VARIABLE_H 00022 #define GRANTLEE_VARIABLE_H 00023 00024 #include "grantlee_templates_export.h" 00025 00026 #include <QtCore/QVariant> 00027 00028 namespace Grantlee 00029 { 00030 class Context; 00031 00032 class VariablePrivate; 00033 00035 00053 class GRANTLEE_TEMPLATES_EXPORT Variable 00054 { 00055 public: 00059 Variable(); 00060 00064 explicit Variable(const QString &var); 00065 00069 Variable(const Variable &other); 00070 00074 ~Variable(); 00075 00079 Variable &operator=(const Variable &other); 00080 00084 bool isValid() const; 00085 00089 bool isTrue(Context *c) const; 00090 00094 QVariant resolve(Context *c) const; 00095 00105 bool isConstant() const; 00106 00111 bool isLocalized() const; 00112 00117 QVariant literal() const; 00118 00122 QStringList lookups() const; 00123 00124 private: 00125 Q_DECLARE_PRIVATE(Variable) 00126 VariablePrivate *const d_ptr; 00127 }; 00128 } 00129 00130 #endif
1.7.6.1