2018-08-02 14:23:27 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-12-31 15:41:01 +01:00
|
|
|
#include "common/Aliases.hpp"
|
|
|
|
|
|
|
|
#include <memory>
|
2018-08-02 14:23:27 +02:00
|
|
|
|
2024-09-28 12:40:15 +02:00
|
|
|
class QJsonObject;
|
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
2022-12-31 15:41:01 +01:00
|
|
|
class Image;
|
|
|
|
using ImagePtr = std::shared_ptr<Image>;
|
|
|
|
ImagePtr getEmptyImagePtr();
|
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
class ImageSet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ImageSet();
|
2022-12-31 15:41:01 +01:00
|
|
|
ImageSet(const ImagePtr &image1,
|
|
|
|
const ImagePtr &image2 = getEmptyImagePtr(),
|
|
|
|
const ImagePtr &image3 = getEmptyImagePtr());
|
2018-08-02 14:23:27 +02:00
|
|
|
ImageSet(const Url &image1, const Url &image2 = {}, const Url &image3 = {});
|
|
|
|
|
|
|
|
void setImage1(const ImagePtr &image);
|
|
|
|
void setImage2(const ImagePtr &image);
|
|
|
|
void setImage3(const ImagePtr &image);
|
|
|
|
const ImagePtr &getImage1() const;
|
|
|
|
const ImagePtr &getImage2() const;
|
|
|
|
const ImagePtr &getImage3() const;
|
|
|
|
|
2019-08-21 01:44:19 +02:00
|
|
|
/// Preferes getting an already loaded image, even if it is smaller/bigger.
|
|
|
|
/// However, it starts loading the proper image.
|
|
|
|
const ImagePtr &getImageOrLoaded(float scale) const;
|
2018-08-02 14:23:27 +02:00
|
|
|
const ImagePtr &getImage(float scale) const;
|
|
|
|
|
|
|
|
bool operator==(const ImageSet &other) const;
|
|
|
|
bool operator!=(const ImageSet &other) const;
|
|
|
|
|
2024-09-28 12:40:15 +02:00
|
|
|
QJsonObject toJson() const;
|
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
private:
|
|
|
|
ImagePtr imageX1_;
|
|
|
|
ImagePtr imageX2_;
|
|
|
|
ImagePtr imageX3_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|