Struct winsafe::IFileSaveDialog
source · pub struct IFileSaveDialog(/* private fields */);
Available on crate feature
shell
only.Expand description
IFileSaveDialog
COM interface over IFileSaveDialogVT
.
Automatically calls
IUnknown::Release
when the object goes out of scope.
§Examples
Saving a TXT file:
use winsafe::{self as w, prelude::*, co};
let hparent: w::HWND; // initialized somewhere
let file_save = w::CoCreateInstance::<w::IFileSaveDialog>(
&co::CLSID::FileSaveDialog,
None,
co::CLSCTX::INPROC_SERVER,
)?;
file_save.SetFileTypes(&[
("Text files", "*.txt"),
("All files", "*.*"),
])?;
file_save.SetFileTypeIndex(1)?;
file_save.SetDefaultExtension("txt")?;
if file_save.Show(&hparent)? {
let chosen_file = file_save.GetResult()?
.GetDisplayName(co::SIGDN::FILESYSPATH)?;
println!("{}", chosen_file);
}
Trait Implementations§
source§impl Clone for IFileSaveDialog
impl Clone for IFileSaveDialog
source§impl Drop for IFileSaveDialog
impl Drop for IFileSaveDialog
source§impl ole_IUnknown for IFileSaveDialog
impl ole_IUnknown for IFileSaveDialog
source§unsafe fn from_ptr(p: *mut c_void) -> Self
unsafe fn from_ptr(p: *mut c_void) -> Self
Available on crate feature
ole
only.Creates an object from a COM virtual table pointer. Read more
source§unsafe fn as_mut(&mut self) -> &mut *mut c_void
unsafe fn as_mut(&mut self) -> &mut *mut c_void
Available on crate feature
ole
only.Returns a mutable reference do the underlying COM virtual table pointer. Read more
source§fn ptr(&self) -> *mut c_void
fn ptr(&self) -> *mut c_void
Available on crate feature
ole
only.Returns the pointer to the underlying COM virtual table. Read more
source§unsafe fn null() -> Self
unsafe fn null() -> Self
Available on crate feature
ole
only.Creates an object from a null COM virtual table pointer. Read more
source§fn QueryInterface<T>(&self) -> HrResult<T>where
T: ole_IUnknown,
fn QueryInterface<T>(&self) -> HrResult<T>where
T: ole_IUnknown,
Available on crate feature
ole
only.IUnknown::QueryInterface
method.source§impl shell_IFileDialog for IFileSaveDialog
impl shell_IFileDialog for IFileSaveDialog
source§fn AddPlace(&self, si: &impl shell_IShellItem, fdap: FDAP) -> HrResult<()>
fn AddPlace(&self, si: &impl shell_IShellItem, fdap: FDAP) -> HrResult<()>
IFileDialog::AddPlace
method.source§fn Advise(&self, fde: &impl shell_IFileDialogEvents) -> HrResult<u32>
fn Advise(&self, fde: &impl shell_IFileDialogEvents) -> HrResult<u32>
IFileDialog::Advise
method.source§fn ClearClientData(&self) -> HrResult<()>
fn ClearClientData(&self) -> HrResult<()>
IFileDialog::ClearClientData
method.source§fn GetCurrentSelection(&self) -> HrResult<IShellItem>
fn GetCurrentSelection(&self) -> HrResult<IShellItem>
IFileDialog::GetCurrentSelection
method.source§fn GetFileName(&self) -> HrResult<String>
fn GetFileName(&self) -> HrResult<String>
IFileDialog::GetFileName
method.source§fn GetFileTypeIndex(&self) -> HrResult<u32>
fn GetFileTypeIndex(&self) -> HrResult<u32>
IFileDialog::GetFileTypeIndex
method.source§fn GetFolder(&self) -> HrResult<IShellItem>
fn GetFolder(&self) -> HrResult<IShellItem>
IFileDialog::GetFolder
method.source§fn GetOptions(&self) -> HrResult<FOS>
fn GetOptions(&self) -> HrResult<FOS>
IFileDialog::GetOptions
method.source§fn GetResult(&self) -> HrResult<IShellItem>
fn GetResult(&self) -> HrResult<IShellItem>
IFileDialog::GetResult
method. Read moresource§fn SetClientGuid(&self, guid: &GUID) -> HrResult<()>
fn SetClientGuid(&self, guid: &GUID) -> HrResult<()>
IFileDialog::SetClientGuid
method.source§fn SetDefaultExtension(&self, default_extension: &str) -> HrResult<()>
fn SetDefaultExtension(&self, default_extension: &str) -> HrResult<()>
IFileDialog::SetDefaultExtension
method.source§fn SetDefaultFolder(&self, si: &impl shell_IShellItem) -> HrResult<()>
fn SetDefaultFolder(&self, si: &impl shell_IShellItem) -> HrResult<()>
IFileDialog::SetDefaultFolder
method.source§fn SetFileName(&self, name: &str) -> HrResult<()>
fn SetFileName(&self, name: &str) -> HrResult<()>
IFileDialog::SetFileName
method.source§fn SetFileNameLabel(&self, label: &str) -> HrResult<()>
fn SetFileNameLabel(&self, label: &str) -> HrResult<()>
IFileDialog::SetFileNameLabel
method.source§fn SetFileTypes<S: AsRef<str>>(&self, filter_spec: &[(S, S)]) -> HrResult<()>
fn SetFileTypes<S: AsRef<str>>(&self, filter_spec: &[(S, S)]) -> HrResult<()>
IFileDialog::SetFileTypes
method. Read moresource§fn SetFolder(&self, si: &impl shell_IShellItem) -> HrResult<()>
fn SetFolder(&self, si: &impl shell_IShellItem) -> HrResult<()>
IFileDialog::SetFolder
method.source§fn SetOkButtonLabel(&self, text: &str) -> HrResult<()>
fn SetOkButtonLabel(&self, text: &str) -> HrResult<()>
IFileDialog::SetOkButtonLabel
method.source§fn SetOptions(&self, opts: FOS) -> HrResult<()>
fn SetOptions(&self, opts: FOS) -> HrResult<()>
IFileDialog::SetOptions
method.source§impl shell_IFileSaveDialog for IFileSaveDialog
impl shell_IFileSaveDialog for IFileSaveDialog
source§fn SetSaveAsItem(&self, psi: &impl shell_IShellItem) -> HrResult<()>
fn SetSaveAsItem(&self, psi: &impl shell_IShellItem) -> HrResult<()>
IFileSaveDialog::SetSaveAsItem
method.source§impl shell_IModalWindow for IFileSaveDialog
impl shell_IModalWindow for IFileSaveDialog
impl Send for IFileSaveDialog
Auto Trait Implementations§
impl RefUnwindSafe for IFileSaveDialog
impl !Sync for IFileSaveDialog
impl Unpin for IFileSaveDialog
impl UnwindSafe for IFileSaveDialog
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
Mutably borrows from an owned value. Read more