1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef SYNDICATION_RSS2_ENCLOSURE_H
9#define SYNDICATION_RSS2_ENCLOSURE_H
10
11#include <syndication/elementwrapper.h>
12
13class QDomElement;
14class QString;
15
16namespace Syndication
17{
18namespace RSS2
19{
20/**
21 * Describes a media object that is "attached" to the item.
22 * The most common use case for enclosures are podcasts:
23 * An audio file is attached to the feed and can be
24 * automatically downloaded by a podcast client.
25 *
26 * @author Frank Osterfeld
27 */
28class Enclosure : public ElementWrapper
29{
30public:
31 /**
32 * Default constructor, creates a null object, for which isNull() is
33 * @c true.
34 */
35 Enclosure();
36
37 /**
38 * Creates an Enclosure object wrapping an @c &lt;enclosure> XML element.
39 *
40 * @param element The @c &lt;enclosure> element to wrap
41 */
42 explicit Enclosure(const QDomElement &element);
43
44 /**
45 * returns the URL of the enclosure
46 */
47 QString url() const;
48
49 /**
50 * returns the size of the enclosure in bytes
51 */
52 int length() const;
53
54 /**
55 * returns the mime type of the enclosure
56 * (e.g. "audio/mpeg")
57 */
58 QString type() const;
59
60 /**
61 * Returns a description of the object for debugging purposes.
62 *
63 * @return debug string
64 */
65 QString debugInfo() const;
66};
67
68} // namespace RSS2
69} // namespace Syndication
70
71#endif // SYNDICATION_RSS2_ENCLOSURE_H
72

source code of syndication/src/rss2/enclosure.h