Syndication

image.cpp
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#include "image.h"
9
10namespace Syndication
11{
13{
14}
15
17{
18 QString info = QLatin1String("# Image begin #####################\n");
19
20 QString durl = url();
21
22 if (!durl.isNull()) {
23 info += QLatin1String("url: #") + durl + QLatin1String("#\n");
24 }
25
26 QString dtitle = title();
27
28 if (!dtitle.isNull()) {
29 info += QLatin1String("title: #") + dtitle + QLatin1String("#\n");
30 }
31
32 QString dlink = link();
33
34 if (!dlink.isNull()) {
35 info += QLatin1String("link: #") + dlink + QLatin1String("#\n");
36 }
37
38 QString ddescription = description();
39
40 if (!ddescription.isNull()) {
41 info += QLatin1String("description: #") + ddescription + QLatin1String("#\n");
42 }
43
44 int dheight = height();
45 if (dheight > 0) {
46 info += QLatin1String("height: #") + QString::number(height()) + QLatin1String("#\n");
47 }
48
49 int dwidth = width();
50 if (dwidth > 0) {
51 info += QLatin1String("width: #") + QString::number(width()) + QLatin1String("#\n");
52 }
53 info += QLatin1String("# Image end #######################\n");
54
55 return info;
56}
57
58} // namespace Syndication
virtual QString debugInfo() const
returns a description of the image for debugging purposes
Definition image.cpp:16
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 ~Image()
destructor
Definition image.cpp:12
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...
bool isNull() const const
QString number(double n, char format, int precision)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.