1 | /* |
2 | This file is part of the syndication library |
3 | SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef SYNDICATION_IMAGE_H |
9 | #define SYNDICATION_IMAGE_H |
10 | |
11 | #include <QSharedPointer> |
12 | #include <QString> |
13 | |
14 | #include "syndication_export.h" |
15 | |
16 | namespace Syndication |
17 | { |
18 | class Image; |
19 | //@cond PRIVATE |
20 | typedef QSharedPointer<Image> ImagePtr; |
21 | //@endcond |
22 | |
23 | /** |
24 | * This class represents an image file on the web. |
25 | * It is usually some kind of feed logo which can be displayed when showing the |
26 | * feed description. |
27 | * |
28 | * @author Frank Osterfeld |
29 | */ |
30 | class SYNDICATION_EXPORT Image |
31 | { |
32 | public: |
33 | /** |
34 | * destructor |
35 | */ |
36 | virtual ~Image(); |
37 | |
38 | /** |
39 | * returns whether this image is a null object. |
40 | */ |
41 | virtual bool isNull() const = 0; |
42 | |
43 | /** |
44 | * the URL of a GIF, JPEG or PNG image |
45 | */ |
46 | virtual QString url() const = 0; |
47 | |
48 | /** |
49 | * Describes the image, can be used in the ALT attribute of the |
50 | * HTML <img> tag when the channel is rendered in HTML. |
51 | * |
52 | * @return TODO: specify format |
53 | */ |
54 | virtual QString title() const = 0; |
55 | |
56 | /** |
57 | * The URL of the site, when the channel is rendered, the image should |
58 | * be a link to the site. If not set, use Feed::link(). |
59 | * |
60 | * @return the url the rendered image should link to, or a null string |
61 | * if not specified in the feed. |
62 | */ |
63 | virtual QString link() const = 0; |
64 | |
65 | /** |
66 | * optional text that can be included in the TITLE attribute of the link |
67 | * formed around the image in HTML rendering. |
68 | * |
69 | * @return TODO: specify format (HTML etc.) |
70 | */ |
71 | virtual QString description() const = 0; |
72 | |
73 | /** |
74 | * The width of the image in pixels. |
75 | * |
76 | * @return image width in pixels or 0 if not specified in the feed. |
77 | */ |
78 | virtual uint width() const = 0; |
79 | |
80 | /** |
81 | * The height of the image in pixels |
82 | * |
83 | * @return image height in pixels or 0 of not specified in the feed. |
84 | */ |
85 | virtual uint height() const = 0; |
86 | |
87 | /** |
88 | * returns a description of the image for debugging purposes |
89 | * |
90 | * @return debug string |
91 | */ |
92 | virtual QString debugInfo() const; |
93 | }; |
94 | |
95 | } // namespace Syndication |
96 | |
97 | #endif // SYNDICATION_IMAGE_H |
98 | |