| 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_IMAGE_H |
| 9 | #define |
| 10 | |
| 11 | #include <syndication/elementwrapper.h> |
| 12 | |
| 13 | class QDomElement; |
| 14 | class QString; |
| 15 | |
| 16 | namespace Syndication |
| 17 | { |
| 18 | namespace RSS2 |
| 19 | { |
| 20 | /*! |
| 21 | * An RSS2 image, used to describe feed logos. |
| 22 | */ |
| 23 | class : public ElementWrapper |
| 24 | { |
| 25 | public: |
| 26 | /*! |
| 27 | * Default constructor, creates a null object, for which isNull() is |
| 28 | * @c true. |
| 29 | */ |
| 30 | (); |
| 31 | |
| 32 | /*! |
| 33 | * Creates an Image object wrapping an @c <image> XML element. |
| 34 | * |
| 35 | * \a element The @c <image> element to wrap |
| 36 | */ |
| 37 | explicit (const QDomElement &element); |
| 38 | |
| 39 | /*! |
| 40 | * the URL of a GIF, JPEG or PNG image |
| 41 | */ |
| 42 | QString () const; |
| 43 | |
| 44 | /*! |
| 45 | * Describes the image, can be used in the ALT attribute of the |
| 46 | * HTML @c <img> tag when the channel is rendered in HTML. |
| 47 | * |
| 48 | * @return TODO: specify format |
| 49 | */ |
| 50 | QString () const; |
| 51 | |
| 52 | /*! |
| 53 | * The URL of the site, when the channel is rendered, the image should |
| 54 | * be a link to the site. |
| 55 | */ |
| 56 | QString () const; |
| 57 | |
| 58 | /*! |
| 59 | * The width of the image. If the feed itself doesn't specify a width, |
| 60 | * this method returns 88, the default value. |
| 61 | * |
| 62 | * @return image width in pixels. |
| 63 | */ |
| 64 | uint () const; |
| 65 | |
| 66 | /*! |
| 67 | * The height of the image. If the feed itself doesn't specify a height, |
| 68 | * this method returns 31, the default value. |
| 69 | * |
| 70 | * @return image height in pixels. |
| 71 | */ |
| 72 | uint () const; |
| 73 | |
| 74 | /*! |
| 75 | * optional text that can be included in the TITLE attribute of the link |
| 76 | * formed around the image in HTML rendering. |
| 77 | * |
| 78 | * @return TODO: specify format (HTML etc.) |
| 79 | */ |
| 80 | QString () const; |
| 81 | |
| 82 | /*! |
| 83 | * Returns a description of the object for debugging purposes. |
| 84 | * |
| 85 | * @return debug string |
| 86 | */ |
| 87 | QString () const; |
| 88 | }; |
| 89 | |
| 90 | } // namespace RSS2 |
| 91 | } // namespace Syndication |
| 92 | |
| 93 | #endif // SYNDICATION_RSS2_IMAGE_H |
| 94 | |