/usr/include/syndication/item.h is in kdepimlibs5-dev 4:4.14.10-7+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | /*
* This file is part of the syndication library
*
* Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef SYNDICATION_ITEM_H
#define SYNDICATION_ITEM_H
#include <QtCore/QString>
#include <boost/shared_ptr.hpp>
#include "ksyndication_export.h"
#include <ctime>
class QDomElement;
template <class T> class QList;
template <class K, class T> class QMultiMap;
namespace Syndication {
//@cond PRIVATE
class Category;
typedef boost::shared_ptr<Category> CategoryPtr;
class Enclosure;
typedef boost::shared_ptr<Enclosure> EnclosurePtr;
class Item;
typedef boost::shared_ptr<Item> ItemPtr;
class Person;
typedef boost::shared_ptr<Person> PersonPtr;
class SpecificItem;
typedef boost::shared_ptr<SpecificItem> SpecificItemPtr;
//@endcond
/**
* An item from a news feed.
*
* @author Frank Osterfeld
*/
class SYNDICATION_EXPORT Item
{
public:
/**
* destructor
*/
virtual ~Item();
/**
* returns the format-specific item this object abstracts from.
* Use it if you need to access format-specifics that are not covered
* by this abstraction.
*
*/
virtual SpecificItemPtr specificItem() const = 0;
/**
* The title of the item.
*
* This string may contain HTML markup.(Importantly, occurrences of
* the characters <,'\n', '&', '\'' and '\"' are escaped).
*
* @return the title of the item as HTML, or a null string if not
* specified
*/
virtual QString title() const = 0;
/**
* returns a link to the (web) resource described by this item. In most
* cases, this will be a website containing the full article associated
* with this item.
*
* @return a URL, or a null string if not specified
*/
virtual QString link() const = 0;
/**
* returns the description of the item. The description can either be
* a tag line, a short summary of the item content up to a complete
* article. If content() is non-empty, it
*
* This string may contain HTML markup. (Importantly, occurrences of
* the characters <,'\n', '&', '\'' and '\"' are escaped).
*
* @return the description as HTML, or a null string if not specified
*/
virtual QString description() const = 0;
/**
* returns the content of the item. If provided, this is the most
* comprehensive text content available for this item. If it is empty,
* use description() (which might also contain complete article
* content).
*
* This string may contain HTML markup. (Importantly, occurrences of
* the characters <,'\n', '&', '\'' and '\"' are escaped).
*
* @return content string as HTML, or a null string if not set
*/
virtual QString content() const = 0;
/**
* returns the date when the item was initially published.
*
* @return publication date, as seconds since epoch (Jan 1st 1970), or 0
* (epoch) if not set
*/
virtual time_t datePublished() const = 0;
/**
* returns the date when the item was modified the last time. If no such
* date is provided by the feed, this method returns the value of
* datePublished().
*
* @return modification date, as seconds since epoch (Jan 1st 1970)
*/
virtual time_t dateUpdated() const = 0;
/**
* returns an identifier that identifies the item within its
* feed. The ID must be unique within its feed. If no ID is provided
* by the feed source, a hash from title, description and content is
* returned.
* Generated hash IDs start with "hash:".
*/
virtual QString id() const = 0;
/**
* returns a list of persons who created the item content. If there is a
* distinction between authors and contributors (Atom), both are added
* to the list, where authors are added first.
*
* @return list of authors (and possibly other contributing persons)
*/
virtual QList<PersonPtr> authors() const = 0;
/**
* returns the language used in the item's content
*
* @return TODO: tell about language codes and link them
*/
virtual QString language() const = 0;
/**
* returns a list of enclosures describing files available on the net.
* (often used for audio files, so-called "Podcasts").
*
* @return a list of enclosures associated with this item
*/
virtual QList<EnclosurePtr> enclosures() const = 0;
/**
* returns a list of categories this item is filed in.
* See Category for more information on categories.
*
* @return a list of categories
*/
virtual QList<CategoryPtr> categories() const = 0;
/**
* The number of comments posted for this item.
*
* @return the number of comments associated to this item, or -1 if not
* specified
*/
virtual int commentsCount() const = 0;
/**
* Link to an HTML site which contains the comments belonging to
* this item.
*
* @return URL to the comments page, or a null string if not set
*/
virtual QString commentsLink() const = 0;
/**
* URL of feed syndicating comments belonging to this item.
*
* @return comments feed URL, or a null string if not set
*/
virtual QString commentsFeed() const = 0;
/**
* URI that can be used to post comments via an HTTP POST request using
* the Comment API.
* For more details on the Comment API, see
* http://wellformedweb.org/story/9
*
* @return URI for posting comments, or a null string if not set
*/
virtual QString commentPostUri() const = 0;
/**
* returns a list of item metadata not covered by this class.
* Can be used e.g. to access format extensions.
*
* The returned map contains key value pairs, where the key
* is the tag name of the element, namespace prefix are resolved
* to the corresponding URIs. The value is the XML element as read
* from the document.
*
* For example, to access the <itunes:keywords> element, use
* additionalProperties()["http://www.itunes.com/dtds/podcast-1.0.dtdkeywords"].
*
* Currently this is only
* supported for RSS 0.91..0.94/2.0 and Atom formats, but not for RDF
* (RSS 0.9 and 1.0).
*/
virtual QMultiMap<QString, QDomElement> additionalProperties() const = 0;
/**
* returns a description of the item for debugging purposes
*
* @return debug string
*/
virtual QString debugInfo() const;
};
} // namespace Syndication
#endif // SYNDICATION_ITEM_H
|