File indexing completed on 2025-02-09 04:28:40
0001 /* 0002 This file is part of the KTextTemplate library 0003 0004 SPDX-FileCopyrightText: 2009, 2010 Stephen Kelly <steveire@gmail.com> 0005 0006 SPDX-License-Identifier: LGPL-2.1-or-later 0007 0008 */ 0009 0010 #ifndef KTEXTTEMPLATE_TOKEN_H 0011 #define KTEXTTEMPLATE_TOKEN_H 0012 0013 #include <QString> 0014 0015 namespace KTextTemplate 0016 { 0017 0018 /** 0019 @internal 0020 0021 The available token types. 0022 */ 0023 enum TokenType { 0024 TextToken, ///< The Token is a text fragment 0025 VariableToken, ///< The Token is a variable node 0026 BlockToken, ///< The Token is a block, ie, part of a tag 0027 CommentToken ///< The Token is a comment node. 0028 }; 0029 0030 /// @headerfile token.h <KTextTemplate/Token> 0031 0032 /** 0033 A token in a parse stream for a template. 0034 0035 This class is only relevant for template tag implementations. 0036 */ 0037 struct Token { 0038 int tokenType; ///< The Type of this Token 0039 int linenumber; ///< The line number this Token starts at 0040 QString content; ///< The content of this Token 0041 }; 0042 } 0043 0044 Q_DECLARE_TYPEINFO(KTextTemplate::Token, Q_RELOCATABLE_TYPE); 0045 0046 #endif