Nui
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Nui::WebApi::ResizeObserver Class Reference

A resize observer class, used for observing resize events on elements. More...

#include <resize_observer.hpp>

Inheritance diagram for Nui::WebApi::ResizeObserver:
Inheritance graph
[legend]
Collaboration diagram for Nui::WebApi::ResizeObserver:
Collaboration graph
[legend]

Classes

struct  ObserveOptions
 

Public Member Functions

 ResizeObserver (std::function< void(std::vector< ResizeObserverEntry > const &, ResizeObserver const &)> callback)
 
 ResizeObserver (Nui::val event)
 
void disconnect () const
 The disconnect() method of the ResizeObserver interface unobserves all observed Element or SVGElement targets.
 
void observe (Nui::val target) const
 The observe() method of the ResizeObserver interface starts observing the specified Element or SVGElement.
 
void observe (Nui::val target, ObserveOptions const &options) const
 The observe() method of the ResizeObserver interface starts observing the specified Element or SVGElement.
 
void unobserve (Nui::val target) const
 The unobserve() method of the ResizeObserver interface ends the observing of a specified Element or SVGElement.
 
- Public Member Functions inherited from Nui::ValWrapper
 ValWrapper (Nui::val valObject)
 
virtual ~ValWrapper ()=default
 
 ValWrapper (ValWrapper const &)=default
 
 ValWrapper (ValWrapper &&) noexcept=default
 
ValWrapperoperator= (ValWrapper const &)=default
 
ValWrapperoperator= (ValWrapper &&) noexcept=default
 
Nui::val const & val () const &noexcept
 
Nui::val val () &&noexcept
 
 operator Nui::val const & () const &noexcept
 
 operator Nui::val () &&noexcept
 

Additional Inherited Members

- Protected Attributes inherited from Nui::ValWrapper
Nui::val val_
 

Detailed Description

A resize observer class, used for observing resize events on elements.

See also
https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver

Constructor & Destructor Documentation

◆ ResizeObserver() [1/2]

Nui::WebApi::ResizeObserver::ResizeObserver ( std::function< void(std::vector< ResizeObserverEntry > const &, ResizeObserver const &)>  callback)
explicit

◆ ResizeObserver() [2/2]

Nui::WebApi::ResizeObserver::ResizeObserver ( Nui::val  event)
explicit

Member Function Documentation

◆ disconnect()

void Nui::WebApi::ResizeObserver::disconnect ( ) const

The disconnect() method of the ResizeObserver interface unobserves all observed Element or SVGElement targets.

◆ observe() [1/2]

void Nui::WebApi::ResizeObserver::observe ( Nui::val  target) const

The observe() method of the ResizeObserver interface starts observing the specified Element or SVGElement.

◆ observe() [2/2]

void Nui::WebApi::ResizeObserver::observe ( Nui::val  target,
ObserveOptions const &  options 
) const

The observe() method of the ResizeObserver interface starts observing the specified Element or SVGElement.

Parameters
optionsAn options object allowing you to set options for the observation. Currently this only has one possible option that can be set: box Sets which box model the observer will observe changes to. Possible values are: content-box (the default) Size of the content area as defined in CSS. border-box Size of the box border area as defined in CSS. device-pixel-content-box The size of the content area as defined in CSS, in device pixels, before applying any CSS transforms on the element or its ancestors.

◆ unobserve()

void Nui::WebApi::ResizeObserver::unobserve ( Nui::val  target) const

The unobserve() method of the ResizeObserver interface ends the observing of a specified Element or SVGElement.

Parameters
target

The documentation for this class was generated from the following files: