File indexing completed on 2024-04-14 03:58:29

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_RSS2_IMAGE_H
0009 #define SYNDICATION_RSS2_IMAGE_H
0010 
0011 #include <syndication/elementwrapper.h>
0012 
0013 class QDomElement;
0014 class QString;
0015 
0016 namespace Syndication
0017 {
0018 namespace RSS2
0019 {
0020 /**
0021  * An RSS2 image, used to describe feed logos.
0022  */
0023 class Image : public ElementWrapper
0024 {
0025 public:
0026     /**
0027      * Default constructor, creates a null object, for which isNull() is
0028      * @c true.
0029      */
0030     Image();
0031 
0032     /**
0033      * Creates an Image object wrapping an @c &lt;image> XML element.
0034      *
0035      * @param element The @c &lt;image> element to wrap
0036      */
0037     explicit Image(const QDomElement &element);
0038 
0039     /**
0040      * the URL of a GIF, JPEG or PNG image
0041      */
0042     QString url() const;
0043 
0044     /**
0045      * Describes the image, can be used in the ALT attribute of the
0046      * HTML @c &lt;img> tag when the channel is rendered in HTML.
0047      *
0048      * @return TODO: specify format
0049      */
0050     QString title() const;
0051 
0052     /**
0053      * The URL of the site, when the channel is rendered, the image should
0054      * be a link to the site.
0055      */
0056     QString link() const;
0057 
0058     /**
0059      * The width of the image. If the feed itself doesn't specify a width,
0060      * this method returns 88, the default value.
0061      *
0062      * @return image width in pixels.
0063      */
0064     uint width() const;
0065 
0066     /**
0067      * The height of the image. If the feed itself doesn't specify a height,
0068      * this method returns 31, the default value.
0069      *
0070      * @return image height in pixels.
0071      */
0072     uint height() const;
0073 
0074     /**
0075      * optional text that can be included in the TITLE attribute of the link
0076      * formed around the image in HTML rendering.
0077      *
0078      * @return TODO: specify format (HTML etc.)
0079      */
0080     QString description() const;
0081 
0082     /**
0083      * Returns a description of the object for debugging purposes.
0084      *
0085      * @return debug string
0086      */
0087     QString debugInfo() const;
0088 };
0089 
0090 } // namespace RSS2
0091 } // namespace Syndication
0092 
0093 #endif // SYNDICATION_RSS2_IMAGE_H