Syndication

rdf/document.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_DOCUMENT_H
9 #define SYNDICATION_RDF_DOCUMENT_H
10 
11 #include <syndication/rdf/resourcewrapper.h>
12 
13 #include <syndication/specificdocument.h>
14 
15 template<class T>
16 class QList;
17 
18 namespace Syndication
19 {
20 namespace RDF
21 {
22 class Document;
23 class Model;
24 class DublinCore;
25 class Image;
26 class Item;
27 class SyndicationInfo;
28 class TextInput;
29 //@cond PRIVATE
30 typedef QSharedPointer<Document> DocumentPtr;
31 //@endcond
32 
33 /**
34  * Document implementation for RDF, representing an RSS 1.0 feed.
35  *
36  * @author Frank Osterfeld
37  */
38 class SYNDICATION_EXPORT Document : public Syndication::SpecificDocument, public ResourceWrapper
39 {
40  friend class ::Syndication::RDF::Model;
41 
42 public:
43  /**
44  * creates a wrapper wrapping a null resource
45  */
46  Document();
47 
48  /**
49  * creates a document by wrapping a channel resource
50  *
51  * @param resource the channel resource to wrap
52  */
53  explicit Document(ResourcePtr resource);
54 
55  /**
56  * creates a copy of another document
57  *
58  * @param other the document to copy
59  */
60  Document(const Document &other);
61 
62  /**
63  * destructor
64  */
65  ~Document() override;
66 
67  /**
68  * compares two documents. Two documents are equal if they wrap
69  * the same resource. See ResourceWrapper::operator==()
70  *
71  * @param other the document to compare to
72  */
73  bool operator==(const Document &other) const;
74 
75  /**
76  * assigns another document
77  *
78  * @param other the document to assign
79  */
80  Document &operator=(const Document &other);
81 
82  /**
83  * Used by visitors for double dispatch. See DocumentVisitor
84  * for more information.
85  * @param visitor the visitor calling the method
86  */
87  bool accept(DocumentVisitor *visitor) override;
88 
89  /**
90  * returns whether this document is valid or not.
91  * Invalid documents do not contain any useful
92  * information.
93  */
94  bool isValid() const override;
95 
96  /**
97  * title of the feed (required)
98  *
99  * @return feed title as TODO: define format
100  */
101  QString title() const;
102 
103  /**
104  * A brief description of the channel's content, function, source, etc.
105  *
106  * @return TODO: define format etc.
107  */
108  QString description() const;
109 
110  /**
111  * The URL to which an HTML rendering of the channel title will link,
112  * commonly the parent site's home or news page.
113  */
114  QString link() const;
115 
116  /**
117  * returns a dublin core description of the document.
118  */
119  DublinCore dc() const;
120 
121  /**
122  * returns syndication information describing how often this feed
123  * is updated.
124  */
125  SyndicationInfo syn() const;
126 
127  /**
128  * list of items contained in this feed
129  */
130  QList<Item> items() const;
131 
132  /**
133  * An image to be associated with an HTML rendering of the channel.
134  */
135  Image image() const;
136 
137  /**
138  * An optional text input element associated with the channel
139  */
140  TextInput textInput() const;
141  //@cond PRIVATE
142  /**
143  * @internal
144  * checks the format of titles and returns the results
145  *
146  * @param containsMarkup whether the heuristic found HTML markup in
147  * titles
148  */
149  void getItemTitleFormatInfo(bool *containsMarkup) const;
150 
151  /**
152  * @internal
153  * checks the format of descriptions and returns the results
154  *
155  * @param containsMarkup whether the heuristic found HTML markup in
156  * descriptions
157  */
158  void getItemDescriptionFormatInfo(bool *containsMarkup) const;
159  //@endcond PRIVATE
160 
161  /**
162  * Returns a description of the document for debugging purposes.
163  *
164  * @return debug string
165  */
166  QString debugInfo() const override;
167 
168 private:
169  class Private;
170  Private *const d;
171 };
172 
173 } // namespace RDF
174 } // namespace Syndication
175 
176 #endif // SYNDICATION_RDF_DOCUMENT_H
Wrapper to access syndication information for a feed.
Model
Definition: resource.h:38
A wrapper for RDF resources.
Visitor interface, following the Visitor design pattern.
Document interface for format-specific feed documents as parsed from a document source (see DocumentS...
An image to be associated with an HTML rendering of the channel.
Definition: rdf/image.h:26
"The textinput element affords a method for submitting form data to an arbitrary URL - usually locate...
Definition: rdf/textinput.h:25
A resource wrapper providing convenient access to Dublin Core metadata.
Definition: dublincore.h:35
Document implementation for RDF, representing an RSS 1.0 feed.
Definition: rdf/document.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue May 17 2022 03:54:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.