syndication/rdf
literal.h
00001 /* 00002 * This file is part of the syndication library 00003 * 00004 * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, 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 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #ifndef SYNDICATION_RDF_LITERAL_H 00024 #define SYNDICATION_RDF_LITERAL_H 00025 00026 #include <syndication/rdf/node.h> 00027 00028 #include <boost/shared_ptr.hpp> 00029 00030 namespace Syndication { 00031 namespace RDF { 00032 00033 class Literal; 00034 00035 //@cond PRIVATE 00036 typedef boost::shared_ptr<Literal> LiteralPtr; 00037 //@endcond 00038 00043 class SYNDICATION_EXPORT Literal : public Node 00044 { 00045 public: 00046 00050 Literal(); 00051 00057 Literal(const Literal& other); 00058 00064 explicit Literal(const QString& text); 00065 00069 virtual ~Literal(); 00070 00076 virtual Literal& operator=(const Literal& other); 00077 00082 virtual bool operator==(const Node& other) const; 00083 00087 virtual Literal* clone() const; 00088 00095 virtual void accept( NodeVisitor* visitor, NodePtr ptr); 00096 00100 virtual bool isNull() const; 00101 00106 virtual unsigned int id() const; 00107 00111 virtual bool isResource() const; 00115 virtual bool isProperty() const; 00116 00120 virtual bool isLiteral() const; 00121 00125 virtual bool isAnon() const; 00126 00130 virtual bool isSequence() const; 00131 00135 virtual operator QString() const; 00136 00140 virtual QString text() const; 00141 00146 virtual void setModel(const Model& model); 00147 00152 virtual void setId(unsigned int id); 00153 00154 private: 00155 class LiteralPrivate; 00156 typedef boost::shared_ptr<LiteralPrivate> LiteralPrivatePtr; 00157 LiteralPrivatePtr d; 00158 }; 00159 00160 00161 } // namespace RDF 00162 } // namespace Syndication 00163 00164 #endif // SYNDICATION_RDF_LITERAL_H