File indexing completed on 2024-04-21 04:00:59

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_ATOM_TOOLS_H
0009 #define SYNDICATION_ATOM_TOOLS_H
0010 
0011 class QString;
0012 
0013 namespace Syndication
0014 {
0015 class ElementWrapper;
0016 
0017 namespace Atom
0018 {
0019 /**
0020  * extracts the content of an @c atomTextConstruct. An atomTextConstruct is an element containing
0021  * either plain text, escaped html, or embedded XHTML.
0022  *
0023  * TODO: examples
0024  *
0025  * @param parent the parent element to extract from. E.g. an atom:entry element.
0026  * @param tagname the child element of parent to extract from the text from.
0027  * Atom namespace is assumed. Example: &lt;atom:title>
0028  * @return the HTMLized version of the element content. If the content is
0029  * escaped HTML, the escaped markup is resolved. If it is XHTML, the XHTML
0030  * content is converted to a string. If it is plain text, characters like "&lt;", ">", "&amp;"
0031  * are escaped so the return string is valid HTML.
0032  */
0033 QString extractAtomText(const Syndication::ElementWrapper &parent, const QString &tagname);
0034 
0035 } // namespace Atom
0036 } // namespace Syndication
0037 
0038 #endif // SYNDICATION_ATOM_TOOLS_H