ladybird/Userland/Libraries/LibWeb/Layout/ImageBox.h
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

38 lines
956 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/HTML/HTMLImageElement.h>
#include <LibWeb/Layout/ReplacedBox.h>
#include <LibWeb/Page/Frame.h>
namespace Web::Layout {
class ImageBox
: public ReplacedBox
, public Frame::ViewportClient {
public:
ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, const ImageLoader&);
virtual ~ImageBox() override;
virtual void prepare_for_replaced_layout() override;
virtual void paint(PaintContext&, PaintPhase) override;
const DOM::Element& dom_node() const { return static_cast<const DOM::Element&>(ReplacedBox::dom_node()); }
bool renders_as_alt_text() const;
private:
virtual void frame_did_set_viewport_rect(const Gfx::IntRect&) final;
int preferred_width() const;
int preferred_height() const;
const ImageLoader& m_image_loader;
};
}