• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

syndication/rdf

  • syndication
  • rdf
rssvocab.cpp
1/*
2 * This file is part of the syndication library
3 *
4 * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#include "rssvocab.h"
24#include "property.h"
25
26#include <QtCore/QCoreApplication>
27#include <QtCore/QString>
28#include <QtCore/QStringList>
29
30namespace Syndication {
31namespace RDF {
32
33class RSSVocab::RSSVocabPrivate
34{
35 public:
36
37 QString namespaceURI;
38 PropertyPtr title;
39 PropertyPtr link;
40 PropertyPtr description;
41 PropertyPtr name;
42 PropertyPtr url;
43 PropertyPtr image;
44 ResourcePtr channel;
45 ResourcePtr item;
46 PropertyPtr items;
47 PropertyPtr textinput;
48
49 static RSSVocab *sSelf;
50 static void cleanupRSSVocab()
51 {
52 delete sSelf;
53 sSelf = 0;
54 }
55};
56RSSVocab *RSSVocab::RSSVocabPrivate::sSelf = 0;
57
58RSSVocab::RSSVocab() : d(new RSSVocabPrivate)
59{
60 QString ns = QLatin1String("http://purl.org/rss/1.0/");
61
62 d->namespaceURI = ns;
63
64 d->title = PropertyPtr( new Property(ns + QLatin1String("title")) );
65 d->link = PropertyPtr( new Property(ns + QLatin1String("link")) );
66 d->description = PropertyPtr( new Property(ns + QLatin1String("description")) );
67 d->name = PropertyPtr( new Property(ns + QLatin1String("name")) );
68 d->url = PropertyPtr( new Property(ns + QLatin1String("url")) );
69 d->image = PropertyPtr( new Property(ns + QLatin1String("image")) );
70 d->textinput = PropertyPtr( new Property(ns + QLatin1String("textinput")) );
71 d->items = PropertyPtr( new Property(ns + QLatin1String("items")) );
72 d->channel = ResourcePtr( new Resource(ns + QLatin1String("channel")) );
73 d->item = ResourcePtr( new Resource(ns + QLatin1String("item")) );
74}
75
76RSSVocab::~RSSVocab()
77{
78 delete d;
79}
80
81RSSVocab* RSSVocab::self()
82{
83 static RSSVocabPrivate p;
84 if(!p.sSelf) {
85 p.sSelf = new RSSVocab;
86 qAddPostRoutine(RSSVocabPrivate::cleanupRSSVocab);
87 }
88 return p.sSelf;
89}
90
91const QString& RSSVocab::namespaceURI() const
92{
93 return d->namespaceURI;
94}
95
96PropertyPtr RSSVocab::title() const
97{
98 return d->title;
99}
100
101PropertyPtr RSSVocab::description() const
102{
103 return d->description;
104}
105
106PropertyPtr RSSVocab::link() const
107{
108 return d->link;
109}
110
111PropertyPtr RSSVocab::name() const
112{
113 return d->name;
114}
115
116PropertyPtr RSSVocab::url() const
117{
118 return d->url;
119}
120
121PropertyPtr RSSVocab::image() const
122{
123 return d->image;
124}
125
126PropertyPtr RSSVocab::textinput() const
127{
128 return d->textinput;
129}
130
131
132PropertyPtr RSSVocab::items() const
133{
134 return d->items;
135}
136
137ResourcePtr RSSVocab::item() const
138{
139 return d->item;
140}
141
142ResourcePtr RSSVocab::channel() const
143{
144 return d->channel;
145}
146
147class RSS09Vocab::RSS09VocabPrivate
148{
149 public:
150
151 QString namespaceURI;
152 PropertyPtr title;
153 PropertyPtr link;
154 PropertyPtr description;
155 PropertyPtr name;
156 PropertyPtr url;
157 PropertyPtr image;
158 ResourcePtr channel;
159 ResourcePtr item;
160 PropertyPtr textinput;
161 QStringList properties;
162 QStringList classes;
163
164 static RSS09Vocab *sSelf;
165 static void cleanupRSS09Vocab()
166 {
167 delete sSelf;
168 sSelf = 0;
169 }
170};
171RSS09Vocab *RSS09Vocab::RSS09VocabPrivate::sSelf = 0;
172
173RSS09Vocab::RSS09Vocab() : d(new RSS09VocabPrivate)
174{
175 QString ns = QLatin1String("http://my.netscape.com/rdf/simple/0.9/");
176
177 d->namespaceURI = ns;
178
179 d->title = PropertyPtr( new Property(ns + QLatin1String("title")) );
180 d->properties.append(d->title->uri());
181 d->link = PropertyPtr( new Property(ns + QLatin1String("link")) );
182 d->properties.append(d->link->uri());
183 d->description = PropertyPtr( new Property(ns + QLatin1String("description")) );
184 d->properties.append(d->description->uri());
185 d->name = PropertyPtr( new Property(ns + QLatin1String("name")) );
186 d->properties.append(d->name->uri());
187 d->url = PropertyPtr( new Property(ns + QLatin1String("url")) );
188 d->properties.append(d->url->uri());
189 d->image = PropertyPtr( new Property(ns + QLatin1String("image")) );
190 d->properties.append(d->image->uri());
191 d->textinput = PropertyPtr( new Property(ns + QLatin1String("textinput")) );
192 d->properties.append(d->textinput->uri());
193 d->item = ResourcePtr( new Resource(ns + QLatin1String("item")) );
194 d->classes.append(d->item->uri());
195 d->channel = ResourcePtr( new Resource(ns + QLatin1String("channel")) );
196 d->classes.append(d->channel->uri());
197}
198
199RSS09Vocab::~RSS09Vocab()
200{
201 delete d;
202}
203
204RSS09Vocab* RSS09Vocab::self()
205{
206 if(!RSS09VocabPrivate::sSelf) {
207 RSS09VocabPrivate::sSelf = new RSS09Vocab;
208 qAddPostRoutine(RSS09VocabPrivate::cleanupRSS09Vocab);
209 }
210 return RSS09VocabPrivate::sSelf;
211}
212
213const QString& RSS09Vocab::namespaceURI() const
214{
215 return d->namespaceURI;
216}
217
218PropertyPtr RSS09Vocab::title() const
219{
220 return d->title;
221}
222
223PropertyPtr RSS09Vocab::description() const
224{
225 return d->description;
226}
227
228PropertyPtr RSS09Vocab::link() const
229{
230 return d->link;
231}
232
233PropertyPtr RSS09Vocab::name() const
234{
235 return d->name;
236}
237
238PropertyPtr RSS09Vocab::url() const
239{
240 return d->url;
241}
242
243PropertyPtr RSS09Vocab::image() const
244{
245 return d->image;
246}
247
248PropertyPtr RSS09Vocab::textinput() const
249{
250 return d->textinput;
251}
252
253ResourcePtr RSS09Vocab::item() const
254{
255 return d->item;
256}
257
258ResourcePtr RSS09Vocab::channel() const
259{
260 return d->channel;
261}
262
263QStringList RSS09Vocab::classes() const
264{
265 return d->classes;
266}
267
268QStringList RSS09Vocab::properties() const
269{
270 return d->properties;
271}
272
273} // namespace RDF
274} // namespace Syndication
Syndication::RDF::RSS09Vocab
Singleton holding RDF class and property constants of the RSS 0.9 vocabulary.
Definition rssvocab.h:146
Syndication::RDF::RSS09Vocab::namespaceURI
const QString & namespaceURI() const
namespace URI of the RSS 0.9 vocabulary, "http://web.resource.org/rss/0.9/"
Definition rssvocab.cpp:213
Syndication::RDF::RSS09Vocab::textinput
PropertyPtr textinput() const
RSS 0.9 textinput property, see Document::textinput() for more details.
Definition rssvocab.cpp:248
Syndication::RDF::RSS09Vocab::classes
QStringList classes() const
returns a list containing all URIs representing classes in this vocabulary
Definition rssvocab.cpp:263
Syndication::RDF::RSS09Vocab::name
PropertyPtr name() const
RSS 0.9 name property, see Document::name() for more details.
Definition rssvocab.cpp:233
Syndication::RDF::RSS09Vocab::item
ResourcePtr item() const
RSS 0.9 item class, see Document::items() for more details.
Definition rssvocab.cpp:253
Syndication::RDF::RSS09Vocab::channel
ResourcePtr channel() const
RSS 0.9 channel class, the instance is represented by Syndication::RDF::Document.
Definition rssvocab.cpp:258
Syndication::RDF::RSS09Vocab::~RSS09Vocab
~RSS09Vocab()
destructor
Definition rssvocab.cpp:199
Syndication::RDF::RSS09Vocab::description
PropertyPtr description() const
RSS 0.9 description property, see Document::description() for more details.
Definition rssvocab.cpp:223
Syndication::RDF::RSS09Vocab::properties
QStringList properties() const
returns a list containing all URIs representing properties in this vocabulary
Definition rssvocab.cpp:268
Syndication::RDF::RSS09Vocab::title
PropertyPtr title() const
RSS 0.9 title property, see Document::title() for more details.
Definition rssvocab.cpp:218
Syndication::RDF::RSS09Vocab::url
PropertyPtr url() const
RSS 0.9 url property, see Document::url() for more details.
Definition rssvocab.cpp:238
Syndication::RDF::RSS09Vocab::link
PropertyPtr link() const
RSS 0.9 link property, see Document::link() for more details.
Definition rssvocab.cpp:228
Syndication::RDF::RSS09Vocab::self
static RSS09Vocab * self()
returns the singleton instance
Definition rssvocab.cpp:204
Syndication::RDF::RSS09Vocab::image
PropertyPtr image() const
RSS 0.9 image property, see Document::image() for more details.
Definition rssvocab.cpp:243
Syndication::RDF::RSSVocab
Singleton holding RDF class and property constants of the RSS 1.0 vocabulary.
Definition rssvocab.h:52
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

syndication/rdf

Skip menu "syndication/rdf"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal