Syndication

enclosure.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_ENCLOSURE_H
9 #define SYNDICATION_ENCLOSURE_H
10 
11 #include "syndication_export.h"
12 
13 #include <QSharedPointer>
14 #include <QString>
15 
16 namespace Syndication
17 {
18 class Enclosure;
19 //@cond PRIVATE
20 typedef QSharedPointer<Enclosure> EnclosurePtr;
21 //@endcond
22 
23 /**
24  * An enclosure describes a (media) file available on the net.
25  *
26  * Most of the time, enclosures are used for "podcasts", i.e. audio
27  * files announced and distributed via syndication.
28  *
29  * @author Frank Osterfeld
30  */
31 class SYNDICATION_EXPORT Enclosure
32 {
33 public:
34  /**
35  * destructor
36  */
37  virtual ~Enclosure();
38 
39  /**
40  * returns whether this enclosure is a null object.
41  */
42  virtual bool isNull() const = 0;
43 
44  /**
45  * The URL of the linked resource (required).
46  */
47  virtual QString url() const = 0;
48 
49  /**
50  * title of the enclosure. This is a human-readable description of the
51  * linked file. If available, the title should be used in user interfaces
52  * instead of the URL. If no title is set (e.g., RSS2 enclosures don't
53  * have titles), use url() as fallback.
54  *
55  * @return title describing the enclosure, or a null string if not
56  * specified.
57  */
58  virtual QString title() const = 0;
59 
60  /**
61  * mimetype of the enclosure.
62  * TODO: link mimetype specs
63  *
64  * Examples are @c "audio/mpeg" for MP3, or @c "application/pdf" for
65  * PDF.
66  *
67  * @return the mimetype of the file, or a null string if not
68  * specified
69  */
70  virtual QString type() const = 0;
71 
72  /**
73  * returns the length of the linked file in bytes
74  *
75  * @return the length of the file in bytes, 0 if not specified
76  */
77  virtual uint length() const = 0;
78 
79  /**
80  * for audio/video files, the duration of the file in seconds
81  *
82  * @return the duration of the file in seconds, or 0 if not specified
83  */
84  virtual uint duration() const = 0;
85 
86  /**
87  * description of this enclosure for debugging purposes
88  *
89  * @return debug string
90  */
91  virtual QString debugInfo() const;
92 };
93 
94 } // namespace Syndication
95 
96 #endif // SYNDICATION_ENCLOSURE_H
An enclosure describes a (media) file available on the net.
Definition: enclosure.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:49:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.