pub struct SelectionService { /* private fields */ }Expand description
Selection service for managing drawing selection state
Implementations§
Source§impl SelectionService
impl SelectionService
Sourcepub fn select(&mut self, id: usize) -> bool
pub fn select(&mut self, id: usize) -> bool
Select a single drawing (deselects all others unless multi-select is active)
Returns true if selection changed.
Sourcepub fn toggle(&mut self, id: usize) -> bool
pub fn toggle(&mut self, id: usize) -> bool
Toggle selection of a drawing (for Ctrl+click behavior)
Returns true if selection changed.
Sourcepub fn deselect(&mut self, id: usize) -> bool
pub fn deselect(&mut self, id: usize) -> bool
Deselect a specific drawing
Returns true if the drawing was selected.
Sourcepub fn deselect_all(&mut self) -> bool
pub fn deselect_all(&mut self) -> bool
Deselect all drawings
Returns true if any drawings were selected.
Sourcepub fn is_selected(&self, id: usize) -> bool
pub fn is_selected(&self, id: usize) -> bool
Check if a specific drawing is selected
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Check if any drawings are selected
Sourcepub fn selected_ids(&self) -> impl Iterator<Item = usize> + '_
pub fn selected_ids(&self) -> impl Iterator<Item = usize> + '_
Get all selected drawing IDs
Sourcepub fn selection_count(&self) -> usize
pub fn selection_count(&self) -> usize
Get count of selected drawings
Sourcepub fn set_multi_select_mode(&mut self, enabled: bool)
pub fn set_multi_select_mode(&mut self, enabled: bool)
Enable/disable multi-select mode
Sourcepub fn is_multi_select_mode(&self) -> bool
pub fn is_multi_select_mode(&self) -> bool
Check if multi-select mode is active
Sourcepub fn select_all(&mut self, ids: impl IntoIterator<Item = usize>)
pub fn select_all(&mut self, ids: impl IntoIterator<Item = usize>)
Select all drawings from a list of IDs
Sourcepub fn prune(&mut self, existing_ids: &HashSet<usize>)
pub fn prune(&mut self, existing_ids: &HashSet<usize>)
Remove selection for drawings that no longer exist
Call this after deleting drawings to clean up stale selections.
Sourcepub fn single_selection(&self) -> Option<usize>
pub fn single_selection(&self) -> Option<usize>
Get single selected drawing ID (legacy compatibility)
Returns None if multiple drawings are selected.
Trait Implementations§
Source§impl Clone for SelectionService
impl Clone for SelectionService
Source§fn clone(&self) -> SelectionService
fn clone(&self) -> SelectionService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelectionService
impl Debug for SelectionService
Source§impl Default for SelectionService
impl Default for SelectionService
Source§fn default() -> SelectionService
fn default() -> SelectionService
Auto Trait Implementations§
impl Freeze for SelectionService
impl RefUnwindSafe for SelectionService
impl Send for SelectionService
impl Sync for SelectionService
impl Unpin for SelectionService
impl UnsafeUnpin for SelectionService
impl UnwindSafe for SelectionService
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more