syndication/rdf
syndicationvocab.cpp
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 #include "syndicationvocab.h" 00024 #include "property.h" 00025 00026 #include <QtCore/QCoreApplication> 00027 #include <QtCore/QString> 00028 00029 namespace Syndication { 00030 namespace RDF { 00031 00032 class SyndicationVocab::SyndicationVocabPrivate 00033 { 00034 public: 00035 00036 QString namespaceURI; 00037 PropertyPtr updatePeriod; 00038 PropertyPtr updateFrequency; 00039 PropertyPtr updateBase; 00040 00041 static SyndicationVocab *sSelf; 00042 static void cleanupSyndicationVocab() 00043 { 00044 delete sSelf; 00045 sSelf = 0; 00046 } 00047 }; 00048 SyndicationVocab *SyndicationVocab::SyndicationVocabPrivate::sSelf = 0; 00049 00050 SyndicationVocab::SyndicationVocab() : d(new SyndicationVocabPrivate) 00051 { 00052 QString ns = QLatin1String("http://purl.org/rss/1.0/modules/syndication/"); 00053 00054 d->namespaceURI = ns; 00055 00056 d->updatePeriod = PropertyPtr( new Property(ns + QLatin1String("updatePeriod")) ); 00057 d->updateFrequency = PropertyPtr( new Property(ns + QLatin1String("updateFrequency")) ); 00058 d->updateBase = PropertyPtr( new Property(ns + QLatin1String("updateBase")) ); 00059 00060 } 00061 00062 SyndicationVocab::~SyndicationVocab() 00063 { 00064 delete d; 00065 } 00066 00067 SyndicationVocab* SyndicationVocab::self() 00068 { 00069 static SyndicationVocabPrivate p; 00070 if(!p.sSelf) { 00071 p.sSelf = new SyndicationVocab; 00072 qAddPostRoutine(SyndicationVocabPrivate::cleanupSyndicationVocab); 00073 } 00074 return p.sSelf; 00075 } 00076 00077 const QString& SyndicationVocab::namespaceURI() const 00078 { 00079 return d->namespaceURI; 00080 } 00081 00082 PropertyPtr SyndicationVocab::updatePeriod() const 00083 { 00084 return d->updatePeriod; 00085 } 00086 00087 PropertyPtr SyndicationVocab::updateFrequency() const 00088 { 00089 return d->updateFrequency; 00090 } 00091 00092 PropertyPtr SyndicationVocab::updateBase() const 00093 { 00094 return d->updateBase; 00095 } 00096 00097 } // namespace RDF 00098 } // namespace Syndication
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:53 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:53 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.