use super::PickerOptions;
use std::ops::{Deref, DerefMut};
#[derive(Clone, Default)]
pub struct FolderPickerOpenOptions {
base: PickerOptions,
allow_multiple: bool,
}
impl Deref for FolderPickerOpenOptions {
type Target = PickerOptions;
fn deref(&self) -> &PickerOptions {
&self.base
}
}
impl DerefMut for FolderPickerOpenOptions {
fn deref_mut(&mut self) -> &mut PickerOptions {
&mut self.base
}
}
impl From<PickerOptions> for FolderPickerOpenOptions {
fn from(base: PickerOptions) -> Self {
Self { base, ..Self::default() }
}
}
impl FolderPickerOpenOptions {
pub fn new() -> Self {
Self::default()
}
pub fn allow_multiple(&self) -> bool {
self.allow_multiple
}
pub fn set_allow_multiple(&mut self, value: bool) {
self.allow_multiple = value;
}
pub fn with_allow_multiple(mut self, value: bool) -> Self {
self.allow_multiple = value;
self
}
}