KGuiAddons

klocalimagecacheimpl.h
1/* This file is part of the KDE project.
2 SPDX-FileCopyrightText: 2010 Michael Pyne <mpyne@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef KLOCALIMAGECACHEIMPL_H
8#define KLOCALIMAGECACHEIMPL_H
9
10#include <kguiaddons_export.h>
11
12#include <memory>
13
14class KLocalImageCacheImplementationPrivate;
15
16class QImage;
17class QPixmap;
18class QByteArray;
19class QDateTime;
20class QString;
21
22/**
23 * You are not supposed to use this class directly, use KImageCache instead
24 *
25 * @internal
26 */
27class KGUIADDONS_EXPORT KLocalImageCacheImplementation
28{
29private:
30 explicit KLocalImageCacheImplementation(unsigned defaultCacheSize);
31
32public:
34
35 QDateTime lastModifiedTime() const;
36
37 bool pixmapCaching() const;
38 void setPixmapCaching(bool enable);
39
40 int pixmapCacheLimit() const;
41 void setPixmapCacheLimit(int size);
42
43protected:
44 void updateModifiedTime();
45 QByteArray serializeImage(const QImage &image) const;
46
47 bool insertLocalPixmap(const QString &key, const QPixmap &pixmap) const;
48 bool findLocalPixmap(const QString &key, QPixmap *destination) const;
49 void clearLocalCache();
50
51private:
52 std::unique_ptr<KLocalImageCacheImplementationPrivate> const d; ///< @internal
53
54 template<class T>
55 friend class KSharedPixmapCacheMixin;
56};
57
58#endif /* KLOCALIMAGECACHEIMPL_H */
You are not supposed to use this class directly, use KImageCache instead.
A simple wrapping layer over KSharedDataCache to support caching images and pixmaps.
Definition kimagecache.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.