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 | typedef QSharedPointer<Image> ImagePtr; |
20 | |
21 | /*! |
22 | * \class Syndication::Image |
23 | * \inmodule Syndication |
24 | * \inheaderfile Syndication/Image |
25 | * |
26 | * \brief This class represents an image file on the web. |
27 | * |
28 | * It is usually some kind of feed logo which can be displayed when showing the |
29 | * feed description. |
30 | */ |
31 | class SYNDICATION_EXPORT Image |
32 | { |
33 | public: |
34 | virtual ~Image(); |
35 | |
36 | /*! |
37 | * returns whether this image is a null object. |
38 | */ |
39 | virtual bool isNull() const = 0; |
40 | |
41 | /*! |
42 | * the URL of a GIF, JPEG or PNG image |
43 | */ |
44 | virtual QString url() const = 0; |
45 | |
46 | /*! |
47 | * Describes the image, can be used in the ALT attribute of the |
48 | * HTML <img> tag when the channel is rendered in HTML. |
49 | */ |
50 | virtual QString title() const = 0; |
51 | |
52 | /*! |
53 | * The URL of the site, when the channel is rendered, the image should |
54 | * be a link to the site. If not set, use Feed::link(). |
55 | * |
56 | * Returns the url the rendered image should link to, or a null string |
57 | * if not specified in the feed. |
58 | */ |
59 | virtual QString link() const = 0; |
60 | |
61 | /*! |
62 | * optional text that can be included in the TITLE attribute of the link |
63 | * formed around the image in HTML rendering. |
64 | */ |
65 | virtual QString description() const = 0; |
66 | |
67 | /*! |
68 | * Returns the image width in pixels or 0 if not specified in the feed. |
69 | */ |
70 | virtual uint width() const = 0; |
71 | |
72 | /*! |
73 | * Returns the image height in pixels or 0 of not specified in the feed. |
74 | */ |
75 | virtual uint height() const = 0; |
76 | |
77 | /*! |
78 | * returns a description of the image for debugging purposes |
79 | */ |
80 | virtual QString debugInfo() const; |
81 | }; |
82 | |
83 | } // namespace Syndication |
84 | |
85 | #endif // SYNDICATION_IMAGE_H |
86 | |