Syndication

rdf/item.h
1 /*
2  This file is part of the syndication library
3  SPDX-FileCopyrightText: 2006 Frank Osterfeld <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef SYNDICATION_RDF_ITEM_H
9 #define SYNDICATION_RDF_ITEM_H
10 
11 #include <syndication/rdf/document.h>
12 #include <syndication/rdf/resourcewrapper.h>
13 
14 #include <syndication/specificitem.h>
15 
16 class QString;
17 
18 namespace Syndication
19 {
20 class SpecificItemVisitor;
21 
22 namespace RDF
23 {
24 class DublinCore;
25 class Item;
26 
27 /**
28  * An RSS 1.0 item.
29  * (It is a convenience wrapper for the
30  * underlying RDF resource, which can be accessed via resource()).
31  *
32  * @author Frank Osterfeld
33  */
34 class SYNDICATION_EXPORT Item : public ResourceWrapper, public SpecificItem
35 {
36 public:
37  /**
38  * creates an item object wrapping a null resource, isNull() is
39  * @c true.
40  */
41  Item();
42 
43  /**
44  * Creates an item wrapping the given resource
45  * @param resource resource to wrap, should be of type
46  * of rss1:item, otherwise the wrapper will not return useful
47  * information.
48  * @param doc the document this item is part of. Used by Document
49  */
50  explicit Item(ResourcePtr resource, DocumentPtr doc = DocumentPtr());
51 
52  /**
53  * copies an item
54  *
55  * @param other item to copy
56  */
57  Item(const Item &other);
58 
59  /**
60  * virtual destructor
61  */
62  ~Item() override;
63 
64  /**
65  * assigns another item
66  *
67  * @param other the item to assign
68  */
69  Item &operator=(const Item &other);
70 
71  /**
72  * compares two item instances. Two instances are equal,
73  * if the wrapped resources are equal. See ResourceWrapper::operator==()
74  * for details.
75  *
76  * @param other the item to compare this item to
77  */
78  bool operator==(const Item &other) const;
79 
80  /**
81  * interface for item visitors. See SpecificItemVisitor for
82  * more information.
83  *
84  * @param visitor a visitor visiting this object
85  */
86  bool accept(SpecificItemVisitor *visitor) override;
87 
88  /**
89  * The item's title (required).
90  *
91  * @return The item's title as HTML, or a null string if not specified
92  */
93  QString title() const;
94 
95  /**
96  * A brief description/abstract of the item.
97  * if encodedContent() is not provided, this can also contain the full
98  * content.
99  *
100  * @return description as HTML, or a null string if not specified
101  */
102  QString description() const;
103 
104  /**
105  * The item's URL, usually pointing to a website containing the
106  * full content (news article, blog entry etc.).
107  *
108  * @return the link
109  */
110  QString link() const;
111 
112  /**
113  * returns a dublin core description of this
114  * item (including metadata such as item author
115  * or subject)
116  */
117  DublinCore dc() const;
118 
119  /**
120  * returns content (@c content:encoded) as HTML.
121  *
122  * @return content as HTML, or a null string if not specified
123  */
124  QString encodedContent() const;
125 
126  //@cond PRIVATE
127  /**
128  * @internal
129  * returns the title unmodified
130  * used by Document
131  */
132  QString originalTitle() const;
133 
134  /**
135  * @internal
136  * returns the description unmodified
137  * used by Document
138  */
139  QString originalDescription() const;
140 
141  //@endcond
142 
143  /**
144  * Returns a description of the item for debugging purposes.
145  *
146  * @return debug string
147  */
148  QString debugInfo() const;
149 
150 private:
151  class Private;
152  Private *const d;
153 };
154 
155 } // namespace RDF
156 } // namespace Syndication
157 
158 #endif // SYNDICATION_RDF_ITEM_H
KIOCORE_EXPORT CopyJob * link(const QList< QUrl > &src, const QUrl &destDir, JobFlags flags=DefaultFlags)
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:57:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.