use crate::Result;
use crate::UIElement;
use crate::patterns::UITextRange;
use crate::types::DockPosition;
use crate::types::ExpandCollapseState;
use crate::types::NavigateDirection;
use crate::types::Point;
use crate::types::RowOrColumnMajor;
use crate::types::ScrollAmount;
use crate::types::SupportedTextSelection;
use crate::types::ToggleState;
use crate::types::WindowInteractionState;
use crate::types::ZoomUnit;
use crate::variants::Variant;
pub trait Invoke {
fn invoke(&self) -> Result<()>;
}
pub trait Selection {
fn get_selection(&self) -> Result<Vec<UIElement>>;
fn can_select_multiple(&self) -> Result<bool>;
fn is_selection_required(&self) -> Result<bool>;
fn get_first_selected_item(&self) -> Result<UIElement>;
fn get_last_selected_item(&self) -> Result<UIElement>;
fn get_current_selected_item(&self) -> Result<UIElement>;
fn get_item_count(&self) -> Result<i32>;
}
pub trait SelectionItem {
fn select(&self) -> Result<()>;
fn add_to_selection(&self) -> Result<()>;
fn remove_from_selection(&self) -> Result<()>;
fn is_selected(&self) -> Result<bool>;
fn get_selection_container(&self) -> Result<UIElement>;
}
pub trait MultipleView {
fn get_supported_views(&self) -> Result<Vec<i32>>;
fn get_view_name(&self, view: i32) -> Result<String>;
fn get_current_view(&self) -> Result<i32>;
fn set_current_view(&self, view: i32) -> Result<()>;
}
pub trait ItemContainer {
fn find_item_by_property(&self, start_after: UIElement, property_id: i32, value: Variant) -> Result<UIElement>;
}
pub trait Scroll {
fn scroll(&self, horizontal_amount: ScrollAmount, vertical_amount: ScrollAmount) -> Result<()>;
fn set_scroll_percent(&self, horizontal_percent: f64, vertical_percent: f64) -> Result<()>;
fn get_horizontal_scroll_percent(&self) -> Result<f64>;
fn get_vertical_scroll_percent(&self) -> Result<f64>;
fn get_horizontal_view_size(&self) -> Result<f64>;
fn get_vertical_view_size(&self) -> Result<f64>;
fn is_horizontally_scrollable(&self) -> Result<bool>;
fn is_vertically_scrollable(&self) -> Result<bool>;
}
pub trait ScrollItem {
fn scroll_into_view(&self) -> Result<()>;
}
pub trait Window {
fn close(&self) -> Result<()>;
fn wait_for_input_idle(&self, milliseconds: i32) -> Result<bool>;
fn is_normal(&self) -> Result<bool>;
fn normal(&self) -> Result<()>;
fn can_maximize(&self) -> Result<bool>;
fn is_maximized(&self) -> Result<bool>;
fn maximize(&self) -> Result<()>;
fn can_minimize(&self) -> Result<bool>;
fn is_minimized(&self) -> Result<bool>;
fn minimize(&self) -> Result<()>;
fn is_modal(&self) -> Result<bool>;
fn is_topmost(&self) -> Result<bool>;
fn get_window_interaction_state(&self) -> Result<WindowInteractionState>;
}
pub trait Transform {
fn can_move(&self) -> Result<bool>;
fn move_to(&self, x: f64, y: f64) -> Result<()>;
fn can_resize(&self) -> Result<bool>;
fn resize(&self, width: f64, height: f64) -> Result<()>;
fn can_rotate(&self) -> Result<bool>;
fn rotate(&self, degrees: f64) -> Result<()>;
fn can_zoom(&self) -> Result<bool>;
fn get_zoom_level(&self) -> Result<f64>;
fn get_zoom_minimum(&self) -> Result<f64>;
fn get_zoom_maximum(&self) -> Result<f64>;
fn zoom(&self, zoom_value: f64) -> Result<()>;
fn zoom_by_unit(&self, zoom_unit: ZoomUnit) -> Result<()>;
}
pub trait Value {
fn set_value(&self, value: &str) -> Result<()>;
fn get_value(&self) -> Result<String>;
fn is_readonly(&self) -> Result<bool>;
}
pub trait ExpandCollapse {
fn expand(&self) -> Result<()>;
fn collapse(&self) -> Result<()>;
fn get_state(&self) -> Result<ExpandCollapseState>;
}
pub trait Toggle {
fn get_toggle_state(&self) -> Result<ToggleState>;
fn toggle(&self) -> Result<()>;
}
pub trait Grid {
fn get_column_count(&self) -> Result<i32>;
fn get_row_count(&self) -> Result<i32>;
fn get_item(&self, row: i32, column: i32) -> Result<UIElement>;
}
pub trait Table {
fn get_row_headers(&self) -> Result<Vec<UIElement>>;
fn get_column_headers(&self) -> Result<Vec<UIElement>>;
fn get_row_or_column_major(&self) -> Result<RowOrColumnMajor>;
}
pub trait CustomNavigation {
fn navigate(&self, direction: NavigateDirection) -> Result<UIElement>;
}
pub trait GridItem {
fn get_containing_grid(&self) -> Result<UIElement>;
fn get_row(&self) -> Result<i32>;
fn get_column(&self) -> Result<i32>;
fn get_row_span(&self) -> Result<i32>;
fn get_column_span(&self) -> Result<i32>;
}
pub trait TableItem {
fn get_row_header_items(&self) -> Result<Vec<UIElement>>;
fn get_column_header_items(&self) -> Result<Vec<UIElement>>;
}
pub trait Text {
fn get_range_from_point(&self, pt: Point) -> Result<UITextRange>;
fn get_range_from_child(&self, child: &UIElement) -> Result<UITextRange>;
fn get_selection(&self) -> Result<Vec<UITextRange>>;
fn get_visible_ranges(&self) -> Result<Vec<UITextRange>>;
fn get_document_range(&self) -> Result<UITextRange>;
fn get_supported_text_selection(&self) -> Result<SupportedTextSelection>;
fn get_range_from_annotation(&self, annotation: &UIElement) -> Result<UITextRange>;
fn get_caret_range(&self) -> Result<(bool, UITextRange)>;
}
pub trait RangeValue {
fn set_value(&self, value: f64) -> Result<()>;
fn get_value(&self) -> Result<f64>;
fn is_readonly(&self) -> Result<bool>;
fn get_maximum(&self) -> Result<f64>;
fn get_minimum(&self) -> Result<f64>;
fn get_large_change(&self) -> Result<f64>;
fn get_small_change(&self) -> Result<f64>;
}
pub trait Dock {
fn get_dock_position(&self) -> Result<DockPosition>;
fn set_dock_position(&self, position: DockPosition) -> Result<()>;
}