KIO

kurlpixmapprovider.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000 Carsten Pfeiffer <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KURLPIXMAPPROVIDER_H
9 #define KURLPIXMAPPROVIDER_H
10 
11 #include "kiowidgets_export.h"
12 #include <KPixmapProvider>
13 
14 /**
15  * @class KUrlPixmapProvider kurlpixmapprovider.h <KUrlPixmapProvider>
16  *
17  * Implementation of KPixmapProvider.
18  *
19  * Uses KMimeType::pixmapForURL() to resolve icons.
20  *
21  * Instantiate this class and supply it to the desired class, e.g.
22  * \code
23  * KHistoryComboBox *combo = new KHistoryComboBox(this);
24  * combo->setPixmapProvider(new KUrlPixmapProvider);
25  * [...]
26  * \endcode
27  *
28  * @short Resolves pixmaps for URLs
29  * @author Carsten Pfeiffer <[email protected]>
30  *
31  * @deprecated since 5.66, use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme
32  */
33 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 66) && KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 66)
34 
35 class KIOWIDGETS_EXPORT KUrlPixmapProvider : public KPixmapProvider
36 {
37 public:
38  /**
39  * Creates a new url pixmap provider.
40  */
41  KIOWIDGETS_DEPRECATED_VERSION(5, 66, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme")
43 
44  /**
45  * Destroys the url pixmap provider.
46  */
47  KIOWIDGETS_DEPRECATED_VERSION(5, 66, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme")
48  ~KUrlPixmapProvider() override;
49 
50  /**
51  * Returns a pixmap for @p url with size @p size.
52  *
53  * Uses KMimeType::pixmapForURL().
54  *
55  * @param url the URL to fetch a pixmap for
56  * @param size the size of the pixmap in pixels, or 0 for default.
57  * @return the resulting pixmap
58  * @see KIconLoader::StdSizes
59  */
60  KIOWIDGETS_DEPRECATED_VERSION(5, 66, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme")
61  QPixmap pixmapFor(const QString &url, int size = 0) override;
62 
63 protected:
64  void virtual_hook(int id, void *data) override;
65 
66 private:
67  class Private;
68  Private *const d;
69 };
70 
71 #endif
72 
73 #endif // KURLPIXMAPPROVIDER_H
Resolves pixmaps for URLs.
A namespace for KIO globals.
virtual QVariant get(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:20:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.