44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <LibGC/Cell.h>
|
|
#include <LibGfx/DecodedImageFrame.h>
|
|
#include <LibGfx/Size.h>
|
|
#include <LibWeb/Forward.h>
|
|
#include <LibWeb/PixelUnits.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
class ImageProvider {
|
|
public:
|
|
virtual ~ImageProvider() { }
|
|
|
|
virtual bool is_image_available() const = 0;
|
|
|
|
virtual size_t current_frame_index() const = 0;
|
|
|
|
virtual GC::Ptr<HTML::DecodedImageData> decoded_image_data() const = 0;
|
|
|
|
virtual Optional<CSSPixels> intrinsic_width() const = 0;
|
|
virtual Optional<CSSPixels> intrinsic_height() const = 0;
|
|
Optional<CSSPixelSize> intrinsic_size() const;
|
|
virtual Optional<CSSPixelFraction> intrinsic_aspect_ratio() const = 0;
|
|
|
|
virtual Optional<Gfx::DecodedImageFrame> current_image_frame() const;
|
|
virtual Optional<Gfx::DecodedImageFrame> current_image_frame_sized(Gfx::IntSize) const = 0;
|
|
|
|
virtual Optional<Gfx::DecodedImageFrame> default_image_frame_sized(Gfx::IntSize) const;
|
|
|
|
virtual void layout_node_was_detached() const { }
|
|
|
|
protected:
|
|
static void did_update_alt_text(ImageBox&);
|
|
};
|
|
|
|
}
|