File indexing completed on 2024-07-21 03:46:02

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_RDF_PROPERTY_H
0009 #define SYNDICATION_RDF_PROPERTY_H
0010 
0011 #include <syndication/rdf/resource.h>
0012 
0013 class QString;
0014 
0015 namespace Syndication
0016 {
0017 namespace RDF
0018 {
0019 //@cond PRIVATE
0020 class Property;
0021 typedef QSharedPointer<Property> PropertyPtr;
0022 //@endcond
0023 
0024 /**
0025  * a property is node type that represents properties of things,
0026  * like "name" is a property of a person, or "color" is a property of e.g.
0027  * a car. Properties can be used as predicates in statements.
0028  *
0029  * @author Frank Osterfeld
0030  */
0031 class Property : public Resource
0032 {
0033 public:
0034     /**
0035      * creates a null property
0036      */
0037     Property();
0038 
0039     /**
0040      * creates a property with a given URI
0041      *
0042      * @param uri the URI of the property
0043      */
0044     explicit Property(const QString &uri);
0045 
0046     /**
0047      * destructor
0048      */
0049     ~Property() override;
0050 
0051     /**
0052      * Used by visitors for double dispatch. See NodeVisitor
0053      * for more information.
0054      * @param visitor the visitor calling the method
0055      * @param ptr a shared pointer object for this node
0056      */
0057     void accept(NodeVisitor *visitor, NodePtr ptr) override;
0058 
0059     /**
0060      * returns true for properties
0061      */
0062     bool isProperty() const override;
0063 
0064     /**
0065      * creates a copy of the property object
0066      */
0067     Property *clone() const override;
0068 };
0069 
0070 } // namespace RDF
0071 } // namespace Syndication
0072 
0073 #endif // SYNDICATION_RDF_PROPERTY_H