Syndication

image.h
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
16namespace Syndication
17{
18class Image;
19//@cond PRIVATE
20typedef 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 */
30class SYNDICATION_EXPORT Image
31{
32public:
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 &lt;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
This class represents an image file on the web.
Definition image.h:31
virtual uint width() const =0
The width of the image in pixels.
virtual uint height() const =0
The height of the image in pixels.
virtual QString link() const =0
The URL of the site, when the channel is rendered, the image should be a link to the site.
virtual QString title() const =0
Describes the image, can be used in the ALT attribute of the HTML <img> tag when the channel is rende...
virtual QString url() const =0
the URL of a GIF, JPEG or PNG image
virtual QString description() const =0
optional text that can be included in the TITLE attribute of the link formed around the image in HTML...
virtual bool isNull() const =0
returns whether this image is a null object.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.