Skip to main content

ManagedFileChooserViewModel

Struct ManagedFileChooserViewModel 

Source
pub struct ManagedFileChooserViewModel { /* private fields */ }
Expand description

The state of the managed file chooser: the folder it shows, its entries, the selection, the filters and the quick links.

Implementations§

Source§

impl ManagedFileChooserViewModel

Source

pub fn new(options: ManagedFileDialogOptions) -> Rc<Self>

The constructor all the others start with.

Source

pub fn new_open_file( file_picker_open: &FilePickerOpenOptions, options: ManagedFileDialogOptions, ) -> Rc<Self>

The chooser of an open file picker.

Source

pub fn new_save_file( file_picker_save: &FilePickerSaveOptions, options: ManagedFileDialogOptions, ) -> Rc<Self>

The chooser of a save file picker.

Source

pub fn new_open_folder( folder_picker_open: &FolderPickerOpenOptions, options: ManagedFileDialogOptions, ) -> Rc<Self>

The chooser of a folder picker.

Source

pub fn cancel_requested( &self, handler: impl Fn() + 'static, ) -> Rc<dyn IDisposable>

Raised when the chooser is canceled.

Source

pub fn complete_requested( &self, handler: impl Fn(&[String]) + 'static, ) -> Rc<dyn IDisposable>

Raised with the chosen paths when the chooser completes.

Source

pub fn overwrite_prompt( &self, handler: impl Fn(&str) + 'static, ) -> Rc<dyn IDisposable>

Raised with the full path of an existing file the user chose to save to, when overwriting needs a confirmation.

Source

pub fn items(&self) -> FerroList<Rc<ManagedFileChooserItemViewModel>>

Source

pub fn filters(&self) -> FerroList<Rc<ManagedFileChooserFilterViewModel>>

Source

pub fn selected_items(&self) -> SelectedItemsList

The selected entries, as the untyped list the list box of the chooser fills: each item is a ManagedFileChooserItemViewModel.

Source

pub fn selected_item_view_models( &self, ) -> Vec<Rc<ManagedFileChooserItemViewModel>>

The selected entries as view models.

Source

pub fn location(&self) -> Option<String>

Source

pub fn set_location(&self, value: Option<String>)

Source

pub fn file_name(&self) -> Option<String>

Source

pub fn set_file_name(&self, value: Option<String>)

Source

pub fn selecting_folder(&self) -> bool

Source

pub fn show_filters(&self) -> bool

Source

pub fn selection_mode(&self) -> SelectionMode

Source

pub fn title(&self) -> Option<String>

The index of the quick link of the current location, or -1.

Setting the index only notifies a change: the index follows the location.

Source

pub fn selected_filter(&self) -> Option<Rc<ManagedFileChooserFilterViewModel>>

Source

pub fn set_selected_filter( &self, value: Option<Rc<ManagedFileChooserFilterViewModel>>, )

Source

pub fn show_hidden_files(&self) -> bool

Source

pub fn set_show_hidden_files(&self, value: bool)

Source

pub fn enter_pressed(&self)

Source

pub fn refresh(&self)

Source

pub fn navigate_folder( &self, path: Option<&Rc<dyn IStorageFolder>>, initial_selection_name: Option<&str>, )

Navigates to a folder, or to the current directory without one.

Source

pub fn navigate(&self, path: Option<&str>, initial_selection_name: Option<&str>)

Navigates to the directory path, or to the root of the file system when it does not exist, and selects the file named initial_selection_name there.

§Panics

Panics when the directory cannot be read for another reason than a denied access (the exception Navigate lets through in the original); see try_navigate.

Source

pub fn try_navigate( &self, path: Option<&str>, initial_selection_name: Option<&str>, ) -> Result<()>

navigate, reporting the failure to read the directory. A denied access is not a failure: the directory is shown empty, as the original catches the access exception.

Source

pub fn go_up(&self)

Source

pub fn cancel(&self)

Source

pub fn can_ok(&self, _parameter: Option<BoxedValue>) -> bool

Whether ok can complete the chooser.

Source

pub fn ok(&self)

Source

pub fn select_single_file(&self, item: &ManagedFileChooserItemViewModel)

Trait Implementations§

Source§

impl INotifyPropertyChanged for ManagedFileChooserViewModel

Source§

fn property_changed(&self) -> &Event<str>

The event raised when a property value changes.
Source§

fn as_notify_property_changing(&self) -> Option<&dyn INotifyPropertyChanging>

The object as INotifyPropertyChanging, when it also raises the event of a property that is about to change; None by default. Read more
Source§

impl MarkupTyped for ManagedFileChooserViewModel

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for ManagedFileChooserViewModel

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

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> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.