ResourceProvider
struct · ferroui-base · v0.5.0
struct ResourceProvider
Base implementation for resource providers.
Members
TYPEto_refhas_resourcestry_get_resourceon_add_owneron_remove_ownerconstructconstruct_with_ownerownerowner_changedraise_resources_changedadd_ownerremove_owner
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ResourceProvider>
Returns a strong reference to this object.
has_resources
fn has_resources(self: &Self) -> bool
Whether the provider has resources.
try_get_resource
fn try_get_resource(self: &Self, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Option<ResourceValue>
Tries to find a resource within the provider.
on_add_owner
fn on_add_owner(self: &Self, owner: &ResourceHostRef)
Handles when the owner is added. The base method notifies the owner about its resources changing, if the provider has any.
on_remove_owner
fn on_remove_owner(self: &Self, owner: &ResourceHostRef)
Handles when the owner is removed. The base method notifies the owner about its resources changing, if the provider has any.
construct
fn construct() -> Self
Creates the class data of a provider without an owner.
construct_with_owner
fn construct_with_owner(owner: &ResourceHostRef) -> Self
Creates the class data of a provider that belongs to owner.
owner
fn owner(self: &Self) -> Option<ResourceHostRef>
The owner of the resource provider.
owner_changed
fn owner_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
Raised when the owner of the resource provider changes.
raise_resources_changed
fn raise_resources_changed(self: &Self)
Notifies the owner, if any, that the resources of the provider have changed.
add_owner
fn add_owner(self: &Self, owner: &ResourceHostRef)
Adds an owner to the resource provider.
remove_owner
fn remove_owner(self: &Self, owner: &ResourceHostRef)
Removes a resource provider owner.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceProviderImplExtFerroObjectImplExtClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyErasedDestructorIntoEitherDerefUpcast<T>Upcast<ResourceProvider>StaticTypeObjectTypeSubclassable<T>FerroObjectImplResourceProviderImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.