mirror-chatterino2/src/messages/ImageSet.hpp
nerix 1043f9f803
Remove Unnecessary Includes in Headers (#4275)
* refactor: remove unnecessary includes in headers

* fix: formatting

* chore: changelog

* fix: scrollbar

* fix: suggestions and old appbase remains

* fix: suggestion

* fix: missing Qt forward declarations

* fix: another qt include

* fix: includes for precompiled-headers=off

* Add missing `<memory>` includes

* Add missing `#pragma once`

* Fix tests

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2022-12-31 14:41:01 +00:00

43 lines
1.1 KiB
C++

#pragma once
#include "common/Aliases.hpp"
#include <memory>
namespace chatterino {
class Image;
using ImagePtr = std::shared_ptr<Image>;
ImagePtr getEmptyImagePtr();
class ImageSet
{
public:
ImageSet();
ImageSet(const ImagePtr &image1,
const ImagePtr &image2 = getEmptyImagePtr(),
const ImagePtr &image3 = getEmptyImagePtr());
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;
/// 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;
const ImagePtr &getImage(float scale) const;
bool operator==(const ImageSet &other) const;
bool operator!=(const ImageSet &other) const;
private:
ImagePtr imageX1_;
ImagePtr imageX2_;
ImagePtr imageX3_;
};
} // namespace chatterino