Plasma5Support

faviconprovider.h
1/*
2 SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe@kde.org>
3 SPDX-FileCopyrightText: 2008 Marco Martin <notmart@gmail.com>
4 SPDX-FileCopyrightText: 2013 Andrea Scarpino <scarpino@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <QObject>
12
13class QImage;
14
15/**
16 * This class provides a favicon for a given url
17 */
19{
21
22public:
23 /**
24 * Creates a new favicon provider.
25 *
26 * @param parent The parent object.
27 * @param url The provider URL.
28 */
30
31 /**
32 * Destroys the favicon provider.
33 */
34 ~FaviconProvider() override;
35
36 /**
37 * Returns the requested image.
38 *
39 * @note This method returns only a valid image after the
40 * finished() signal has been emitted.
41 */
42 QImage image() const;
43
44 /**
45 * Returns the identifier of the comic request (name + date).
46 */
47 QString identifier() const;
48
50 /**
51 * This signal is emitted whenever a request has been finished
52 * successfully.
53 *
54 * @param provider The provider which emitted the signal.
55 */
56 void finished(FaviconProvider *provider);
57
58 /**
59 * This signal is emitted whenever an error has occurred.
60 *
61 * @param provider The provider which emitted the signal.
62 */
63 void error(FaviconProvider *provider);
64
65private:
66 QString m_url;
67
68 class Private;
69 Private *const d;
70};
This class provides a favicon for a given url.
QString identifier() const
Returns the identifier of the comic request (name + date).
QImage image() const
Returns the requested image.
~FaviconProvider() override
Destroys the favicon provider.
FaviconProvider(QObject *parent, const QString &url)
Creates a new favicon provider.
void finished(FaviconProvider *provider)
This signal is emitted whenever a request has been finished successfully.
void error(FaviconProvider *provider)
This signal is emitted whenever an error has occurred.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.