_cef_view_delegate_t

Struct _cef_view_delegate_t 

Source
#[repr(C)]
pub struct _cef_view_delegate_t { pub base: cef_base_ref_counted_t, pub get_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>, pub get_minimum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>, pub get_maximum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>, pub get_height_for_width: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, width: c_int) -> c_int>, pub on_parent_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, parent: *mut _cef_view_t)>, pub on_child_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, child: *mut _cef_view_t)>, pub on_window_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int)>, pub on_layout_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, new_bounds: *const cef_rect_t)>, pub on_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>, pub on_blur: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>, pub on_theme_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>, }
Expand description

Implement this structure to handle view events. All size and position values are in density independent pixels (DIP) unless otherwise indicated. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.

NOTE: This struct is allocated client-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§get_preferred_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>

Return the preferred size for |view|. The Layout will use this information to determine the display size.

§get_minimum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>

Return the minimum size for |view|.

§get_maximum_size: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t) -> cef_size_t>

Return the maximum size for |view|.

§get_height_for_width: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, width: c_int) -> c_int>

Return the height necessary to display |view| with the provided |width|. If not specified the result of get_preferred_size().height will be used by default. Override if |view|’s preferred height depends upon the width (for example, with Labels).

§on_parent_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, parent: *mut _cef_view_t)>

Called when the parent of |view| has changed. If |view| is being added to |parent| then |added| will be true (1). If |view| is being removed from |parent| then |added| will be false (0). If |view| is being reparented the remove notification will be sent before the add notification. Do not modify the view hierarchy in this callback.

§on_child_view_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int, child: *mut _cef_view_t)>

Called when a child of |view| has changed. If |child| is being added to |view| then |added| will be true (1). If |child| is being removed from |view| then |added| will be false (0). If |child| is being reparented the remove notification will be sent to the old parent before the add notification is sent to the new parent. Do not modify the view hierarchy in this callback.

§on_window_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, added: c_int)>

Called when |view| is added or removed from the cef_window_t.

§on_layout_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t, new_bounds: *const cef_rect_t)>

Called when the layout of |view| has changed.

§on_focus: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>

Called when |view| gains focus.

§on_blur: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>

Called when |view| loses focus.

§on_theme_changed: Option<unsafe extern "C" fn(self_: *mut _cef_view_delegate_t, view: *mut _cef_view_t)>

Called when the theme for |view| has changed, after the new theme colors have already been applied. Views are notified via the component hierarchy in depth-first reverse order (children before parents).

This will be called in the following cases:

  1. When |view|, or a parent of |view|, is added to a Window. 2. When the native/OS or Chrome theme changes for the Window that contains |view|. See CefWindowDelegate::OnThemeColorsChanged documentation.
  2. When the client explicitly calls cef_window_t::ThemeChanged on the Window that contains |view|.

Optionally use this callback to override the new per-View theme colors by calling cef_view_t::SetBackgroundColor or the appropriate component- specific function. See cef_window_t::SetThemeColor documentation for how to customize additional Window theme colors.

Trait Implementations§

Source§

impl Clone for _cef_view_delegate_t

Source§

fn clone(&self) -> _cef_view_delegate_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_view_delegate_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_view_delegate_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.