Cockatrice/cockatrice/src/picture_loader/picture_loader.h
BruebachL 835e4af3e4
[Documentation] Add a doxy group for the PictureLoader. (#6204)
* Add a doxy group for the PictureLoader.

Took 26 minutes

* Linting is a fun activity for children and adults of all ages and sizes.

Took 5 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-10-01 11:45:56 +02:00

58 lines
1.5 KiB
C++

/**
* @file picture_loader.h
* @ingroup PictureLoader
* @brief TODO: Document this.
*/
#ifndef PICTURELOADER_H
#define PICTURELOADER_H
#include "../card/card_info.h"
#include "picture_loader_status_bar.h"
#include "picture_loader_worker.h"
#include <QLoggingCategory>
inline Q_LOGGING_CATEGORY(PictureLoaderLog, "picture_loader");
inline Q_LOGGING_CATEGORY(PictureLoaderCardBackCacheFailLog, "picture_loader.card_back_cache_fail");
class PictureLoader : public QObject
{
Q_OBJECT
public:
static PictureLoader &getInstance()
{
static PictureLoader instance;
return instance;
}
private:
explicit PictureLoader();
~PictureLoader() override;
// Singleton - Don't implement copy constructor and assign operator
PictureLoader(PictureLoader const &);
void operator=(PictureLoader const &);
PictureLoaderWorker *worker;
PictureLoaderStatusBar *statusBar;
public:
static void getPixmap(QPixmap &pixmap, const ExactCard &card, QSize size);
static void getCardBackPixmap(QPixmap &pixmap, QSize size);
static void getCardBackLoadingInProgressPixmap(QPixmap &pixmap, QSize size);
static void getCardBackLoadingFailedPixmap(QPixmap &pixmap, QSize size);
static void clearPixmapCache();
static void cacheCardPixmaps(const QList<ExactCard> &cards);
static bool hasCustomArt();
public slots:
static void clearNetworkCache();
private slots:
void picDownloadChanged();
void picsPathChanged();
public slots:
void imageLoaded(const ExactCard &card, const QImage &image);
};
#endif