selection_capture/
profile.rs1use crate::types::{CaptureMethod, FailureKind};
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq)]
4pub enum TriState {
5 Unknown,
6 Yes,
7 No,
8}
9
10#[derive(Clone, Debug, PartialEq, Eq)]
11pub struct AppProfile {
12 pub bundle_id: String,
13 pub ax_supported: TriState,
14 pub clipboard_borrow_supported: TriState,
15 pub last_success_method: Option<CaptureMethod>,
16 pub last_failure_kind: Option<FailureKind>,
17}
18
19impl AppProfile {
20 pub fn unknown(bundle_id: impl Into<String>) -> Self {
21 Self {
22 bundle_id: bundle_id.into(),
23 ax_supported: TriState::Unknown,
24 clipboard_borrow_supported: TriState::Unknown,
25 last_success_method: None,
26 last_failure_kind: None,
27 }
28 }
29}
30
31#[derive(Clone, Debug, Default, PartialEq, Eq)]
32pub struct AppProfileUpdate {
33 pub ax_supported: Option<TriState>,
34 pub clipboard_borrow_supported: Option<TriState>,
35 pub last_success_method: Option<CaptureMethod>,
36 pub last_failure_kind: Option<FailureKind>,
37}