File indexing completed on 2024-12-01 12:41:51

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_RSS2_CATEGORY_H
0009 #define SYNDICATION_RSS2_CATEGORY_H
0010 
0011 #include <syndication/elementwrapper.h>
0012 
0013 class QDomElement;
0014 class QString;
0015 
0016 namespace Syndication
0017 {
0018 namespace RSS2
0019 {
0020 /**
0021  * A category which can be assigned to items or whole feeds.
0022  * These can be simple tags as known from delicious or Technorati, or
0023  * a category from a hierarchical taxonomy or ontology.
0024  *
0025  * @author Frank Osterfeld
0026  */
0027 class SYNDICATION_EXPORT Category : public ElementWrapper
0028 {
0029 public:
0030     /**
0031      * Creates a Category object wrapping a @c &lt;category> XML element.
0032      *
0033      * @param element The @c &lt;category> element to wrap
0034      */
0035     explicit Category(const QDomElement &element);
0036 
0037     /**
0038      * Default constructor, creates a null object, for which isNull() is
0039      * @c true.
0040      */
0041     Category();
0042 
0043     /**
0044      * Name of the category. This is both to be used as identifier and as
0045      * human-readable string. It can bea forward-slash-separated string
0046      * to identify a hierarchic location in the domain indicated by
0047      * domain(). Examples: "General", "Programming", "Funny",
0048      * "Books/History".
0049      *
0050      * @return The category identifier/name as string or a null string for
0051      * null objects.
0052      *
0053      */
0054     QString category() const;
0055 
0056     /**
0057      * optional, identifies the domain of the category, i.e. a
0058      * categorization taxonomy.
0059      *
0060      * @return The domain of the category, or a null string if none is set
0061      * (and for null objects)
0062      */
0063     QString domain() const;
0064 
0065     /**
0066      * Returns a description of the object for debugging purposes.
0067      *
0068      * @return debug string
0069      */
0070     QString debugInfo() const;
0071 };
0072 
0073 } // namespace RSS2
0074 } // namespace Syndication
0075 
0076 #endif // SYNDICATION_RSS2_CATEGORY_H