Gravatar

gravatarcache.h
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "gravatar_export.h"
10
11#include <QPixmap>
12
13#include <memory>
14
15namespace Gravatar
16{
17class GravatarCachePrivate;
18class Hash;
19
20/** Cache for both positive and negative avatar lookups. */
21class GRAVATAR_EXPORT GravatarCache
22{
23public:
24 static GravatarCache *self();
25
28
29 void saveGravatarPixmap(const Hash &hash, const QPixmap &pixmap);
30 void saveMissingGravatar(const Hash &hash);
31
32 [[nodiscard]] QPixmap loadGravatarPixmap(const Hash &hash, bool &gravatarStored);
33
34 [[nodiscard]] int maximumSize() const;
35 void setMaximumSize(int maximumSize);
36
37 void clear();
38 void clearAllCache();
39
40private:
41 Q_DISABLE_COPY(GravatarCache)
42 std::unique_ptr<GravatarCachePrivate> const d;
43};
44}
Cache for both positive and negative avatar lookups.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.