14 #include <tdeio/job.h>
23 struct Image::Private :
public Shared
25 Private() :
height(31),
width(88), pixmapBuffer(NULL), job(NULL)
34 TQBuffer *pixmapBuffer;
51 if (!(elemText = extractNode(node, TQString::fromLatin1(
"title"))).isNull())
53 if (!(elemText = extractNode(node, TQString::fromLatin1(
"url"))).isNull())
55 if (!(elemText = extractNode(node, TQString::fromLatin1(
"link"))).isNull())
57 if (!(elemText = extractNode(node, TQString::fromLatin1(
"description"))).isNull())
58 d->description = elemText;
59 if (!(elemText = extractNode(node, TQString::fromLatin1(
"height"))).isNull())
60 d->height = elemText.toUInt();
61 if (!(elemText = extractNode(node, TQString::fromLatin1(
"width"))).isNull())
62 d->width = elemText.toUInt();
69 delete d->pixmapBuffer;
92 return d->description;
111 d->pixmapBuffer =
new TQBuffer;
112 d->pixmapBuffer->open(IO_WriteOnly);
114 d->job = TDEIO::get(d->url,
false,
false);
115 connect(d->job, TQ_SIGNAL(data(TDEIO::Job *,
const TQByteArray &)),
116 this, TQ_SLOT(slotData(TDEIO::Job *,
const TQByteArray &)));
117 connect(d->job, TQ_SIGNAL(result(TDEIO::Job *)),
this, TQ_SLOT(slotResult(TDEIO::Job *)));
120 void Image::slotData(TDEIO::Job *,
const TQByteArray &data)
122 d->pixmapBuffer->writeBlock(data.data(), data.size());
125 void Image::slotResult(TDEIO::Job *job)
129 pixmap = TQPixmap(d->pixmapBuffer->buffer());
132 delete d->pixmapBuffer;
133 d->pixmapBuffer = NULL;
147 if (
this != &other) {
158 return d->title == other.
title() &&
159 d->url == other.
url() &&
161 d->height == other.
height() &&
162 d->width == other.
width() &&
163 d->link == other.
link();