pub struct PresentationEngine(/* private fields */);Expand description
State object responsible for the non-persistable/gui element state, including Themes, panel open state and realtive size, title, etc.
Implementations§
Source§impl Presentation
impl Presentation
pub fn new(elem: &HtmlElement) -> Self
pub fn is_visible(&self) -> bool
pub fn is_active(&self, elem: &Option<Element>) -> bool
pub fn reset_attached(&self)
pub fn get_is_workspace(&self) -> bool
pub fn set_settings_attribute(&self, opt: bool)
pub fn is_settings_open(&self) -> bool
pub fn set_settings_before_open(&self, open: bool)
pub fn set_settings_open(&self, open: bool)
Sourcepub fn set_open_column_settings(&self, settings: Option<OpenColumnSettings>)
pub fn set_open_column_settings(&self, settings: Option<OpenColumnSettings>)
Sets the currently opened column settings. Emits an internal event on change. Passing None is a shorthand for setting all fields to None.
Sourcepub fn get_open_column_settings(&self) -> OpenColumnSettings
pub fn get_open_column_settings(&self) -> OpenColumnSettings
Gets a clone of the current OpenColumnSettings.
Sourcepub async fn get_available_themes(&self) -> ApiResult<PtrEqRc<Vec<String>>>
pub async fn get_available_themes(&self) -> ApiResult<PtrEqRc<Vec<String>>>
Get the available theme names from the browser environment by parsing
readable stylesheets. This method is memoized - the state can be
flushed by calling reset().
Sourcepub async fn reset_available_themes(&self, themes: Option<Vec<String>>) -> bool
pub async fn reset_available_themes(&self, themes: Option<Vec<String>>) -> bool
Reset the state. styleSheets will be re-parsed next time
get_themes() is called if the themes argument is None.
§Returns
A bool indicating whether the internal state changed.
pub async fn get_selected_theme_config( &self, ) -> ApiResult<(PtrEqRc<Vec<String>>, Option<usize>)>
Sourcepub async fn get_selected_theme_name(&self) -> Option<String>
pub async fn get_selected_theme_name(&self) -> Option<String>
Returns the currently applied theme, or the default theme if no theme
has been set and themes are detected in the document, or None if
no themes are available.
pub async fn reset_theme(&self) -> ApiResult<()>
Sourcepub async fn set_theme_name(&self, theme: Option<&str>) -> ApiResult<bool>
pub async fn set_theme_name(&self, theme: Option<&str>) -> ApiResult<bool>
Set the theme by name, or None for the default theme.
§Returns
A bool indicating whether the internal state changed.
Sourcepub fn all_columns_configs(&self) -> HashMap<String, ColumnConfigValues>
pub fn all_columns_configs(&self) -> HashMap<String, ColumnConfigValues>
Returns an owned copy of the curent column configuration map.
pub fn reset_columns_configs(&self)
Sourcepub fn get_columns_config(
&self,
column_name: &str,
) -> Option<ColumnConfigValues>
pub fn get_columns_config( &self, column_name: &str, ) -> Option<ColumnConfigValues>
Gets a clone of the ColumnConfig for the given column name.
Sourcepub fn update_columns_configs(&self, update: ColumnConfigUpdate)
pub fn update_columns_configs(&self, update: ColumnConfigUpdate)
Updates the entire column config struct. (like from a restore() call)
pub fn update_columns_config_value( &self, column_name: String, update: ColumnConfigValueUpdate, )
Sourcepub fn to_props(
&self,
available_themes: PtrEqRc<Vec<String>>,
) -> PresentationProps
pub fn to_props( &self, available_themes: PtrEqRc<Vec<String>>, ) -> PresentationProps
Snapshot the current presentation state as a [PresentationProps]
value suitable for passing as a Yew prop. Called by the root component
whenever a presentation-related PubSub event fires.
available_themes must be provided by the caller because theme
detection is async and therefore not available synchronously here.
Trait Implementations§
Source§impl Clone for Presentation
impl Clone for Presentation
Source§fn clone(&self) -> Presentation
fn clone(&self) -> Presentation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Deref for Presentation
impl Deref for Presentation
Source§impl ImplicitClone for Presentation
impl ImplicitClone for Presentation
Source§fn implicit_clone(&self) -> Self
fn implicit_clone(&self) -> Self
Source§impl PartialEq for Presentation
impl PartialEq for Presentation
Auto Trait Implementations§
impl Freeze for Presentation
impl !RefUnwindSafe for Presentation
impl !Send for Presentation
impl !Sync for Presentation
impl Unpin for Presentation
impl UnsafeUnpin for Presentation
impl !UnwindSafe for Presentation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.