pub struct SCContentSharingPickerConfiguration { /* private fields */ }Expand description
Configuration for the content sharing picker
Implementations§
Source§impl SCContentSharingPickerConfiguration
impl SCContentSharingPickerConfiguration
pub fn new() -> Self
Sourcepub fn default_from_system() -> Self
pub fn default_from_system() -> Self
Construct a configuration initialised with the system’s default values
(the equivalent of Apple’s SCContentSharingPicker.shared.defaultConfiguration).
Use this when you want “system defaults plus my one tweak” — call this
to get the baseline, then mutate the fields you care about. Compared
to SCContentSharingPickerConfiguration::new(), which starts from a
blank-slate SCContentSharingPickerConfiguration(), this preserves
any system-wide picker preferences the OS applies to fresh
configurations (e.g. allowed picker modes, default exclusion lists).
§Examples
use screencapturekit::content_sharing_picker::*;
// Start from the system defaults, then override only what you need.
let mut config = SCContentSharingPickerConfiguration::default_from_system();
config.set_excluded_bundle_ids(&["com.apple.dock"]);Sourcepub fn set_allowed_picker_modes(&mut self, modes: &[SCContentSharingPickerMode])
pub fn set_allowed_picker_modes(&mut self, modes: &[SCContentSharingPickerMode])
Set allowed picker modes
Sourcepub fn set_allows_changing_selected_content(&mut self, allows: bool)
pub fn set_allows_changing_selected_content(&mut self, allows: bool)
Set whether the user can change the selected content while sharing
When true, the user can modify their selection during an active session.
Sourcepub fn allows_changing_selected_content(&self) -> bool
pub fn allows_changing_selected_content(&self) -> bool
Get whether changing selected content is allowed
Sourcepub fn set_excluded_bundle_ids(&mut self, bundle_ids: &[&str])
pub fn set_excluded_bundle_ids(&mut self, bundle_ids: &[&str])
Set bundle identifiers to exclude from the picker
Applications with these bundle IDs will not appear in the picker.
Sourcepub fn excluded_bundle_ids(&self) -> Vec<String>
pub fn excluded_bundle_ids(&self) -> Vec<String>
Get the list of excluded bundle identifiers
Sourcepub fn set_excluded_window_ids(&mut self, window_ids: &[u32])
pub fn set_excluded_window_ids(&mut self, window_ids: &[u32])
Set window IDs to exclude from the picker
Windows with these IDs will not appear in the picker.
Sourcepub fn excluded_window_ids(&self) -> Vec<u32>
pub fn excluded_window_ids(&self) -> Vec<u32>
Get the list of excluded window IDs